From 47951152d1a3da4d49d074d948630fc0486f6909 Mon Sep 17 00:00:00 2001 From: radishzzz Date: Mon, 17 Feb 2025 16:06:00 +0000 Subject: [PATCH] refactor: optimize website performance and layout - Replace ScrollButton with BackToTop component - Improve theme toggle and scrollbar event handling - Update layout and index page styling - Optimize client:load and client:idle directives - Remove deprecated Heti addon plugin --- pnpm-lock.yaml | 16 +- src/components/BackToTop.astro | 77 ++++++ src/components/PhotoSwipe.astro | 2 + src/components/ScrollButton.astro | 91 ------- src/components/Scrollbar.astro | 1 - src/components/ThemeToggle.astro | 81 +++--- src/config.ts | 2 +- src/layouts/Head.astro | 8 +- src/layouts/Layout.astro | 14 +- src/pages/[lang]/index.astro | 2 +- src/pages/index.astro | 16 +- src/plugins/heti-addon.js | 412 ------------------------------ src/styles/heti.css | 1 - 13 files changed, 164 insertions(+), 559 deletions(-) create mode 100644 src/components/BackToTop.astro delete mode 100644 src/components/ScrollButton.astro delete mode 100644 src/plugins/heti-addon.js diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8732744..d9c91cc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1175,8 +1175,8 @@ packages: resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} engines: {node: '>=12'} - ansis@3.14.0: - resolution: {integrity: sha512-R1LnSpYZWMDEFoAyCrfgToVz4ES25luDpjlZsUlD5GXdPWb91U+TZGkxWAOvt+7zWRY/ctOxhtTx5HUtL3qmbA==} + ansis@3.15.0: + resolution: {integrity: sha512-zIcWDJ+Kwqxfdnogx66Gxzr0kVmCcRAdat9nlY2IHsshqTN4fBH6tMeRMPA/2w0rpBayIJvjQAaa2/4RDrNqwg==} engines: {node: '>=14'} anymatch@3.1.3: @@ -1289,8 +1289,8 @@ packages: resolution: {integrity: sha512-8WB3Jcas3swSvjIeA2yvCJ+Miyz5l1ZmB6HFb9R1317dt9LCQoswg/BGrmAmkWVEszSrrg4RwmO46qIm2OEnSA==} engines: {node: '>=16'} - caniuse-lite@1.0.30001699: - resolution: {integrity: sha512-b+uH5BakXZ9Do9iK+CkDmctUSEqZl+SP056vc5usa0PL+ev5OHw003rZXcnjNDv3L8P5j6rwT6C0BPKSikW08w==} + caniuse-lite@1.0.30001700: + resolution: {integrity: sha512-2S6XIXwaE7K7erT8dY+kLQcpa5ms63XlRkMkReXjle+kf6c5g38vyMl+Z5y8dSxOFDhcFe+nxnn261PLxBSQsQ==} ccount@2.0.1: resolution: {integrity: sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==} @@ -3767,7 +3767,7 @@ snapshots: '@typescript-eslint/eslint-plugin': 8.24.0(@typescript-eslint/parser@8.24.0(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3))(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3) '@typescript-eslint/parser': 8.24.0(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3) '@vitest/eslint-plugin': 1.1.31(@typescript-eslint/utils@8.24.0(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3))(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3) - ansis: 3.14.0 + ansis: 3.15.0 eslint: 9.20.1(jiti@2.4.2) eslint-config-flat-gitignore: 2.0.0(eslint@9.20.1(jiti@2.4.2)) eslint-flat-config-utils: 2.0.1 @@ -4919,7 +4919,7 @@ snapshots: ansi-styles@6.2.1: {} - ansis@3.14.0: {} + ansis@3.15.0: {} anymatch@3.1.3: dependencies: @@ -5152,7 +5152,7 @@ snapshots: browserslist@4.24.4: dependencies: - caniuse-lite: 1.0.30001699 + caniuse-lite: 1.0.30001700 electron-to-chromium: 1.5.101 node-releases: 2.0.19 update-browserslist-db: 1.1.2(browserslist@4.24.4) @@ -5172,7 +5172,7 @@ snapshots: camelcase@8.0.0: {} - caniuse-lite@1.0.30001699: {} + caniuse-lite@1.0.30001700: {} ccount@2.0.1: {} diff --git a/src/components/BackToTop.astro b/src/components/BackToTop.astro new file mode 100644 index 0000000..0076fe8 --- /dev/null +++ b/src/components/BackToTop.astro @@ -0,0 +1,77 @@ + +