From ade5d806c74d04758fcd646e9eb7457b4a09cd02 Mon Sep 17 00:00:00 2001 From: pany <939630029@qq.com> Date: Thu, 14 Nov 2024 16:29:59 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E9=87=8D=E5=86=99=E7=81=B0?= =?UTF-8?q?=E8=89=B2=E6=A8=A1=E5=BC=8F=E5=92=8C=E8=89=B2=E5=BC=B1=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E6=8C=82=E8=BD=BD=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 7 +++++-- src/hooks/useGreyAndColorWeakness.ts | 20 ++++++++++++++++++++ src/hooks/useTheme.ts | 13 ++++++++++--- src/layouts/index.vue | 23 +++-------------------- src/styles/index.scss | 8 ++++++++ 5 files changed, 46 insertions(+), 25 deletions(-) create mode 100644 src/hooks/useGreyAndColorWeakness.ts diff --git a/src/App.vue b/src/App.vue index 28d27abe..54b68cc6 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,13 +1,16 @@ - - diff --git a/src/styles/index.scss b/src/styles/index.scss index 0204c4a9..c730ffd1 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -22,6 +22,14 @@ html { height: 100%; + // 灰色模式 + &.grey-mode { + filter: grayscale(1); + } + // 色弱模式 + &.color-weakness { + filter: invert(0.8); + } } body {