diff --git a/src/components/mp-html/components/mp-html/node/node.vue b/src/components/mp-html/components/mp-html/node/node.vue index ec1f0da..d2609f7 100644 --- a/src/components/mp-html/components/mp-html/node/node.vue +++ b/src/components/mp-html/components/mp-html/node/node.vue @@ -821,7 +821,7 @@ export default { } } -
\ No newline at end of file + \ No newline at end of file diff --git a/src/config/markdown/config.ts b/src/config/markdown/config.ts index e7e90b2..786d141 100644 --- a/src/config/markdown/config.ts +++ b/src/config/markdown/config.ts @@ -1,6 +1,6 @@ import { useAppConfig } from '../useAppConfig' -const primaryColor = '#111827' +const primaryColor = '#1a1a1a' export const markdownConfig = { domain: useAppConfig().appBaseUrl.value, @@ -11,8 +11,8 @@ border-collapse:collapse; margin-bottom: 18px; overflow: hidden; font-size: 13px; -color: var(--routine); -background: #f2f6fc; +color: ${primaryColor}; +background: rgba(247, 247, 247, 1); border: 1px solid #dcdcdc; border-radius: 4px; `, @@ -28,68 +28,77 @@ border-bottom: 1px solid var(--classE); `, blockquote: ` padding: 8px 15px; +padding-bottom: 1px; color: #606266; -background: #f2f6fc; +background: rgba(247, 247, 247, 1); border-left: 5px solid ${primaryColor}; border-radius: 4px; line-height: 26px; margin-bottom: 18px; +margin-top: 4px; `, ul: 'padding-left: 15px;line-height: 1.85;', ol: 'padding-left: 15px;line-height: 1.85;', li: 'margin-bottom: 12px;line-height: 1.85;', h1: ` margin: 30px 0 20px; -color: var(--main); +color: ${primaryColor}; line-height: 24px; position: relative; font-size:1.2em; +font-weight: bold; `, h2: ` -color: var(--main); +color: ${primaryColor}; line-height: 24px; position: relative; margin: 22px 0 16px; font-size: 1.16em; +font-weight: bold; `, h3: ` -color: var(--main); +color: ${primaryColor}; line-height: 24px; position: relative; margin: 26px 0 18px; font-size: 1.14em; +font-weight: bold; `, h4: ` -color: var(--main); +color: ${primaryColor}; line-height: 24px; margin-bottom: 18px; position: relative; font-size: 1.12em; +font-weight: bold; `, h5: ` -color: var(--main); +color: ${primaryColor}; line-height: 24px; margin-bottom: 14px; position: relative; font-size: 1.1em; +font-weight: bold; `, h6: ` -color: #303133; +color: ${primaryColor}; line-height: 24px; margin-bottom: 14px; position: relative; font-size: 14px; +font-weight: bold; `, p: ` line-height: 1.65; -margin-bottom: 14px; +margin-bottom: 12px; font-size: 14px; `, code: ` `, - strong: 'font-weight: 700;color: rgb(248, 57, 41);', + strong: `font-weight: 700;color: ${primaryColor};`, video: 'width: 100%', }, - containStyle: 'font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif;font-size: 14px;color: #606266;word-spacing: 0.8px;letter-spacing: 0.8px;border-radius: 6px;background-color:#FFFFFF;', +// containStyle: 'font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif;font-size: 14px;color: #606266;word-spacing: 0.8px;letter-spacing: 0.8px; background-color:transparent;', + containStyle: 'word-spacing: 0.8px;letter-spacing: 0.8px; background-color:transparent;', loadingGif: '', emptyGif: '', diff --git a/src/subpkg-blog/post-detail/post-detail.vue b/src/subpkg-blog/post-detail/post-detail.vue index 2959855..5a2d5c2 100644 --- a/src/subpkg-blog/post-detail/post-detail.vue +++ b/src/subpkg-blog/post-detail/post-detail.vue @@ -122,6 +122,19 @@ async function loadData() { upvoteCount.value = post.value?.stats?.upvote ?? 0 } +// --- 返回顶部 --- +const showBackTop = ref(false) +let beforeScrollTop = 0 + +onPageScroll(({ scrollTop }) => { + showBackTop.value = scrollTop > 300 && scrollTop > beforeScrollTop + beforeScrollTop = scrollTop +}) + +function handleScrollToTop() { + uni.pageScrollTo({ scrollTop: 0, duration: 300 }) +} + // --- 生命周期 --- onLoad((options: IPostDetailLoadOptions) => { postName = options.metadataName @@ -145,8 +158,10 @@ onShareAppMessage(() => {