From 8d1b4da382177ddd60ca8ebc3f1f7e24f1c6118b Mon Sep 17 00:00:00 2001 From: xaoxuu Date: Mon, 12 Feb 2024 23:45:08 +0800 Subject: [PATCH] [opt] style --- layout/_partial/scripts/services.ejs | 6 +++--- source/css/_layout/widgets/timeline.styl | 4 +--- source/css/_layout/widgets/toc.styl | 8 ++++---- source/js/services/timeline.js | 2 -- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/layout/_partial/scripts/services.ejs b/layout/_partial/scripts/services.ejs index 95d29cc..089de14 100644 --- a/layout/_partial/scripts/services.ejs +++ b/layout/_partial/scripts/services.ejs @@ -14,10 +14,10 @@ for (let id of Object.keys(ctx.services)) { const js = ctx.services[id]; if (id == 'siteinfo') { - const els = document.querySelectorAll('a.link-card[cardlink]'); - if (els?.length > 0) { + ctx.cardlinks = document.querySelectorAll('a.link-card[cardlink]'); + if (ctx.cardlinks?.length > 0) { utils.js(js, { defer: true }).then(function () { - setCardLink(els); + setCardLink(ctx.cardlinks); }); } } else { diff --git a/source/css/_layout/widgets/timeline.styl b/source/css/_layout/widgets/timeline.styl index 1b16a77..1725354 100644 --- a/source/css/_layout/widgets/timeline.styl +++ b/source/css/_layout/widgets/timeline.styl @@ -12,7 +12,7 @@ --fsp: $fsp2 .tag-plugin.timeline .timenode z-index 1 - margin-top: 0.5rem + margin-top: 0.25rem .header margin: 0.25rem var(--gap-padding) .user-info @@ -23,8 +23,6 @@ .header:before left: calc(6px - var(--gap-padding)) - &+.timenode - margin-top: 0.75rem .body border-radius: $border-card padding: 0.5rem 1rem diff --git a/source/css/_layout/widgets/toc.styl b/source/css/_layout/widgets/toc.styl index 486f6ba..cd63b33 100644 --- a/source/css/_layout/widgets/toc.styl +++ b/source/css/_layout/widgets/toc.styl @@ -6,8 +6,8 @@ &:before content: '' position absolute - top: 4px - bottom: 4px + top: 6px + bottom: 6px left: 0 width: 4px background: var(--block) @@ -36,8 +36,8 @@ &.active:before content: '' position absolute - top: 4px - bottom: 4px + top: 6px + bottom: 6px left: -8px width: 4px background: $color-theme diff --git a/source/js/services/timeline.js b/source/js/services/timeline.js index 8f98199..7629ec1 100644 --- a/source/js/services/timeline.js +++ b/source/js/services/timeline.js @@ -31,7 +31,6 @@ utils.jq(() => { if (hideStr && hideStr.length > 0) { hide = hideStr.split(","); } - console.log('arr', arr); arr.forEach((item, i) => { if (item.user && item.user.login && users.length > 0) { if (!users.includes(item.user.login)) { @@ -99,7 +98,6 @@ utils.jq(() => { cell += ''; cell += ''; - console.log('cell', cell, el); $(el).append(cell); }); });