From ac673cf967877961343d22779a2056c36e08e5cf Mon Sep 17 00:00:00 2001 From: xaoxuu Date: Wed, 24 Feb 2021 22:07:32 +0800 Subject: [PATCH] css --- layout/_partial/main/post_list/post_card.ejs | 12 +----- source/css/_layout/main.styl | 2 +- source/css/_layout/partial/read_next.styl | 2 +- source/css/_layout/partial/related_posts.styl | 5 +-- source/css/_layout/post_list.styl | 43 ++++++++++--------- source/css/_layout/sidebar.styl | 4 +- source/css/_layout/tag-plugins/ghcard.styl | 10 ++++- source/css/_layout/tag-plugins/link.styl | 26 ++++------- source/css/_layout/tag-plugins/timeline.styl | 2 +- source/css/_plugins/lazyload.styl | 4 +- 10 files changed, 49 insertions(+), 61 deletions(-) diff --git a/layout/_partial/main/post_list/post_card.ejs b/layout/_partial/main/post_list/post_card.ejs index cdbd6dc..0bdeb63 100755 --- a/layout/_partial/main/post_list/post_card.ejs +++ b/layout/_partial/main/post_list/post_card.ejs @@ -5,16 +5,8 @@ if (post.categories && post.categories.length > 0) { } %> <% if (post.cover) { %> -
- <% if (theme.plugins.lazyload && theme.plugins.lazyload.enable) { %> - <% if (theme.plugins.lazyload.loadingImg) { %> -
- <% } else { %> -
- <% } %> - <% } else { %> -
- <% } %> +
+
<% } %>

