From 529ed95621593aa9288f7e19afe06bc495561dfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=91=E8=BD=BB=E7=8B=82?= <1677568218@qq.com> Date: Thu, 2 Feb 2023 00:31:27 +0800 Subject: [PATCH 1/2] =?UTF-8?q?refactor:=20=E5=AF=BC=E8=88=AA=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/settings.json | 1 + .../1.0.0/full_documentation.json | 6 +- frontend/app.vue | 8 - frontend/assets/css/main.css | 190 +++++++++++++++++- frontend/components/ArticlesContent/index.vue | 1 - frontend/components/Logo.vue | 2 +- frontend/components/Navs/Item.vue | 44 ++++ frontend/components/Navs/index.vue | 187 ++++------------- frontend/components/Types/index.vue | 2 +- frontend/server/api/articles/[id].ts | 1 + frontend/server/api/global/navs.ts | 6 +- frontend/types/IArticle.ts | 1 + frontend/types/INav.ts | 5 + frontend/unocss.config.ts | 11 +- 14 files changed, 295 insertions(+), 170 deletions(-) create mode 100644 frontend/components/Navs/Item.vue create mode 100644 frontend/types/INav.ts diff --git a/.vscode/settings.json b/.vscode/settings.json index 973ba5c..0e802c0 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,6 +6,7 @@ "files.associations": { "*.css": "postcss" }, + "css.lint.unknownAtRules": "ignore", // "editor.formatOnSave": true, // "editor.defaultFormatter": "esbenp.prettier-vscode", // "prettier.requireConfig": true, 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 f6530a8..a6a3756 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,11 +14,7 @@ "name": "Apache 2.0", "url": "https://www.apache.org/licenses/LICENSE-2.0.html" }, -<<<<<<< HEAD - "x-generation-date": "2023-01-31T11:23:22.255Z" -======= - "x-generation-date": "2023-01-31T16:13:30.302Z" ->>>>>>> 1a5033131415b92a7b73ce09625c5308c0f517ef + "x-generation-date": "2023-02-01T16:14:06.450Z" }, "x-strapi-config": { "path": "/documentation", diff --git a/frontend/app.vue b/frontend/app.vue index 74a1357..b3fc93c 100644 --- a/frontend/app.vue +++ b/frontend/app.vue @@ -58,12 +58,4 @@ body, margin: 0; padding: 0; } - -html.dark { - background: #18181c; - color: white; -} -html.light { - background-color: #F4F5F5; -} diff --git a/frontend/assets/css/main.css b/frontend/assets/css/main.css index 7a3be93..45ab80e 100644 --- a/frontend/assets/css/main.css +++ b/frontend/assets/css/main.css @@ -1,5 +1,5 @@ :root { - --primary-color: #316c72; + --primary-color: #1e80ff; --dark-bg: #18181c; --link: #007fff; --jjext-color-brand: #1e80ff; @@ -81,6 +81,194 @@ --jjext-color-bg-gray:#27272a; } +html.light{ + --juejin-layer-golden-1: #faf3e5; + --juejin-layer-golden-2: #f6e7cb; + --juejin-component-hover: #e4e6eb; + --juejin-gradientgold_normal_start: #fde8c3; + --juejin-gradientgold_normal_end: #edd3a7; + --juejin-gradientgold_hover_start: #f1dfc0; + --juejin-gradientgold_hover_end: #e6c99b; + --juejin-gradientgold_click_start: #e9d5b3; + --juejin-gradientgold_click_end: #dac29a; + --juejin-layer_loading_start: rgba(228,230,235,0); + --juejin-layer_loading_end: rgba(228,230,235,0.5); + --juejin-layer_golden_2: #faf3e5; + --juejin-font_golden_4: #7e5d25; + --juejin-font-golden-1: #7e5d25; + --juejin-font-golden-2: #8a795c; + --juejin-font-golden-3: #d6b885; + --juejin-gray-0: #fff; + --juejin-gray-1-1: #e4e6eb; + --juejin-gray-1-2: rgba(228,230,235,0.5); + --juejin-gray-1-3: #e4e6eb; + --juejin-gray-2: #f2f3f5; + --juejin-gray-3: #f7f8fa; + --juejin-background: #f2f3f5; + --juejin-layer-1: #fff; + --juejin-layer-2-1: #f7f8fa; + --juejin-layer-2-2: rgba(247,248,250,0.7); + --juejin-layer-3-fill: #f2f3f5; + --juejin-layer-3-border: #e4e6eb; + --juejin-layer-4-dropdown: #fff; + --juejin-layer-5: #fff; + --juejin-brand-1-normal: #1e80ff; + --juejin-brand-2-hover: #1171ee; + --juejin-brand-3-click: #0060dd; + --juejin-brand-4-disable: #abcdff; + --juejin-brand-5-light: #eaf2ff; + --juejin-mask-1: rgba(0,0,0,0.4); + --juejin-mask-2: #fff; + --juejin-mask-3: none; + --juejin-brand-fill1-normal: rgba(30,128,255,0.05); + --juejin-brand-fill2-hover: rgba(30,128,255,0.1); + --juejin-brand-fill3-click: rgba(30,128,255,0.2); + --juejin-brand-stroke1-normal: rgba(30,128,255,0.3); + --juejin-brand-stroke2-hover: rgba(30,128,255,0.45); + --juejin-brand-stroke3-click: rgba(30,128,255,0.6); + --juejin-font_danger: #ff5132; + --juejin-font-1: #252933; + --juejin-font-2: #515767; + --juejin-font-3: #8a919f; + --juejin-font-4: #c2c8d1; + --juejin-font-brand1-normal: #1e80ff; + --juejin-font-brand2-hover: #1171ee; + --juejin-font-brand3-click: #0060dd; + --juejin-font-brand4-disable: #abcdff; + --juejin-font-success: #2bb91b; + --juejin-font-warning: #ff8412; + --juejin-font-danger: #ff5132; + --juejin-font-white-disable: #fff; + --juejin-font-white: #fff; + --juejin-success-1-normal: #00b453; + --juejin-success-2-deep: #00964e; + --juejin-success-3-light: #e2faed; + --juejin-warning-1-normal: #ff7426; + --juejin-warning-2-deep: #e05e00; + --juejin-warning-3-light: #fff3e5; + --juejin-danger-1-normal: #f64242; + --juejin-danger-2-deep: #cb2634; + --juejin-danger-3-light: #fff2ff; + --juejin-sub-1-purple: #9f54ff; + --juejin-sub-2-blue: #57a0ff; + --juejin-sub-3-cyan: #5ad7ff; + --juejin-sub-4-green: #33d790; + --juejin-sub-5-yellow: #ffcc15; + --juejin-sub-6-orange: #ff834e; + --juejin-sub-7-red: #ff5e54; + --juejin-coupon_1_button: #f64242; + --juejin-coupon_1_button_disable: #faa0a0; + --juejin-coupon_2_card: rgba(255,245,244,0.7); + --juejin-coupon_3_stroke: rgba(246,66,66,0.2); + --juejin-navigation: #fff; + --juejin-shade-1: rgba(0,0,0,0.4); + --juejin-shade-2: rgba(0,0,0,0.6); + --juejin-popup: #fff; + --juejin-popover: rgba(0,0,0,0.8); + --juejin-sheets: #f7f8fa; + --juejin-coupon-button: #f64242; + --juejin-coupon-button-disable: #faa0a0; + --juejin-coupon-card: rgba(255,245,244,0.7); + --juejin-layer-loading-start: #e4e6eb; + --juejin-layer-loading-end: rgba(228,230,235,0.5); + --juejin-font-priv-hint: #916be1; + --juejin-background-jscore-radar: #232323 +} + +html.dark{ + --juejin-layer-golden-1: rgba(209,171,97,0.23); + --juejin-layer-golden-2: rgba(237,211,167,0.4); + --juejin-component-hover: hsla(0,0%,100%,0.2); + --juejin-gradientgold_normal_start: #fde8c3; + --juejin-gradientgold_normal_end: #edd3a7; + --juejin-gradientgold_hover_start: #f1dfc0; + --juejin-gradientgold_hover_end: #e6c99b; + --juejin-gradientgold_click_start: #e9d5b3; + --juejin-gradientgold_click_end: #dac29a; + --juejin-layer_loading_start: hsla(0,0%,100%,0); + --juejin-layer_loading_end: hsla(0,0%,100%,0.2); + --juejin-layer_golden_2: rgba(209,171,97,0.12); + --juejin-font_golden_4: #7e5d25; + --juejin-font-golden-1: #edd3a7; + --juejin-font-golden-2: #bea985; + --juejin-font-golden-3: #8e7f64; + --juejin-gray-0: #000; + --juejin-gray-1-1: hsla(0,0%,100%,0.2); + --juejin-gray-1-2: hsla(0,0%,100%,0.1); + --juejin-gray-1-3: #464646; + --juejin-gray-2: hsla(0,0%,100%,0.12); + --juejin-gray-3: hsla(0,0%,100%,0.08); + --juejin-background: #000; + --juejin-layer-1: #181818; + --juejin-layer-2-1: hsla(0,0%,100%,0.08); + --juejin-layer-2-2: hsla(0,0%,100%,0.08); + --juejin-layer-3-fill: hsla(0,0%,100%,0.08); + --juejin-layer-3-border: hsla(0,0%,100%,0.2); + --juejin-layer-4-dropdown: #2f2f2f; + --juejin-layer-5: hsla(0,0%,100%,0.12); + --juejin-brand-1-normal: #2986ff; + --juejin-brand-2-hover: #1473ed; + --juejin-brand-3-click: #0563dd; + --juejin-brand-4-disable: rgba(41,134,255,0.4); + --juejin-brand-5-light: rgba(30,128,255,0.2); + --juejin-mask-1: hsla(0,0%,100%,0.4); + --juejin-mask-2: #282828; + --juejin-mask-3: rgba(0,0,0,0.05); + --juejin-brand-fill1-normal: rgba(41,134,255,0.15); + --juejin-brand-fill2-hover: rgba(20,115,237,0.25); + --juejin-brand-fill3-click: rgba(5,99,221,0.35); + --juejin-brand-stroke1-normal: rgba(41,134,255,0.4); + --juejin-brand-stroke2-hover: rgba(20,115,237,0.6); + --juejin-brand-stroke3-click: rgba(5,99,221,0.6); + --juejin-font_danger: #f85959; + --juejin-font-1: hsla(0,0%,100%,0.9); + --juejin-font-2: hsla(0,0%,100%,0.7); + --juejin-font-3: hsla(0,0%,100%,0.55); + --juejin-font-4: hsla(0,0%,100%,0.45); + --juejin-font-brand1-normal: #4495ff; + --juejin-font-brand2-hover: #2b88ff; + --juejin-font-brand3-click: #1371ec; + --juejin-font-brand4-disable: rgba(19,113,236,0.4); + --juejin-font-success: #40c17b; + --juejin-font-warning: #ff8541; + --juejin-font-danger: #c62633; + --juejin-font-white-disable: hsla(0,0%,100%,0.6); + --juejin-font-white: #fff; + --juejin-success-1-normal: #40c17b; + --juejin-success-2-deep: #008445; + --juejin-success-3-light: rgba(64,193,123,0.2); + --juejin-warning-1-normal: #ff8541; + --juejin-warning-2-deep: #d85c02; + --juejin-warning-3-light: rgba(255,133,65,0.2); + --juejin-danger-1-normal: #f85959; + --juejin-danger-2-deep: #c62633; + --juejin-danger-3-light: rgba(248,89,89,0.2); + --juejin-sub-1-purple: #a965ff; + --juejin-sub-2-blue: #68a9ff; + --juejin-sub-3-cyan: #74f4ed; + --juejin-sub-4-green: #50e68c; + --juejin-sub-5-yellow: #ffd748; + --juejin-sub-6-orange: #ff8f60; + --juejin-sub-7-red: #ff6e65; + --juejin-coupon_1_button: rgba(251,86,83,0.8); + --juejin-coupon_1_button_disable: #782928; + --juejin-coupon_2_card: rgba(255,176,176,0.08); + --juejin-coupon_3_stroke: rgba(246,66,66,0.18); + --juejin-navigation: #181818; + --juejin-shade-1: rgba(0,0,0,0.6); + --juejin-shade-2: rgba(0,0,0,0.7); + --juejin-popup: #282828; + --juejin-popover: #323232; + --juejin-sheets: #222; + --juejin-coupon-button: rgba(251,86,83,0.8); + --juejin-coupon-button-disable: #782928; + --juejin-coupon-card: rgba(255,176,176,0.08); + --juejin-layer-loading-start: #fff; + --juejin-layer-loading-end: hsla(0,0%,100%,0.2); + --juejin-font-priv-hint: #916be1; + --juejin-background-jscore-radar: #232323 +} + .page-enter-active, .page-leave-active { transition: all 0.3s ease-in-out; diff --git a/frontend/components/ArticlesContent/index.vue b/frontend/components/ArticlesContent/index.vue index 8a8eaba..965517f 100644 --- a/frontend/components/ArticlesContent/index.vue +++ b/frontend/components/ArticlesContent/index.vue @@ -54,7 +54,6 @@ function transformToId() { } } } - onMounted(() => { if (article.value) handleChange(article.value.content) diff --git a/frontend/components/Logo.vue b/frontend/components/Logo.vue index d51b5e6..57afd81 100644 --- a/frontend/components/Logo.vue +++ b/frontend/components/Logo.vue @@ -1,5 +1,5 @@ + + diff --git a/frontend/components/Navs/index.vue b/frontend/components/Navs/index.vue index 1f522b1..26196dc 100644 --- a/frontend/components/Navs/index.vue +++ b/frontend/components/Navs/index.vue @@ -1,172 +1,67 @@ diff --git a/frontend/components/Types/index.vue b/frontend/components/Types/index.vue index 13803e5..5d347a0 100644 --- a/frontend/components/Types/index.vue +++ b/frontend/components/Types/index.vue @@ -7,7 +7,7 @@ const { data: TypeList } = await useFetch('/api/global/types')
diff --git a/frontend/server/api/articles/[id].ts b/frontend/server/api/articles/[id].ts index 912b182..b5e1dfd 100644 --- a/frontend/server/api/articles/[id].ts +++ b/frontend/server/api/articles/[id].ts @@ -39,6 +39,7 @@ export default defineEventHandler(async (event): Promise => { data{ attributes{ type + alias } } } diff --git a/frontend/server/api/global/navs.ts b/frontend/server/api/global/navs.ts index ffd9050..5d12093 100644 --- a/frontend/server/api/global/navs.ts +++ b/frontend/server/api/global/navs.ts @@ -1,9 +1,5 @@ import { useGraphql } from '~~/utils/useGraphql' -interface INavItem { - name: string - url: string - badge?: string -} +import type { INavItem } from '~~/types/INav' export default defineEventHandler(async (): Promise => { const reqQuery = `query{ global{ diff --git a/frontend/types/IArticle.ts b/frontend/types/IArticle.ts index 14365b1..7878653 100644 --- a/frontend/types/IArticle.ts +++ b/frontend/types/IArticle.ts @@ -14,6 +14,7 @@ interface ITagItem { interface IType { type: string + alias: string } interface IColumnArticleItem { diff --git a/frontend/types/INav.ts b/frontend/types/INav.ts new file mode 100644 index 0000000..cf254e3 --- /dev/null +++ b/frontend/types/INav.ts @@ -0,0 +1,5 @@ +export interface INavItem { + nav: string + url: string + badge?: string +} diff --git a/frontend/unocss.config.ts b/frontend/unocss.config.ts index 4c87af6..0a97a45 100644 --- a/frontend/unocss.config.ts +++ b/frontend/unocss.config.ts @@ -10,8 +10,6 @@ import { } from 'unocss' export default defineConfig({ shortcuts: [ - ['btn', 'px-4 py-1 rounded inline-block bg-teal-600 text-white cursor-pointer hover:bg-teal-700 disabled:cursor-default disabled:bg-gray-600 disabled:opacity-50'], - ['icon-btn', 'inline-block cursor-pointer select-none opacity-75 transition duration-200 ease-in-out hover:opacity-100 hover:text-teal-600'], ['f-c-c', 'flex justify-center items-center'], ], presets: [ @@ -48,6 +46,15 @@ export default defineConfig({ jj_font_white: 'var(--jjext-color-font-white)', // #ffffff jj_font_black: 'var(--jjext-color-font-1)', // #252933 jj_bg_gray: 'var(--jjext-color-bg-gray)', // #27272a + jj_navigation: 'var(--juejin-navigation)', + }, + breakpoints: { + xs: '320px', + sm: '640px', + md: '768px', + lg: '1024px', + xl: '1280px', + xxl: '1536px', }, }, }) From 66831f793d6adc83ab1e69e3f4e39b2c0ac8c5eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=91=E8=BD=BB=E7=8B=82?= <1677568218@qq.com> Date: Thu, 2 Feb 2023 00:35:23 +0800 Subject: [PATCH 2/2] =?UTF-8?q?refactor:=20=E5=AF=BC=E8=88=AA=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/settings.json | 1 + frontend/app.vue | 8 - frontend/assets/css/main.css | 190 +++++++++++++++++- frontend/components/ArticlesContent/index.vue | 1 - frontend/components/Logo.vue | 2 +- frontend/components/Navs/Item.vue | 44 ++++ frontend/components/Navs/index.vue | 187 ++++------------- frontend/components/Types/index.vue | 2 +- frontend/server/api/articles/[id].ts | 1 + frontend/server/api/global/navs.ts | 6 +- frontend/types/IArticle.ts | 1 + frontend/types/INav.ts | 5 + frontend/unocss.config.ts | 11 +- 13 files changed, 294 insertions(+), 165 deletions(-) create mode 100644 frontend/components/Navs/Item.vue create mode 100644 frontend/types/INav.ts diff --git a/.vscode/settings.json b/.vscode/settings.json index 973ba5c..0e802c0 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,6 +6,7 @@ "files.associations": { "*.css": "postcss" }, + "css.lint.unknownAtRules": "ignore", // "editor.formatOnSave": true, // "editor.defaultFormatter": "esbenp.prettier-vscode", // "prettier.requireConfig": true, diff --git a/frontend/app.vue b/frontend/app.vue index 74a1357..b3fc93c 100644 --- a/frontend/app.vue +++ b/frontend/app.vue @@ -58,12 +58,4 @@ body, margin: 0; padding: 0; } - -html.dark { - background: #18181c; - color: white; -} -html.light { - background-color: #F4F5F5; -} diff --git a/frontend/assets/css/main.css b/frontend/assets/css/main.css index 7a3be93..45ab80e 100644 --- a/frontend/assets/css/main.css +++ b/frontend/assets/css/main.css @@ -1,5 +1,5 @@ :root { - --primary-color: #316c72; + --primary-color: #1e80ff; --dark-bg: #18181c; --link: #007fff; --jjext-color-brand: #1e80ff; @@ -81,6 +81,194 @@ --jjext-color-bg-gray:#27272a; } +html.light{ + --juejin-layer-golden-1: #faf3e5; + --juejin-layer-golden-2: #f6e7cb; + --juejin-component-hover: #e4e6eb; + --juejin-gradientgold_normal_start: #fde8c3; + --juejin-gradientgold_normal_end: #edd3a7; + --juejin-gradientgold_hover_start: #f1dfc0; + --juejin-gradientgold_hover_end: #e6c99b; + --juejin-gradientgold_click_start: #e9d5b3; + --juejin-gradientgold_click_end: #dac29a; + --juejin-layer_loading_start: rgba(228,230,235,0); + --juejin-layer_loading_end: rgba(228,230,235,0.5); + --juejin-layer_golden_2: #faf3e5; + --juejin-font_golden_4: #7e5d25; + --juejin-font-golden-1: #7e5d25; + --juejin-font-golden-2: #8a795c; + --juejin-font-golden-3: #d6b885; + --juejin-gray-0: #fff; + --juejin-gray-1-1: #e4e6eb; + --juejin-gray-1-2: rgba(228,230,235,0.5); + --juejin-gray-1-3: #e4e6eb; + --juejin-gray-2: #f2f3f5; + --juejin-gray-3: #f7f8fa; + --juejin-background: #f2f3f5; + --juejin-layer-1: #fff; + --juejin-layer-2-1: #f7f8fa; + --juejin-layer-2-2: rgba(247,248,250,0.7); + --juejin-layer-3-fill: #f2f3f5; + --juejin-layer-3-border: #e4e6eb; + --juejin-layer-4-dropdown: #fff; + --juejin-layer-5: #fff; + --juejin-brand-1-normal: #1e80ff; + --juejin-brand-2-hover: #1171ee; + --juejin-brand-3-click: #0060dd; + --juejin-brand-4-disable: #abcdff; + --juejin-brand-5-light: #eaf2ff; + --juejin-mask-1: rgba(0,0,0,0.4); + --juejin-mask-2: #fff; + --juejin-mask-3: none; + --juejin-brand-fill1-normal: rgba(30,128,255,0.05); + --juejin-brand-fill2-hover: rgba(30,128,255,0.1); + --juejin-brand-fill3-click: rgba(30,128,255,0.2); + --juejin-brand-stroke1-normal: rgba(30,128,255,0.3); + --juejin-brand-stroke2-hover: rgba(30,128,255,0.45); + --juejin-brand-stroke3-click: rgba(30,128,255,0.6); + --juejin-font_danger: #ff5132; + --juejin-font-1: #252933; + --juejin-font-2: #515767; + --juejin-font-3: #8a919f; + --juejin-font-4: #c2c8d1; + --juejin-font-brand1-normal: #1e80ff; + --juejin-font-brand2-hover: #1171ee; + --juejin-font-brand3-click: #0060dd; + --juejin-font-brand4-disable: #abcdff; + --juejin-font-success: #2bb91b; + --juejin-font-warning: #ff8412; + --juejin-font-danger: #ff5132; + --juejin-font-white-disable: #fff; + --juejin-font-white: #fff; + --juejin-success-1-normal: #00b453; + --juejin-success-2-deep: #00964e; + --juejin-success-3-light: #e2faed; + --juejin-warning-1-normal: #ff7426; + --juejin-warning-2-deep: #e05e00; + --juejin-warning-3-light: #fff3e5; + --juejin-danger-1-normal: #f64242; + --juejin-danger-2-deep: #cb2634; + --juejin-danger-3-light: #fff2ff; + --juejin-sub-1-purple: #9f54ff; + --juejin-sub-2-blue: #57a0ff; + --juejin-sub-3-cyan: #5ad7ff; + --juejin-sub-4-green: #33d790; + --juejin-sub-5-yellow: #ffcc15; + --juejin-sub-6-orange: #ff834e; + --juejin-sub-7-red: #ff5e54; + --juejin-coupon_1_button: #f64242; + --juejin-coupon_1_button_disable: #faa0a0; + --juejin-coupon_2_card: rgba(255,245,244,0.7); + --juejin-coupon_3_stroke: rgba(246,66,66,0.2); + --juejin-navigation: #fff; + --juejin-shade-1: rgba(0,0,0,0.4); + --juejin-shade-2: rgba(0,0,0,0.6); + --juejin-popup: #fff; + --juejin-popover: rgba(0,0,0,0.8); + --juejin-sheets: #f7f8fa; + --juejin-coupon-button: #f64242; + --juejin-coupon-button-disable: #faa0a0; + --juejin-coupon-card: rgba(255,245,244,0.7); + --juejin-layer-loading-start: #e4e6eb; + --juejin-layer-loading-end: rgba(228,230,235,0.5); + --juejin-font-priv-hint: #916be1; + --juejin-background-jscore-radar: #232323 +} + +html.dark{ + --juejin-layer-golden-1: rgba(209,171,97,0.23); + --juejin-layer-golden-2: rgba(237,211,167,0.4); + --juejin-component-hover: hsla(0,0%,100%,0.2); + --juejin-gradientgold_normal_start: #fde8c3; + --juejin-gradientgold_normal_end: #edd3a7; + --juejin-gradientgold_hover_start: #f1dfc0; + --juejin-gradientgold_hover_end: #e6c99b; + --juejin-gradientgold_click_start: #e9d5b3; + --juejin-gradientgold_click_end: #dac29a; + --juejin-layer_loading_start: hsla(0,0%,100%,0); + --juejin-layer_loading_end: hsla(0,0%,100%,0.2); + --juejin-layer_golden_2: rgba(209,171,97,0.12); + --juejin-font_golden_4: #7e5d25; + --juejin-font-golden-1: #edd3a7; + --juejin-font-golden-2: #bea985; + --juejin-font-golden-3: #8e7f64; + --juejin-gray-0: #000; + --juejin-gray-1-1: hsla(0,0%,100%,0.2); + --juejin-gray-1-2: hsla(0,0%,100%,0.1); + --juejin-gray-1-3: #464646; + --juejin-gray-2: hsla(0,0%,100%,0.12); + --juejin-gray-3: hsla(0,0%,100%,0.08); + --juejin-background: #000; + --juejin-layer-1: #181818; + --juejin-layer-2-1: hsla(0,0%,100%,0.08); + --juejin-layer-2-2: hsla(0,0%,100%,0.08); + --juejin-layer-3-fill: hsla(0,0%,100%,0.08); + --juejin-layer-3-border: hsla(0,0%,100%,0.2); + --juejin-layer-4-dropdown: #2f2f2f; + --juejin-layer-5: hsla(0,0%,100%,0.12); + --juejin-brand-1-normal: #2986ff; + --juejin-brand-2-hover: #1473ed; + --juejin-brand-3-click: #0563dd; + --juejin-brand-4-disable: rgba(41,134,255,0.4); + --juejin-brand-5-light: rgba(30,128,255,0.2); + --juejin-mask-1: hsla(0,0%,100%,0.4); + --juejin-mask-2: #282828; + --juejin-mask-3: rgba(0,0,0,0.05); + --juejin-brand-fill1-normal: rgba(41,134,255,0.15); + --juejin-brand-fill2-hover: rgba(20,115,237,0.25); + --juejin-brand-fill3-click: rgba(5,99,221,0.35); + --juejin-brand-stroke1-normal: rgba(41,134,255,0.4); + --juejin-brand-stroke2-hover: rgba(20,115,237,0.6); + --juejin-brand-stroke3-click: rgba(5,99,221,0.6); + --juejin-font_danger: #f85959; + --juejin-font-1: hsla(0,0%,100%,0.9); + --juejin-font-2: hsla(0,0%,100%,0.7); + --juejin-font-3: hsla(0,0%,100%,0.55); + --juejin-font-4: hsla(0,0%,100%,0.45); + --juejin-font-brand1-normal: #4495ff; + --juejin-font-brand2-hover: #2b88ff; + --juejin-font-brand3-click: #1371ec; + --juejin-font-brand4-disable: rgba(19,113,236,0.4); + --juejin-font-success: #40c17b; + --juejin-font-warning: #ff8541; + --juejin-font-danger: #c62633; + --juejin-font-white-disable: hsla(0,0%,100%,0.6); + --juejin-font-white: #fff; + --juejin-success-1-normal: #40c17b; + --juejin-success-2-deep: #008445; + --juejin-success-3-light: rgba(64,193,123,0.2); + --juejin-warning-1-normal: #ff8541; + --juejin-warning-2-deep: #d85c02; + --juejin-warning-3-light: rgba(255,133,65,0.2); + --juejin-danger-1-normal: #f85959; + --juejin-danger-2-deep: #c62633; + --juejin-danger-3-light: rgba(248,89,89,0.2); + --juejin-sub-1-purple: #a965ff; + --juejin-sub-2-blue: #68a9ff; + --juejin-sub-3-cyan: #74f4ed; + --juejin-sub-4-green: #50e68c; + --juejin-sub-5-yellow: #ffd748; + --juejin-sub-6-orange: #ff8f60; + --juejin-sub-7-red: #ff6e65; + --juejin-coupon_1_button: rgba(251,86,83,0.8); + --juejin-coupon_1_button_disable: #782928; + --juejin-coupon_2_card: rgba(255,176,176,0.08); + --juejin-coupon_3_stroke: rgba(246,66,66,0.18); + --juejin-navigation: #181818; + --juejin-shade-1: rgba(0,0,0,0.6); + --juejin-shade-2: rgba(0,0,0,0.7); + --juejin-popup: #282828; + --juejin-popover: #323232; + --juejin-sheets: #222; + --juejin-coupon-button: rgba(251,86,83,0.8); + --juejin-coupon-button-disable: #782928; + --juejin-coupon-card: rgba(255,176,176,0.08); + --juejin-layer-loading-start: #fff; + --juejin-layer-loading-end: hsla(0,0%,100%,0.2); + --juejin-font-priv-hint: #916be1; + --juejin-background-jscore-radar: #232323 +} + .page-enter-active, .page-leave-active { transition: all 0.3s ease-in-out; diff --git a/frontend/components/ArticlesContent/index.vue b/frontend/components/ArticlesContent/index.vue index 8a8eaba..965517f 100644 --- a/frontend/components/ArticlesContent/index.vue +++ b/frontend/components/ArticlesContent/index.vue @@ -54,7 +54,6 @@ function transformToId() { } } } - onMounted(() => { if (article.value) handleChange(article.value.content) diff --git a/frontend/components/Logo.vue b/frontend/components/Logo.vue index d51b5e6..57afd81 100644 --- a/frontend/components/Logo.vue +++ b/frontend/components/Logo.vue @@ -1,5 +1,5 @@ + + diff --git a/frontend/components/Navs/index.vue b/frontend/components/Navs/index.vue index 1f522b1..26196dc 100644 --- a/frontend/components/Navs/index.vue +++ b/frontend/components/Navs/index.vue @@ -1,172 +1,67 @@ diff --git a/frontend/components/Types/index.vue b/frontend/components/Types/index.vue index 13803e5..5d347a0 100644 --- a/frontend/components/Types/index.vue +++ b/frontend/components/Types/index.vue @@ -7,7 +7,7 @@ const { data: TypeList } = await useFetch('/api/global/types')
diff --git a/frontend/server/api/articles/[id].ts b/frontend/server/api/articles/[id].ts index 912b182..b5e1dfd 100644 --- a/frontend/server/api/articles/[id].ts +++ b/frontend/server/api/articles/[id].ts @@ -39,6 +39,7 @@ export default defineEventHandler(async (event): Promise => { data{ attributes{ type + alias } } } diff --git a/frontend/server/api/global/navs.ts b/frontend/server/api/global/navs.ts index ffd9050..5d12093 100644 --- a/frontend/server/api/global/navs.ts +++ b/frontend/server/api/global/navs.ts @@ -1,9 +1,5 @@ import { useGraphql } from '~~/utils/useGraphql' -interface INavItem { - name: string - url: string - badge?: string -} +import type { INavItem } from '~~/types/INav' export default defineEventHandler(async (): Promise => { const reqQuery = `query{ global{ diff --git a/frontend/types/IArticle.ts b/frontend/types/IArticle.ts index 14365b1..7878653 100644 --- a/frontend/types/IArticle.ts +++ b/frontend/types/IArticle.ts @@ -14,6 +14,7 @@ interface ITagItem { interface IType { type: string + alias: string } interface IColumnArticleItem { diff --git a/frontend/types/INav.ts b/frontend/types/INav.ts new file mode 100644 index 0000000..cf254e3 --- /dev/null +++ b/frontend/types/INav.ts @@ -0,0 +1,5 @@ +export interface INavItem { + nav: string + url: string + badge?: string +} diff --git a/frontend/unocss.config.ts b/frontend/unocss.config.ts index 4c87af6..0a97a45 100644 --- a/frontend/unocss.config.ts +++ b/frontend/unocss.config.ts @@ -10,8 +10,6 @@ import { } from 'unocss' export default defineConfig({ shortcuts: [ - ['btn', 'px-4 py-1 rounded inline-block bg-teal-600 text-white cursor-pointer hover:bg-teal-700 disabled:cursor-default disabled:bg-gray-600 disabled:opacity-50'], - ['icon-btn', 'inline-block cursor-pointer select-none opacity-75 transition duration-200 ease-in-out hover:opacity-100 hover:text-teal-600'], ['f-c-c', 'flex justify-center items-center'], ], presets: [ @@ -48,6 +46,15 @@ export default defineConfig({ jj_font_white: 'var(--jjext-color-font-white)', // #ffffff jj_font_black: 'var(--jjext-color-font-1)', // #252933 jj_bg_gray: 'var(--jjext-color-bg-gray)', // #27272a + jj_navigation: 'var(--juejin-navigation)', + }, + breakpoints: { + xs: '320px', + sm: '640px', + md: '768px', + lg: '1024px', + xl: '1280px', + xxl: '1536px', }, }, })