From 47d4958a6a645205d45d82e88adf203c87b4c599 Mon Sep 17 00:00:00 2001 From: zyronon Date: Sat, 22 Mar 2025 03:03:02 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=B0=83=E6=95=B4=E6=96=87=E7=AB=A0?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 + pnpm-lock.yaml | 21 ++ src/assets/css/style.scss | 23 +- src/pages/pc/article/ArticleFooter.vue | 147 ++++----- .../practice-article/TypingArticle.vue | 301 ++++++++++-------- 5 files changed, 279 insertions(+), 215 deletions(-) diff --git a/package.json b/package.json index 7bf4a556..79e5db50 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "i18n:write": "gulp i18nwrite" }, "dependencies": { + "@imengyu/vue3-context-menu": "^1.4.5", "@opentranslate/baidu": "^1.4.2", "@opentranslate/translator": "^1.4.2", "axios": "^1.7.2", @@ -39,6 +40,7 @@ "vue-activity-calendar": "^1.2.2", "vue-i18n": "9", "vue-router": "4", + "vue-toast-notification": "3", "vue-virtual-scroller": "2.0.0-beta.8" }, "devDependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 50d888fa..21bae7a6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,6 +8,9 @@ importers: .: dependencies: + '@imengyu/vue3-context-menu': + specifier: ^1.4.5 + version: 1.4.5 '@opentranslate/baidu': specifier: ^1.4.2 version: 1.4.2 @@ -80,6 +83,9 @@ importers: vue-router: specifier: '4' version: 4.3.2(vue@3.4.27(typescript@5.4.5)) + vue-toast-notification: + specifier: '3' + version: 3.1.3(vue@3.4.27(typescript@5.4.5)) vue-virtual-scroller: specifier: 2.0.0-beta.8 version: 2.0.0-beta.8(vue@3.4.27(typescript@5.4.5)) @@ -506,6 +512,9 @@ packages: peerDependencies: vue: '>=3' + '@imengyu/vue3-context-menu@1.4.5': + resolution: {integrity: sha512-VVsfuCYWWchVAIRQHXOUttSemEunUqZIZ4y/Y8aIWSFb/Z9w1E+RjO0dw3H8Jm+yaCbLW4/Mn9pRy3rnry71Hw==} + '@intlify/core-base@9.13.1': resolution: {integrity: sha512-+bcQRkJO9pcX8d0gel9ZNfrzU22sZFSA0WVhfXrf5jdJOS24a+Bp8pozuS9sBI9Hk/tGz83pgKfmqcn/Ci7/8w==} engines: {node: '>= 16'} @@ -3367,6 +3376,12 @@ packages: vue-template-compiler@2.7.16: resolution: {integrity: sha512-AYbUWAJHLGGQM7+cNTELw+KsOG9nl2CnSv467WobS5Cv9uk3wFcnr1Etsz2sEIHEZvw1U+o9mRlEO6QbZvUPGQ==} + vue-toast-notification@3.1.3: + resolution: {integrity: sha512-XNyWqwLIGBFfX5G9sK+clq3N3IPlhDjzNdbZaXkEElcotPlWs0wWZailk1vqhdtLYT/93Y4FHAVuzyatLmPZRA==} + engines: {node: '>=12.15.0'} + peerDependencies: + vue: ^3.0 + vue-tsc@2.0.19: resolution: {integrity: sha512-JWay5Zt2/871iodGF72cELIbcAoPyhJxq56mPPh+M2K7IwI688FMrFKc/+DvB05wDWEuCPexQJ6L10zSwzzapg==} hasBin: true @@ -3840,6 +3855,8 @@ snapshots: '@iconify/types': 2.0.0 vue: 3.4.27(typescript@5.4.5) + '@imengyu/vue3-context-menu@1.4.5': {} + '@intlify/core-base@9.13.1': dependencies: '@intlify/message-compiler': 9.13.1 @@ -7114,6 +7131,10 @@ snapshots: de-indent: 1.0.2 he: 1.2.0 + vue-toast-notification@3.1.3(vue@3.4.27(typescript@5.4.5)): + dependencies: + vue: 3.4.27(typescript@5.4.5) + vue-tsc@2.0.19(typescript@5.4.5): dependencies: '@volar/typescript': 2.2.5 diff --git a/src/assets/css/style.scss b/src/assets/css/style.scss index e85243c0..53855def 100644 --- a/src/assets/css/style.scss +++ b/src/assets/css/style.scss @@ -47,11 +47,14 @@ --color-input-icon: #d3d4d7; --color-textarea-bg: white; + --color-article: black; --aside-width: 12rem; - --font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif; - --word-font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace; + --font-family: -apple-system, sans-serif; + --word-font-family: ui-monospace, sans-serif; + --en-article-family: Georgia, sans-serif; + --zh-article-family: "Songti SC", "SimSun", "Noto Serif CJK SC", serif; } html.dark { @@ -89,21 +92,21 @@ html.dark { --practice-wrapper-translateX: -12vw; --toolbar-width: 40vw; --article-width: 60vw; - --panel-width: 380rem; - --toolbar-height: 48rem; + --panel-width: 38rem; + --toolbar-height: 4.8rem; --panel-margin-left: calc(50vw + var(--practice-wrapper-translateX) + var(--toolbar-width) / 2 + 5vw); --article-panel-margin-left: calc(50% + var(--practice-wrapper-translateX) + var(--article-width) / 2 + 48rem); } .footer { .bottom { - padding: 1.5rem 5rem 5rem 5rem !important; + padding: 1.5rem 1rem 1rem 1rem !important; } .stat { - margin-top: 4rem !important; + margin-top: 0.4rem !important; .row { - gap: 5rem !important; + gap: 0.5rem !important; } } } @@ -123,14 +126,14 @@ html.dark { .footer { .bottom { - padding: 1.5rem 5rem 5rem 5rem !important; + padding: 1.5rem 0.5rem 0.5rem 0.5rem !important; } .stat { - margin-top: 4rem !important; + margin-top: 0.4rem !important; .row { - gap: 5rem !important; + gap: 0.5rem !important; } } } diff --git a/src/pages/pc/article/ArticleFooter.vue b/src/pages/pc/article/ArticleFooter.vue index fedbf8b2..8f415eb9 100644 --- a/src/pages/pc/article/ArticleFooter.vue +++ b/src/pages/pc/article/ArticleFooter.vue @@ -54,95 +54,87 @@ onUnmounted(() => {