From fe3609451ea6d257a9143b0ac7c60257cdb8541a Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 26 Dec 2021 01:42:50 +0900 Subject: [PATCH] enhance(client): :art: --- packages/client/src/components/form/input.vue | 9 +-- .../client/src/components/form/select.vue | 9 ++- .../client/src/components/form/switch.vue | 72 ++++++++----------- .../client/src/components/form/textarea.vue | 9 +-- packages/client/src/components/signup.vue | 11 +-- .../client/src/directives/adaptive-border.ts | 24 +++++++ packages/client/src/directives/index.ts | 2 + packages/client/src/directives/panel.ts | 2 +- packages/client/src/pages/settings/theme.vue | 2 +- 9 files changed, 74 insertions(+), 66 deletions(-) create mode 100644 packages/client/src/directives/adaptive-border.ts diff --git a/packages/client/src/components/form/input.vue b/packages/client/src/components/form/input.vue index c990b693f1..3533f4f27b 100644 --- a/packages/client/src/components/form/input.vue +++ b/packages/client/src/components/form/input.vue @@ -5,7 +5,7 @@
input { - border-color: var(--accent); + border-color: var(--accent) !important; //box-shadow: 0 0 0 4px var(--focus); } } diff --git a/packages/client/src/components/form/select.vue b/packages/client/src/components/form/select.vue index 9ecff1aa6f..afc53ca9c8 100644 --- a/packages/client/src/components/form/select.vue +++ b/packages/client/src/components/form/select.vue @@ -3,7 +3,9 @@
- - - + + - +

@@ -55,16 +51,7 @@ export default defineComponent({ .ziffeoms { position: relative; display: flex; - cursor: pointer; - transition: all 0.3s; - - &:first-child { - margin-top: 0; - } - - &:last-child { - margin-bottom: 0; - } + transition: all 0.2s; > * { user-select: none; @@ -80,27 +67,30 @@ export default defineComponent({ > .button { position: relative; - display: inline-block; + display: inline-flex; flex-shrink: 0; margin: 0; - width: 36px; - height: 26px; - background: var(--switchBg); + box-sizing: border-box; + width: 23px; + height: 23px; outline: none; - border-radius: 999px; + background: var(--panel); + border: solid 1px var(--panel); + border-radius: 4px; + cursor: pointer; transition: inherit; - > .handle { - position: absolute; - top: 0; - bottom: 0; - left: 5px; - margin: auto 0; - border-radius: 100%; - transition: background-color 0.3s, transform 0.3s; - width: 16px; - height: 16px; - background-color: #fff; + > .check { + margin: auto; + opacity: 0; + color: var(--fgOnAccent); + font-size: 13px; + } + } + + &:hover { + > .button { + border-color: var(--inputBorderHover) !important; } } @@ -108,13 +98,13 @@ export default defineComponent({ margin-left: 16px; margin-top: 2px; display: block; - cursor: pointer; transition: inherit; color: var(--fg); > span { display: block; line-height: 20px; + cursor: pointer; transition: inherit; } @@ -129,12 +119,6 @@ export default defineComponent({ } } - &:hover { - > .button { - background-color: var(--accentedBg); - } - } - &.disabled { opacity: 0.6; cursor: not-allowed; @@ -142,11 +126,11 @@ export default defineComponent({ &.checked { > .button { - background-color: var(--accent); - border-color: var(--accent); + background-color: var(--accent) !important; + border-color: var(--accent) !important; - > .handle { - transform: translateX(10px); + > .check { + opacity: 1; } } } diff --git a/packages/client/src/components/form/textarea.vue b/packages/client/src/components/form/textarea.vue index 98fd0da94b..c9ba9b97a2 100644 --- a/packages/client/src/components/form/textarea.vue +++ b/packages/client/src/components/form/textarea.vue @@ -4,7 +4,7 @@