diff --git a/_config.yml b/_config.yml index aa0d443..230684a 100755 --- a/_config.yml +++ b/_config.yml @@ -51,7 +51,7 @@ article: category_color: '探索号': '#f44336' # 文章许可协议 - license: '本文采用[署名-非商业性使用-相同方式共享 4.0 国际](https://creativecommons.org/licenses/by-nc-sa/4.0/)许可协议,转载请注明出处。' + license: '本文采用 [署名-非商业性使用-相同方式共享 4.0 国际](https://creativecommons.org/licenses/by-nc-sa/4.0/) 许可协议,转载请注明出处。' # 分享 share: # [wechat, weibo, email, link] # 相关文章,需要安装插件 (for layout: post) diff --git a/layout/_partial/widgets/recent.ejs b/layout/_partial/widgets/recent.ejs index e370868..ab9ec0d 100644 --- a/layout/_partial/widgets/recent.ejs +++ b/layout/_partial/widgets/recent.ejs @@ -33,10 +33,9 @@ function layoutDiv() { el += '' if (post.layout == 'wiki') { let proj = theme.wiki.projects[post.wiki]; - if (proj && proj.name) { - el += proj.name + ' / '; - } else if (post.wiki) { - el += post.wiki + ' / '; + let name = proj?.name || post?.wiki; + if (name) { + el += '' + name + '' + ''; } } el += (post.title || post.seo_title || post.wiki) + ''; diff --git a/source/css/_common/span.styl b/source/css/_common/span.styl index ae49c49..14f1942 100644 --- a/source/css/_common/span.styl +++ b/source/css/_common/span.styl @@ -3,6 +3,7 @@ span.dot,span.sep margin: 0 .25em span.dot:before content: '·' + font-weight: 900 span.sep:before content: '/' padding-left: 2px diff --git a/source/css/_layout/partial/related.styl b/source/css/_layout/partial/related.styl index 93fc221..a1ce263 100644 --- a/source/css/_layout/partial/related.styl +++ b/source/css/_layout/partial/related.styl @@ -31,19 +31,11 @@ color: var(--text-p1) font-weight: 500 font-size: 1rem - trans1 color + trans2 color border position: relative - padding-bottom: 4px - &:after - content: '' - position: absolute - left: 0 - width: 0 - height: 2px - bottom: 0 - border-radius: 2px - background: $color-hover - trans1 width + padding-bottom: 2px + border-bottom: 1px dashed var(--text-meta) + line-height: 1.6 .excerpt color: var(--text-p3) font-size: $fs-12 @@ -55,8 +47,7 @@ &:hover .title color: $color-hover - &:after - width: 100% + border-bottom: 1px solid $color-hover .related-wrap#read-next diff --git a/source/css/_layout/sidebar/footer.styl b/source/css/_layout/sidebar/footer.styl index 79c9f33..590fe41 100644 --- a/source/css/_layout/sidebar/footer.styl +++ b/source/css/_layout/sidebar/footer.styl @@ -1,7 +1,5 @@ .l_left>.footer - margin: 0.5rem var(--gap-l) 0 - @media screen and (max-width: $device-tablet) - margin-bottom: 1rem + margin: 0.5rem var(--gap-l) 1rem .social-wrap display: grid diff --git a/source/css/_layout/sidebar/header.styl b/source/css/_layout/sidebar/header.styl new file mode 100644 index 0000000..a1dcc62 --- /dev/null +++ b/source/css/_layout/sidebar/header.styl @@ -0,0 +1,111 @@ +.l_left nav.menu + margin-bottom: 1.5rem + +nav.menu + margin: 1rem 0 + background: var(--block) + border-radius: 6px + display: flex + padding: 1px + flex-wrap: wrap + &::-webkit-scrollbar + display: none + &::-webkit-scrollbar-track-piece + background: transparent + &::-webkit-scrollbar-thumb + display: none + a.nav-item + text-overflow: ellipsis + word-break: keep-all + margin: 1px + border-radius: 4px + font-size: $fs-14 + font-weight: 500 + overflow: hidden + padding: 0.375rem 0.5rem + color: var(--text-p3) + text-align: center + &.active, &:hover + color: var(--text-p1) + background: var(--card) + box-shadow: $boxshadow-button + +.l_left .menu a.nav-item + flex-grow: 1 + + +.logo-wrap + display: flex + align-items: center + overflow: hidden + a + color: inherit + display: flex + align-items: center + a.avatar + display: block + position: relative + width: 50px + height: 50px + flex-shrink: 0 + border-radius: 50px + overflow: hidden + margin-right: 1rem + div.bg + width: 100% + height: 100% + background-size: cover + img.avatar + margin: 2px + object-fit: cover + width: "calc(100% - 2 * %s)" % @margin + height: "calc(100% - 2 * %s)" % @margin + border-radius: @width + if hexo-config('style.animated_avatar.animate') + div.bg + trans1: opacity + position: absolute + opacity: 0 !important + z-index: -1 + @keyframes spin + from + transform:rotate(0deg) + to + transform:rotate(360deg) + if hexo-config('style.animated_avatar.animate') == 'always' + div.bg + opacity: 1 !important + animation: spin infinite 4s + animation-timing-function: linear + if hexo-config('style.animated_avatar.animate') == 'auto' + &:hover + div.bg + opacity: 1 !important + animation: spin infinite 4s + animation-timing-function: linear + + a.title + font-size: 1.75rem + font-weight: 900 + color: inherit + line-height: 1.2 + display: block + position: relative + .main + color: var(--text-p0) + .sub + color: var(--text-p1) + trans2 opacity transform + white-space: nowrap + .hover + position: absolute + bottom: 0 + transform: translateY(8px) + overflow: visible + &:hover + .normal + opacity: 0 + transform: translateY(-8px) + .hover + transform: translateY(0) + opacity: 1 !important diff --git a/source/css/_layout/sidebar/sidebar.styl b/source/css/_layout/sidebar/sidebar.styl index f84c6a4..21dd367 100644 --- a/source/css/_layout/sidebar/sidebar.styl +++ b/source/css/_layout/sidebar/sidebar.styl @@ -3,7 +3,7 @@ flex-direction: column word-break: break-all text-align: justify - height: "calc(100vh - 1 * %s)" % var(--gap-l) + height: 100vh .header margin: var(--gap-l) var(--gap-l) 0 margin-top: "calc(2 * %s)" % var(--gap-l) @@ -14,7 +14,6 @@ height: 100vh - .l_left[layout=wiki] padding-bottom: 0 height: 100vh @@ -24,83 +23,6 @@ margin-bottom: 6rem -.logo-wrap - display: flex - align-items: center - overflow: hidden - a - color: inherit - display: flex - align-items: center - a.avatar - display: block - position: relative - width: 50px - height: 50px - flex-shrink: 0 - border-radius: 50px - overflow: hidden - margin-right: 1rem - div.bg - width: 100% - height: 100% - background-size: cover - img.avatar - margin: 2px - object-fit: cover - width: "calc(100% - 2 * %s)" % @margin - height: "calc(100% - 2 * %s)" % @margin - border-radius: @width - if hexo-config('style.animated_avatar.animate') - div.bg - trans1: opacity - position: absolute - opacity: 0 !important - z-index: -1 - @keyframes spin - from - transform:rotate(0deg) - to - transform:rotate(360deg) - if hexo-config('style.animated_avatar.animate') == 'always' - div.bg - opacity: 1 !important - animation: spin infinite 4s - animation-timing-function: linear - if hexo-config('style.animated_avatar.animate') == 'auto' - &:hover - div.bg - opacity: 1 !important - animation: spin infinite 4s - animation-timing-function: linear - - a.title - font-size: 1.75rem - font-weight: 900 - color: inherit - line-height: 1.2 - display: block - position: relative - .main - color: var(--text-p0) - .sub - color: var(--text-p1) - trans2 opacity transform - white-space: nowrap - .hover - position: absolute - bottom: 0 - transform: translateY(8px) - overflow: visible - &:hover - .normal - opacity: 0 - transform: translateY(-8px) - .hover - transform: translateY(0) - opacity: 1 !important - - .l_left .widgets .widget-wrapper.logo-wrap.wiki margin-bottom: 1.5rem flex-direction: column @@ -114,38 +36,3 @@ color: $color-hover filter: unset !important -.l_left nav.menu - margin-bottom: 1.5rem - -nav.menu - margin: 1rem 0 - background: var(--block) - border-radius: 6px - display: flex - padding: 1px - flex-wrap: wrap - &::-webkit-scrollbar - display: none - &::-webkit-scrollbar-track-piece - background: transparent - &::-webkit-scrollbar-thumb - display: none - a.nav-item - text-overflow: ellipsis - word-break: keep-all - margin: 1px - border-radius: 4px - font-size: $fs-14 - font-weight: 500 - overflow: hidden - padding: 0.375rem 0.5rem - color: var(--text-p3) - text-align: center - &.active, &:hover - color: var(--text-p1) - background: var(--card) - box-shadow: $boxshadow-button - -.l_left .menu a.nav-item - flex-grow: 1 - diff --git a/source/css/_layout/widgets/ghrepo.styl b/source/css/_layout/widgets/ghrepo.styl index c4ac241..ae9f189 100644 --- a/source/css/_layout/widgets/ghrepo.styl +++ b/source/css/_layout/widgets/ghrepo.styl @@ -1,36 +1,34 @@ .widget-wrapper.ghrepo - .widget-body - a.repo - display: block - padding: 0.75rem 0.5rem + .repo + display: block + padding: 0.75rem 0.5rem + color: var(--text-p2) + background: var(--card) + border-radius: $border-block + box-shadow: $boxshadow-card + trans2 box-shadow transform + >div+div + margin-top: 0.5rem + span color: var(--text-p2) - background: var(--card) - border-radius: $border-block - box-shadow: $boxshadow-card - trans2 box-shadow transform - >div+div - margin-top: 0.5rem - span - color: var(--text-p2) - &:hover - box-shadow: $boxshadow-card-float - transform: translateY(-1px) - a.repo - svg - margin-right: 4px - .flex-row - display: flex - align-items: center - .repo-name - font-size: $fs-14 - font-weight: 700 - color: var(--text-p1) - .repo-desc - font-size: $fs-13 - margin-left: 2px - margin-right: 2px - .grid - font-size: $fs-13 - display: grid - grid-gap: 2px - grid-template-columns: repeat(auto-fill, "calc((100% - 2 * %s) / 3)" % 2px) + &:hover + box-shadow: $boxshadow-card-float + transform: translateY(-1px) + svg + margin-right: 4px + .flex-row + display: flex + align-items: center + .repo-name + font-size: $fs-14 + font-weight: 700 + color: var(--text-p1) + .repo-desc + font-size: $fs-13 + margin-left: 2px + margin-right: 2px + .grid + font-size: $fs-13 + display: grid + grid-gap: 2px + grid-template-columns: repeat(auto-fill, "calc((100% - 2 * %s) / 3)" % 2px) diff --git a/source/css/_layout/widgets/ghuser.styl b/source/css/_layout/widgets/ghuser.styl index c1cd706..2f2f366 100644 --- a/source/css/_layout/widgets/ghuser.styl +++ b/source/css/_layout/widgets/ghuser.styl @@ -8,91 +8,88 @@ padding: 1rem box-shadow: $boxshadow-card -.widget-wrapper.ghuser .widget-body .avatar - display: block - border-radius: 100% - margin: 1rem auto 1.25rem auto - max-width: 75% - overflow: hidden - img +.widget-wrapper.ghuser + .avatar display: block - @media screen and (max-width: $device-tablet) - max-width: 50% + border-radius: 100% + margin: 1rem auto 1.25rem auto + max-width: 75% + overflow: hidden + img + display: block + @media screen and (max-width: $device-tablet) + max-width: 50% -.widget-wrapper.ghuser .widget-body .username - font-weight: 900 - font-size: $fs-h2 - color: var(--text-p0) - margin: 0.5rem 0 + .username + font-weight: 900 + font-size: $fs-h2 + color: var(--text-p0) + margin: 0.5rem 0 -.widget-wrapper.ghuser .widget-body .bio - font-size: $fs-13 - margin: 0.5rem 0 + .bio + font-size: $fs-13 + margin: 0.5rem 0 -.widget-wrapper.ghuser .widget-body .follow - font-weight: 500 - border-radius: 64px - padding: 0.5rem 1rem - background: $color-theme - color: var(--card) - font-size: 1rem - align-self: stretch - text-align: center - line-height: 1.5 - display: flex - align-items: center - justify-content: center - trans1: background - svg - margin-right: 6px - &:hover - background: $color-hover + .follow + font-weight: 500 + border-radius: 64px + padding: 0.5rem 1rem + background: $color-theme + color: var(--card) + font-size: 1rem + align-self: stretch + text-align: center + line-height: 1.5 + display: flex + align-items: center + justify-content: center + trans1: background + svg + margin-right: 6px + &:hover + background: $color-hover -.widget-wrapper.ghuser .widget-body .menu - margin-bottom: 0 - background: none - a:hover - box-shadow: none - background: var(--block) - a.active - box-shadow: none - position: relative - &:after - content: '' - position: absolute - height: 3px - bottom: 0 - width: 32px - left: 'calc(50% - 0.5 * %s)' % @width - border-radius: 4px - background: $color-theme + .menu + margin-bottom: 0 + background: none + a:hover + box-shadow: none + background: var(--block) + a.active + box-shadow: none + position: relative + &:after + content: '' + position: absolute + height: 3px + bottom: 0 + width: 32px + left: 'calc(50% - 0.5 * %s)' % @width + border-radius: 4px + background: $color-theme -.widget-wrapper.ghuser .widget-body .buttons - margin: 1rem 0 - align-self: stretch - display: grid - grid-gap: 2px - grid-template-columns: repeat(auto-fill, "calc((100% - 2 * %s) / 3)" % 2px) + .buttons + margin: 1rem 0 + align-self: stretch + display: grid + grid-gap: 2px + grid-template-columns: repeat(auto-fill, "calc((100% - 2 * %s) / 3)" % 2px) -.widget-wrapper.ghuser .widget-body .btn - display: flex - flex-direction: column - align-items: center - color: inherit - border: 1px solid transparent - border-radius: 4px - padding: 0.25rem 0 - trans1: background - &:hover - background: var(--block) - - -.widget-wrapper.ghuser .widget-body .buttons .btn .title - font-size: 1rem - font-weight: 700 - - -.widget-wrapper.ghuser .widget-body .buttons .btn .desc - font-size: $fs-12 - color: var(--text-p3) - font-weight: 500 \ No newline at end of file + .btn + display: flex + flex-direction: column + align-items: center + color: inherit + border: 1px solid transparent + border-radius: 4px + padding: 0.25rem 0 + trans1: background + &:hover + background: var(--block) + .title + font-size: 1rem + font-weight: 700 + .desc + font-size: $fs-12 + color: var(--text-p3) + font-weight: 500 \ No newline at end of file diff --git a/source/css/_layout/widgets/recent.styl b/source/css/_layout/widgets/recent.styl new file mode 100644 index 0000000..4c446e9 --- /dev/null +++ b/source/css/_layout/widgets/recent.styl @@ -0,0 +1,15 @@ +.widget-wrapper.recent .widget-body + display: flex + flex-direction: column + align-items: flex-start + margin-top: 0.25rem + a + line-height: 1.2 + font-size: $fs-13 + margin: 0.25rem 0 + .title + font-size: $fs-13 + color: var(--text-p2) + &:hover + color: $color-hover + diff --git a/source/css/_layout/widgets/related.styl b/source/css/_layout/widgets/related.styl new file mode 100644 index 0000000..11a7632 --- /dev/null +++ b/source/css/_layout/widgets/related.styl @@ -0,0 +1,8 @@ +.widget-wrapper.related .widget-body a + margin-top: 0.5rem + margin-bottom: 1rem + .title + font-weight: 700 + font-size: $fs-14 + .excerpt + -webkit-line-clamp: 3 diff --git a/source/css/_layout/widgets/tagcloud.styl b/source/css/_layout/widgets/tagcloud.styl new file mode 100644 index 0000000..75d0d87 --- /dev/null +++ b/source/css/_layout/widgets/tagcloud.styl @@ -0,0 +1,8 @@ +.widget-wrapper.tagcloud .widget-body + margin-top: 0.25rem + a + word-break: break-word + color: var(--text-p2) + line-height: 1.5 + &:hover + color: $color-hover diff --git a/source/css/_layout/widgets/timeline.styl b/source/css/_layout/widgets/timeline.styl new file mode 100644 index 0000000..fdd9d6d --- /dev/null +++ b/source/css/_layout/widgets/timeline.styl @@ -0,0 +1,17 @@ +.widget-wrapper.timeline + .widget-body + margin-top: 0.5rem + .tag-plugin.timeline .timenode + .header + margin-bottom: 0.5rem + txt-ellipsis() + .user-info + background: var(--block) + &:hover + background: $color-hover + color: var(--card) + &:before + display: none + &+.timenode + margin-top: 0.75rem + \ No newline at end of file diff --git a/source/css/_layout/widgets/toc_common.styl b/source/css/_layout/widgets/toc_common.styl index 6e7d03a..5eab337 100644 --- a/source/css/_layout/widgets/toc_common.styl +++ b/source/css/_layout/widgets/toc_common.styl @@ -1,10 +1,13 @@ +.widget-wrapper.toc .widget-header + margin-top: 1rem + .widget-wrapper.toc.single .widget-header font-weight: 500 font-size: $fs-12 >span margin: 0.5rem 0 -.toc .widget-body +.widget-wrapper.toc .widget-body margin-top: 0 ul ul, ul ol padding-left: 0 @@ -34,7 +37,7 @@ padding-left: 2.9rem -.toc .toc-item +.widget-wrapper.toc .toc-item color: var(--text-p2) font-size: $fs-12 padding: 0 @@ -44,7 +47,7 @@ border-left-color: @color .toc-child .toc-item padding: 0 -.toc a.toc-link +.widget-wrapper.toc a.toc-link color: inherit display: block line-height: 1.2 diff --git a/source/css/_layout/widgets/toc_wiki.styl b/source/css/_layout/widgets/toc_wiki.styl index 4bf15b4..b553e53 100644 --- a/source/css/_layout/widgets/toc_wiki.styl +++ b/source/css/_layout/widgets/toc_wiki.styl @@ -1,7 +1,3 @@ -.widget-wrapper.toc - .widget-header - margin-top: 1rem - .widget-wrapper.toc.multi .widget-header color: var(--text-p1) font-size: $fs-14 diff --git a/source/css/_layout/widgets/widgets.styl b/source/css/_layout/widgets/widgets.styl index 2922c9d..ae06a5a 100644 --- a/source/css/_layout/widgets/widgets.styl +++ b/source/css/_layout/widgets/widgets.styl @@ -1,7 +1,8 @@ -.widgets .loading-wrap - margin: 0.5rem 0 +.widgets + .loading-wrap + margin: 0.5rem 0 -.l_left .widgets +.widgets overflow: scroll flex-grow: 1 scrollbar-width: none @@ -9,6 +10,7 @@ z-index: 1 line-height: 1.2 .widget-wrapper + display: block margin: 1rem 0 2rem .widget-header padding-left: var(--gap-l) @@ -52,55 +54,3 @@ margin-top: 0 .widget-wrapper+.widget-wrapper .widget-header margin-top: 3rem - - -.l_left .widgets - .widget-wrapper.recent .widget-body - display: flex - flex-direction: column - align-items: flex-start - margin-top: 0.25rem - a - line-height: 1.2 - font-size: $fs-13 - margin: 0.25rem 0 - padding: 2px 0 - .title - font-size: $fs-13 - color: var(--text-p2) - &:hover - color: $color-hover - .widget-wrapper.related .widget-body a - margin-top: 0.5rem - margin-bottom: 1rem - .title - font-weight: 700 - font-size: $fs-14 - .excerpt - -webkit-line-clamp: 3 - - .widget-wrapper.tagcloud .widget-body - margin-top: 0.25rem - a - word-break: break-word - color: var(--text-p2) - line-height: 1.5 - &:hover - color: $color-hover - - .widget-wrapper.timeline .widget-body - margin-top: 0.5rem - .tag-plugin.timeline .timenode - .header - margin-bottom: 0.5rem - txt-ellipsis() - .user-info - background: var(--block) - &:hover - background: $color-hover - color: var(--card) - &:before - display: none - &+.timenode - margin-top: 0.75rem - \ No newline at end of file