From 54b3d697bfda46f39fa41ea73634f318ea809937 Mon Sep 17 00:00:00 2001 From: yizhankui <2669587581@qq.com> Date: Sun, 19 Feb 2023 13:53:25 +0800 Subject: [PATCH 1/7] =?UTF-8?q?style(ColumnContainer):=20=E4=B8=93?= =?UTF-8?q?=E6=A0=8Fcss=E9=A2=9C=E8=89=B2=E6=8A=BD=E7=A6=BB=E5=92=8C?= =?UTF-8?q?=E6=9A=97=E8=89=B2=E4=B8=BB=E9=A2=98=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/assets/css/main.css | 3 +++ .../ArticlesContent/End/ColumnContainer.vue | 14 +++++++------- frontend/unocss.config.ts | 6 ++++++ 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/frontend/assets/css/main.css b/frontend/assets/css/main.css index d517214..f91cebd 100644 --- a/frontend/assets/css/main.css +++ b/frontend/assets/css/main.css @@ -96,6 +96,7 @@ --jjext-color-fill: #3686ff; --jjext-color-more-list: #9aa3ab; --jjext-color-more-list-border: #ddd; + --jjext-color-column-primary-bg: #1d7dfa; --juejin-color-navs-item-after: #ef4444; --juejin-color-types-list: #71777c; --juejin-color-types-list-tag: #8a9aa9; @@ -230,6 +231,7 @@ html { --juejin-search-border:#ebebeb; --juejin-search-text:#5e6369; --juejin-404-bg:#fff; + --juejin-column-container-bg:#f7f8fa; } html.dark { @@ -362,6 +364,7 @@ html.dark { --juejin-search-border:#b9babe59; --juejin-search-text:#fff; --juejin-404-bg:#222323; + --juejin-column-container-bg:#1e1e20; } .page-enter-active, diff --git a/frontend/components/ArticlesContent/End/ColumnContainer.vue b/frontend/components/ArticlesContent/End/ColumnContainer.vue index dec6943..166d158 100644 --- a/frontend/components/ArticlesContent/End/ColumnContainer.vue +++ b/frontend/components/ArticlesContent/End/ColumnContainer.vue @@ -56,10 +56,10 @@ const handleClick = async (i: any) => { diff --git a/frontend/pages/article/[id].vue b/frontend/pages/article/[id].vue index 505e852..2efcc3c 100644 --- a/frontend/pages/article/[id].vue +++ b/frontend/pages/article/[id].vue @@ -79,12 +79,8 @@ onMounted(() => { position: relative; max-width: 100%; box-sizing: border-box; - } -} - -@media (max-width: 960px) { - .suspension-panel { - display: none; + padding-left: 2rem; + padding-right: 2rem; } } From ee5b406bb1d1113d8a37c49c590120df1e3de961 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=93=E7=A5=A5=E6=9F=8F?= <1760399176@qq.com> Date: Sun, 19 Feb 2023 15:33:44 +0800 Subject: [PATCH 3/7] fix: eslint --- frontend/components/ArticlesContent/SideBar/Right/Catalogue.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/components/ArticlesContent/SideBar/Right/Catalogue.vue b/frontend/components/ArticlesContent/SideBar/Right/Catalogue.vue index 9ece1c6..585eec4 100644 --- a/frontend/components/ArticlesContent/SideBar/Right/Catalogue.vue +++ b/frontend/components/ArticlesContent/SideBar/Right/Catalogue.vue @@ -46,7 +46,7 @@ const currentScrollTop = shallowRef(0) const getInitByScroll = () => { const articleDom = document.getElementById('markdown-body') const headings = articleDom?.querySelectorAll('h1, h2, h3') - headings?.forEach((item: any, i) => { + headings?.forEach((item: any) => { heading.value.push(item) }) From 420ccb0e36b514f4a7ad42d65be53861869ddfc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=93=E7=A5=A5=E6=9F=8F?= <1760399176@qq.com> Date: Sun, 19 Feb 2023 16:18:41 +0800 Subject: [PATCH 4/7] =?UTF-8?q?fix:=20=E8=BE=B9=E8=B7=9D=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../documentation/documentation/1.0.0/full_documentation.json | 2 +- frontend/components/ArticlesContent/index.vue | 2 +- frontend/pages/article/[id].vue | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/src/extensions/documentation/documentation/1.0.0/full_documentation.json b/backend/src/extensions/documentation/documentation/1.0.0/full_documentation.json index ec60958..36bb281 100644 --- a/backend/src/extensions/documentation/documentation/1.0.0/full_documentation.json +++ b/backend/src/extensions/documentation/documentation/1.0.0/full_documentation.json @@ -14,7 +14,7 @@ "name": "Apache 2.0", "url": "https://www.apache.org/licenses/LICENSE-2.0.html" }, - "x-generation-date": "2023-02-18T15:17:00.843Z" + "x-generation-date": "2023-02-19T08:18:39.372Z" }, "x-strapi-config": { "path": "/documentation", diff --git a/frontend/components/ArticlesContent/index.vue b/frontend/components/ArticlesContent/index.vue index bbcfe90..7d10aab 100644 --- a/frontend/components/ArticlesContent/index.vue +++ b/frontend/components/ArticlesContent/index.vue @@ -63,7 +63,7 @@ const { immerseState } = useImmerse()
·  阅读 {{ article.viewed }}
diff --git a/frontend/pages/article/[id].vue b/frontend/pages/article/[id].vue index 2efcc3c..33d5e4e 100644 --- a/frontend/pages/article/[id].vue +++ b/frontend/pages/article/[id].vue @@ -60,7 +60,7 @@ onMounted(() => { padding-right: 2.67rem; box-sizing: border-box; position: relative; - width: 800px; + width: 820px; max-width: 100%; @apply bg-jj-article mb-1.5rem; } From b63edf0635132b41e575841edadba5b1f7b9c353 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=93=E7=A5=A5=E6=9F=8F?= <1760399176@qq.com> Date: Sun, 19 Feb 2023 17:07:40 +0800 Subject: [PATCH 5/7] =?UTF-8?q?fix:=20=E5=88=B7=E6=96=B0=E5=90=8E#xxx?= =?UTF-8?q?=E5=AE=9A=E4=BD=8D=E5=88=B0=E4=B8=8A=E4=B8=80=E6=AC=A1=E6=B5=8F?= =?UTF-8?q?=E8=A7=88=E7=9A=84=E5=9C=B0=E6=96=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SideBar/Right/Catalogue.vue | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/frontend/components/ArticlesContent/SideBar/Right/Catalogue.vue b/frontend/components/ArticlesContent/SideBar/Right/Catalogue.vue index 585eec4..2f1fc57 100644 --- a/frontend/components/ArticlesContent/SideBar/Right/Catalogue.vue +++ b/frontend/components/ArticlesContent/SideBar/Right/Catalogue.vue @@ -119,20 +119,18 @@ watch(immerseState, (val) => { onMounted(() => { window.addEventListener('scroll', onScroll) window.addEventListener('scroll', scrollFixedCatalogue) - // const route = useRoute() - // if (route.hash) { - // const hashIndex = route.hash.slice(9) - // if (Number(hashIndex) !== -1) { - // isActive.value = Number(hashIndex) - // const a = document.createElement('a') - // a.href = `#heading-${hashIndex}` - // a.click() - // } - // } nextTick(() => { getInitByScroll() getInitByScrollFixedCatalogue() + const route = useRoute() + if (route.hash) { + const hashIndex = route.hash.slice(9) + if (Number(hashIndex) !== -1) { + activeSelect(Number(hashIndex)) + isActive.value = Number(hashIndex) + } + } }) }) From baf232fd5972b32ec38b03f5718aca06acd9b8b3 Mon Sep 17 00:00:00 2001 From: yizhankui <2669587581@qq.com> Date: Sun, 19 Feb 2023 17:44:11 +0800 Subject: [PATCH 6/7] =?UTF-8?q?fix(DarkToggle):=20=E4=B8=BB=E9=A2=98?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/components/Uno/DarkToggle.vue | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/frontend/components/Uno/DarkToggle.vue b/frontend/components/Uno/DarkToggle.vue index b7cf698..ab4f39d 100644 --- a/frontend/components/Uno/DarkToggle.vue +++ b/frontend/components/Uno/DarkToggle.vue @@ -8,24 +8,14 @@ const themeColor = computed(() => { return color.value === 'dark' ? '#000000' : '#ffffff' }) if (process.client) { - const item = localStorage.getItem('nuxt-color-mode') || 'dark' - localStorage.setItem('nuxt-color-mode', item) const setDark = () => { color.preference = color.value = 'dark' } const setLight = () => { color.preference = color.value = 'light' } - const setItem = () => { - color.preference = color.value = item - } // 先获取media const media = window.matchMedia('(prefers-color-scheme:dark)') - // 判断是否为暗主题 - if (media.matches) - // 如果是暗色主题则使用localStorage储存的上次使用的主题颜色 - setItem() - // 上面操作只会在页面加载时才会生效,因此,需要给media添加事件监听器 // MediaQueryList的maches属性会返回媒体查询的结果 function handleColorChange(e: MediaQueryListEvent) { From 318f23103498221360a75a898bb964b2aa7ff760 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=93=E7=A5=A5=E6=9F=8F?= <1760399176@qq.com> Date: Sun, 19 Feb 2023 17:46:01 +0800 Subject: [PATCH 7/7] =?UTF-8?q?fix:=20=E6=BB=9A=E5=8A=A8=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E5=B1=85=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/components/ArticlesContent/SideBar/Right/Catalogue.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/components/ArticlesContent/SideBar/Right/Catalogue.vue b/frontend/components/ArticlesContent/SideBar/Right/Catalogue.vue index 2f1fc57..547f824 100644 --- a/frontend/components/ArticlesContent/SideBar/Right/Catalogue.vue +++ b/frontend/components/ArticlesContent/SideBar/Right/Catalogue.vue @@ -80,7 +80,7 @@ const onScroll = () => { top: 0, }) : navRef.value.scrollTo({ - top: activeEleTop - navMid.value - headerHeight.value, + top: activeEleTop - navMid.value, }) } }