diff --git a/source/css/_layout/main.styl b/source/css/_layout/main.styl index 0e7e713..b4ae3f8 100644 --- a/source/css/_layout/main.styl +++ b/source/css/_layout/main.styl @@ -22,7 +22,7 @@ // pc上右边顶部留白 @media screen and (min-width: $device-tablet) .l_main - margin-top: $gap * 2 + margin-top: $gap // 移动端显示主导航栏 @media screen and (max-width: $device-tablet) diff --git a/source/css/_layout/partial/read_next.styl b/source/css/_layout/partial/read_next.styl index 1ba4078..73c1ce3 100644 --- a/source/css/_layout/partial/read_next.styl +++ b/source/css/_layout/partial/read_next.styl @@ -14,5 +14,5 @@ font-weight: 500 &.unread color: var(--text-p1) - font-size: 1.75rem + font-size: 2rem font-weight: 400 diff --git a/source/css/_layout/partial/related_posts.styl b/source/css/_layout/partial/related_posts.styl index 5ee1d36..a73342f 100644 --- a/source/css/_layout/partial/related_posts.styl +++ b/source/css/_layout/partial/related_posts.styl @@ -22,8 +22,6 @@ div.related-posts-wrap flex-direction: column overflow: hidden width: 360px - // opacity: 0.7 - border: 1px solid var(--hover-block) .img height: 180px @@ -32,7 +30,8 @@ div.related-posts-wrap width: 100% height: 100% object-fit: cover - trans1: transform 1s + &:not(.lazyload) + trans1: transform 1s @media screen and (max-width: $device-tablet) width: 300px .img diff --git a/source/css/_layout/post_list.styl b/source/css/_layout/post_list.styl index 4420f61..1f4ae90 100644 --- a/source/css/_layout/post_list.styl +++ b/source/css/_layout/post_list.styl @@ -50,32 +50,33 @@ trans1 color .excerpt font-size: $fs14 - .post-cover-wrap - overflow: hidden - margin-left: 0 - 1.5 * $gap - margin-top: 0 - 1.5 * $gap - margin-bottom: 1.25 * $gap - width: "calc(100% + 3 * %s)" % $gap .post-cover - background-position: center - background-size: cover - height: 320px - @media screen and (max-width: 900px) - height: 280px - @media screen and (max-width: $device-tablet) + overflow: hidden + margin-left: -1rem + margin-top: -1rem + margin-right: -1rem + img + object-fit: cover + disable-select() + width: 100% + border-radius: 0 height: 320px - @media screen and (max-width: $device-mobile) - height: 280px - @media screen and (max-width: $device-mobile-l) - height: 240px - @media screen and (max-width: $device-mobile-m) - height: 200px - &:not(.lazyload) - trans1: transform 1s + @media screen and (max-width: 900px) + height: 280px + @media screen and (max-width: $device-tablet) + height: 320px + @media screen and (max-width: $device-mobile) + height: 280px + @media screen and (max-width: $device-mobile-l) + height: 240px + @media screen and (max-width: $device-mobile-m) + height: 200px + &:not(.lazyload) + trans1: transform 1s .post-list .post-card.post:hover .post-title color: $color-hover - .post-cover + .post-cover img transform: scale(1.04) // wiki diff --git a/source/css/_layout/sidebar.styl b/source/css/_layout/sidebar.styl index 9e22b63..77029bf 100644 --- a/source/css/_layout/sidebar.styl +++ b/source/css/_layout/sidebar.styl @@ -1,8 +1,8 @@ .l_left .wrap display: flex flex-direction: column - height: "calc(100% - 4 * %s)" % $gap - margin-top: $gap * 2 + height: "calc(100% - 3 * %s)" % $gap + margin-top: $gap padding: $gap @media screen and (max-width: $device-tablet) height: "calc(100% - 2 * %s)" % $gap diff --git a/source/css/_layout/tag-plugins/ghcard.styl b/source/css/_layout/tag-plugins/ghcard.styl index e3d30ef..4b2ba63 100644 --- a/source/css/_layout/tag-plugins/ghcard.styl +++ b/source/css/_layout/tag-plugins/ghcard.styl @@ -1,3 +1,9 @@ -a.ghcard - display: inline-block +.tag-plugin.ghcard line-height: 0 + a.ghcard + display: inline-block + img + border-radius: 5px + transition: box-shadow + &:hover img + box-shadow: $boxshadow-float, $boxshadow-card-float diff --git a/source/css/_layout/tag-plugins/link.styl b/source/css/_layout/tag-plugins/link.styl index 61ae346..722a95a 100644 --- a/source/css/_layout/tag-plugins/link.styl +++ b/source/css/_layout/tag-plugins/link.styl @@ -12,11 +12,9 @@ cursor: pointer min-width 280px max-width: 100% + width: 320px box-shadow: $boxshadow-card transition: box-shadow - @media screen and (max-width: $device-mobile-l) - max-width: 100% - width: 100% border-radius: 8px &:hover box-shadow: $boxshadow-float, $boxshadow-card-float @@ -26,23 +24,15 @@ div.left,div.right pointer-events: none div.right - width: 54px - height: 54px - margin: 12px + width: 3rem + height: 3rem + margin: 0.75rem overflow: hidden flex-shrink: 0 - position: relative - i - font-size: 32px - line-height: 48px - margin-left: 4px img - display: block - position: absolute - border-radius: $border-card / 4 - top: 50% - left: 50% - transform: translate(-50%, -50%) + width: 100% + height: 100% + object-fit: cover div.left overflow: hidden margin-left: 16px @@ -56,7 +46,7 @@ font-size: $fs14 span.url flex-shrink: 0 - color: var(--text-p2) + color: var(--text-p3) font-size: $fs13 .md .link-group diff --git a/source/css/_layout/tag-plugins/timeline.styl b/source/css/_layout/tag-plugins/timeline.styl index cef2b55..bb6aa11 100644 --- a/source/css/_layout/tag-plugins/timeline.styl +++ b/source/css/_layout/tag-plugins/timeline.styl @@ -46,7 +46,7 @@ div.timenode span font-weight: 500 color: var(--text-p1) - padding: 0.8rem 16px + padding: 0.75rem 16px a visibility: hidden margin-left: 4px diff --git a/source/css/_plugins/lazyload.styl b/source/css/_plugins/lazyload.styl index a23a1a2..58f0acb 100644 --- a/source/css/_plugins/lazyload.styl +++ b/source/css/_plugins/lazyload.styl @@ -1,13 +1,13 @@ if hexo-config('plugins.lazyload.blurIn') == true img.lazyload:not(.placeholder) - trans2pro: transform 0.75s filter 0.25s + trans2pro: transform 1s filter 0.25s &:not(.loaded) filter blur(8px) &.loaded filter none else img.lazyload:not(.placeholder) - trans2pro: transform 0.75s opacity 0.5s + trans2pro: transform 1s opacity 0.5s &:not(.loaded) opacity: 0 &.loaded