diff --git a/src/components/Pagination.astro b/src/components/Pagination.astro index 9cb8ef5..f9ab11b 100644 --- a/src/components/Pagination.astro +++ b/src/components/Pagination.astro @@ -34,7 +34,7 @@ if (totalPages <= 7) { {showPages.map(page => typeof page == 'number' ? (
  • - {page} + {page}
  • ) : (
  • {page}
  • diff --git a/src/pages/index.astro b/src/pages/index.astro index a08b695..c9319f4 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -4,7 +4,8 @@ import { getConfig } from "../../utils/config"; import { newsIndex } from "../../utils/rpc"; import { Image } from "astro:assets"; const config = getConfig(Astro); -const { code, data } = await newsIndex(config.id, 3, 1); +const { code, data, guess } = await newsIndex(config.id, 20, 1); +console.log(data) --- @@ -214,41 +215,89 @@ const { code, data } = await newsIndex(config.id, 3, 1);
    -
    -

    最新资讯

    +
    +

    最新资讯

    +

    + 霍尔果斯飞驰广告有限公司专注于提供从基础到进阶的SEO优化策略、广告投放方案、内容运营实战技巧以及网站转化率提升解决方案。同时,我们也持续分享最新的科技动态、财经洞察、软件评测等多类型优质资讯,助力用户在数字时代高效获取价值信息。 +

    - { - data.map((item) => { - return ( -
    -
    - -
    - {item.title} +
    +
    +
    + + { + data?.slice(2, 3).map((e, index) => ( + -
    - {item.created_at} -
    -

    - {item.title} -

    + )) + } +
    + +
    - ); - }) - } +
    +
    + { + data?.slice(18, 20).map((e, index) => ( + + )) + } + { + guess?.slice(0, 9).map((e, index) => ( + + )) + } +
    +
    +
    +
    @@ -277,10 +326,127 @@ const { code, data } = await newsIndex(config.id, 3, 1); margin-top: .5rem; } } + .news-box { + overflow: hidden; + } + + .xznews-box { + a { + color: #333333; + } + .t-list { + line-height: 30px; + } + + img { + width: 100%; + height: 100%; + } + + .spc-item { + font-weight: bold; + } + .xznews-f-pitem { + display: grid; + flex-direction: row; + grid-template-columns: 1fr 1fr; + } + + .pitem-item { + padding: .5rem; + } + + .item-img-wrapper { + aspect-ratio: 16 / 9; + width: 100%; + overflow: hidden; + } + + .item-img { + width: 100%; + height: 100%; + object-fit: cover; + } + + .t-item-spc { + display: grid; + grid-template-columns: 1fr 1fr; + gap: .5rem; + } + + .t-item-box { + display: flex; + align-items: center; + } + + .t-item { + display: flex; + } + + .es { + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + } + + display: grid; + gap:1rem; + flex-direction: row; + grid-template-columns: 1.3fr 1fr 1fr; + } + + .xznews-box .xznews-box-f .xznews-f-pitem .pitem-item .item-title,.fitem-tip { + margin-top:.3rem; + font-size: 16px; + color: #1A1A1A; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + text-align: center; + } + .xznews-box .xznews-box-s .xznews-s-list .s-list-item { + position: relative; + /* padding-left: 20px; */ + font-size: 16px; + color: #333333; + line-height: 32px; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + /* line-height: 34px; */ + cursor: pointer; + } + .xznews-container .xznews-box .xznews-box-s .spc-list { + border-bottom: 1px dashed #E5E5E5; + padding-bottom: 10px; + margin-bottom: 10px; + } + + .xznews-box .xznews-box-t .t-list .t-item-spc .t-item-box .t-item-title { + font-size: 14px; + color: #333333; + line-height: 21px; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + margin-bottom: 5px; + cursor: pointer; + } @media screen and (max-width: 768px) { .blog { padding: 1rem; - } + } + + .xznews-box { + padding:1rem; + display: flex; + flex-direction: column; + } } + \ No newline at end of file