diff --git a/novel-front/src/main/resources/templates/mobile/book/book_ranking.html b/novel-front/src/main/resources/templates/mobile/book/book_ranking.html index f43f4ab..18de2e8 100644 --- a/novel-front/src/main/resources/templates/mobile/book/book_ranking.html +++ b/novel-front/src/main/resources/templates/mobile/book/book_ranking.html @@ -1,6 +1,4 @@ - - @@ -16,8 +14,6 @@
- - @@ -187,19 +192,19 @@ book.bookDesc = book.bookDesc.replace(/<[^>]+>/g, "").replace(/\s+/g, "").replace(/ /g, ""); } - bookListHtml += ("
\n" + + bookListHtml += ("
\n" + " \n" + - "
\n" + - " \n" + + " \n" + "\n" + "
\n" + "
\n" + - "
\n" + + "
\n" + " \n" + "
" + book.bookName + "
\n" + "
\n" + - "
\n" + + "
\n" + " \n" + "
作者:" + book.authorName + "
\n" + "
\n" + @@ -207,7 +212,7 @@ "
状态:" + (book.bookStatus == 0 ? '连载' : '完结') + "
\n" + "
更新:" + book.lastIndexUpdateTime.substr(0, 11) + "\n" + "
\n" + - "
简介:" + (book.bookDesc ? (book.bookDesc.length > 15 ? (book.bookDesc.substr(0, 15) + "...") : book.bookDesc) : book.bookDesc) + "
\n" + + "
简介:" + (book.bookDesc) + "
\n" + "\n" + "\n" + "
\n" + diff --git a/novel-front/src/main/resources/templates/mobile/common/css.html b/novel-front/src/main/resources/templates/mobile/common/css.html index e40c070..a6da973 100644 --- a/novel-front/src/main/resources/templates/mobile/common/css.html +++ b/novel-front/src/main/resources/templates/mobile/common/css.html @@ -26,6 +26,15 @@ } } + .book_name { + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + white-space: pre-wrap; + } + #footer { position: absolute; bottom: 0px; diff --git a/novel-front/src/main/resources/templates/mobile/index.html b/novel-front/src/main/resources/templates/mobile/index.html index 0cc9db3..799ca61 100644 --- a/novel-front/src/main/resources/templates/mobile/index.html +++ b/novel-front/src/main/resources/templates/mobile/index.html @@ -53,6 +53,44 @@ color: #3eaf7c; } + .container { + display: flex; + overflow-x: auto; /* 允许内容水平滚动 */ + white-space: nowrap; /* 禁止换行 */ + scroll-snap-type: x mandatory; /* 在滚动时强制对齐 snap-points */ + -ms-overflow-style: none; /* Internet Explorer 10+ */ + scrollbar-width: none; /* Firefox */ + } + + .container::-webkit-scrollbar { + width: 0; + height: 0; + } + + .container::-webkit-scrollbar-track, + .container::-webkit-scrollbar-thumb { + display: none; + } + + + .item { + flex: 0 0 calc(100% / 10); /* 每个元素宽度为容器的十分之一 */ + scroll-snap-align: start; + box-sizing: border-box; + text-align: center; + border-radius: 5px; + margin-right: 5px; + } + + .book_desc { + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 3; + -webkit-box-orient: vertical; + white-space: pre-wrap; + } + @@ -107,60 +145,58 @@ 精品推荐 +
- -
-
- 热门推荐 -
- - - -
+
+
+
+ 热门推荐 +
+ +
+ + +
+
@@ -184,7 +220,6 @@
-
@@ -226,7 +261,7 @@ "\n" + "
\n" + "
简介:  " + updateRankBook.bookDesc + "" + + " class=\"layui-elip layui-col-md11 layui-col-sm11 layui-col-lg11\">简介:" + updateRankBook.bookDesc + "" + "
\n" + "
");