diff options
| author | syuilo <4439005+syuilo@users.noreply.github.com> | 2025-05-07 10:44:43 +0900 |
|---|---|---|
| committer | syuilo <4439005+syuilo@users.noreply.github.com> | 2025-05-07 10:44:43 +0900 |
| commit | 181f68e14ea8170c6879ee918c25450945e8d1f1 (patch) | |
| tree | 2f57da0e4697132159ee3f48d50002a95db3cdde /packages/frontend/src/components | |
| parent | 🎨 (diff) | |
| download | misskey-181f68e14ea8170c6879ee918c25450945e8d1f1.tar.gz misskey-181f68e14ea8170c6879ee918c25450945e8d1f1.tar.bz2 misskey-181f68e14ea8170c6879ee918c25450945e8d1f1.zip | |
🎨
Diffstat (limited to 'packages/frontend/src/components')
| -rw-r--r-- | packages/frontend/src/components/MkDialog.vue | 33 | ||||
| -rw-r--r-- | packages/frontend/src/components/global/MkResult.vue | 6 | ||||
| -rw-r--r-- | packages/frontend/src/components/global/MkSystemIcon.vue | 65 |
3 files changed, 58 insertions, 46 deletions
diff --git a/packages/frontend/src/components/MkDialog.vue b/packages/frontend/src/components/MkDialog.vue index 81d508c161..3f7519a43f 100644 --- a/packages/frontend/src/components/MkDialog.vue +++ b/packages/frontend/src/components/MkDialog.vue @@ -11,18 +11,13 @@ SPDX-License-Identifier: AGPL-3.0-only </div> <div v-else-if="!input && !select" - :class="[$style.icon, { - [$style.type_success]: type === 'success', - [$style.type_error]: type === 'error', - [$style.type_warning]: type === 'warning', - [$style.type_info]: type === 'info', - }]" + :class="[$style.icon]" > - <i v-if="type === 'success'" :class="$style.iconInner" class="ti ti-check"></i> - <i v-else-if="type === 'error'" :class="$style.iconInner" class="ti ti-circle-x"></i> - <i v-else-if="type === 'warning'" :class="$style.iconInner" class="ti ti-alert-triangle"></i> - <i v-else-if="type === 'info'" :class="$style.iconInner" class="ti ti-info-circle"></i> - <i v-else-if="type === 'question'" :class="$style.iconInner" class="ti ti-help-circle"></i> + <MkSystemIcon v-if="type === 'success'" :class="$style.iconInner" style="width: 45px;" type="success"/> + <MkSystemIcon v-else-if="type === 'error'" :class="$style.iconInner" style="width: 45px;" type="error"/> + <MkSystemIcon v-else-if="type === 'warning'" :class="$style.iconInner" style="width: 45px;" type="warn"/> + <MkSystemIcon v-else-if="type === 'info'" :class="$style.iconInner" style="width: 45px;" type="info"/> + <MkSystemIcon v-else-if="type === 'question'" :class="$style.iconInner" style="width: 45px;" type="question"/> <MkLoading v-else-if="type === 'waiting'" :class="$style.iconInner" :em="true"/> </div> <header v-if="title" :class="$style.title" class="_selectable"><Mfm :text="title"/></header> @@ -202,22 +197,6 @@ function onInputKeydown(evt: KeyboardEvent) { margin: 0 auto; } -.type_info { - color: #55c4dd; -} - -.type_success { - color: var(--MI_THEME-success); -} - -.type_error { - color: var(--MI_THEME-error); -} - -.type_warning { - color: var(--MI_THEME-warn); -} - .title { margin: 0 0 8px 0; font-weight: bold; diff --git a/packages/frontend/src/components/global/MkResult.vue b/packages/frontend/src/components/global/MkResult.vue index bddc89809b..fdfc7091e8 100644 --- a/packages/frontend/src/components/global/MkResult.vue +++ b/packages/frontend/src/components/global/MkResult.vue @@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only <template> <Transition :name="prefer.s.animation ? '_transition_zoom' : ''" appear> - <div :class="[$style.root, { [$style.warn]: type === 'notFound', [$style.error]: type === 'error' }]" class="_gaps_m"> + <div :class="[$style.root, { [$style.warn]: type === 'notFound', [$style.error]: type === 'error' }]" class="_gaps"> <img v-if="type === 'empty' && instance.infoImageUrl" :src="instance.infoImageUrl" draggable="false" :class="$style.img"/> <MkSystemIcon v-else-if="type === 'empty'" type="info" :class="$style.icon"/> <img v-if="type === 'notFound' && instance.notFoundImageUrl" :src="instance.notFoundImageUrl" draggable="false" :class="$style.img"/> @@ -46,8 +46,8 @@ const props = defineProps<{ } .icon { - width: 50px; - height: 50px; + width: 65px; + height: 65px; margin: 0 auto; } </style> diff --git a/packages/frontend/src/components/global/MkSystemIcon.vue b/packages/frontend/src/components/global/MkSystemIcon.vue index 20ce524e6d..3285d5a940 100644 --- a/packages/frontend/src/components/global/MkSystemIcon.vue +++ b/packages/frontend/src/components/global/MkSystemIcon.vue @@ -4,20 +4,29 @@ SPDX-License-Identifier: AGPL-3.0-only --> <template> -<svg v-if="type === 'info'" :class="[$style.icon, $style.info]" viewBox="0 0 128 128"> - <path d="M64,92L64,56" style="--l:40;" :class="[$style.line, $style.anim]"/> - <circle cx="64" cy="36" r="4" :class="[$style.fill]"/> - <circle cx="64" cy="64" r="56" style="--l:400;" :class="[$style.line, $style.anim]"/> +<svg v-if="type === 'info'" :class="[$style.icon, $style.info]" viewBox="0 0 160 160"> + <path d="M80,108L80,72" style="--l:37;" :class="[$style.line, $style.anim]"/> + <path d="M80,52L80,52" :class="[$style.line, $style.fade]"/> + <circle cx="80" cy="80" r="56" style="--l:350;" :class="[$style.line, $style.anim]"/> </svg> -<svg v-else-if="type === 'question'" :class="[$style.icon, $style.question]" viewBox="0 0 128 128"> - <path d="M63.991,76L64,68C73.333,68 80,60.333 80,52C80,43.667 73.336,36 64,36C54.664,36 47.983,43.664 47.983,52" style="--l:85;" :class="[$style.line, $style.anim]"/> - <circle cx="64" cy="92" r="4" :class="[$style.fill]"/> - <circle cx="64" cy="64" r="56" style="--l:400;" :class="[$style.line, $style.anim]"/> +<svg v-else-if="type === 'question'" :class="[$style.icon, $style.question]" viewBox="0 0 160 160"> + <path d="M80,92L79.991,84C88.799,83.98 96,76.962 96,68C96,59.038 88.953,52 79.991,52C71.03,52 64,59.038 64,68" style="--l:85;" :class="[$style.line, $style.anim]"/> + <path d="M80,108L80,108" :class="[$style.line, $style.fade]"/> + <circle cx="80" cy="80" r="56" style="--l:350;" :class="[$style.line, $style.anim]"/> </svg> -<svg v-else-if="type === 'error'" :class="[$style.icon, $style.error]" viewBox="0 0 128 128"> - <path d="M47.029,47.029L80.971,80.971" style="--l:55;--duration:0.3s;" :class="[$style.line, $style.anim]"/> - <path d="M80.971,47.029L47.029,80.971" style="--l:55;--duration:0.3s;--delay:0.2s;" :class="[$style.line, $style.anim]"/> - <circle cx="64" cy="64" r="56" style="--l:400;" :class="[$style.line, $style.anim]"/> +<svg v-else-if="type === 'success'" :class="[$style.icon, $style.success]" viewBox="0 0 160 160"> + <path d="M62,80L74,92L98,68" style="--l:50;" :class="[$style.line, $style.anim]"/> + <circle cx="80" cy="80" r="56" style="--l:350;" :class="[$style.line, $style.anim]"/> +</svg> +<svg v-else-if="type === 'warn'" :class="[$style.icon, $style.warn]" viewBox="0 0 160 160"> + <path d="M80,64L80,88" style="--l:27;" :class="[$style.line, $style.anim]"/> + <path d="M80,108L80,108" :class="[$style.line, $style.fade]"/> + <path d="M92,28L144,116C148.709,124.65 144.083,135.82 136,136L24,136C15.917,135.82 11.291,124.65 16,116L68,28C73.498,19.945 86.771,19.945 92,28Z" style="--l:390;" :class="[$style.line, $style.anim]"/> +</svg> +<svg v-else-if="type === 'error'" :class="[$style.icon, $style.error]" viewBox="0 0 160 160"> + <path d="M63,63L96,96" style="--l:47;--duration:0.3s;" :class="[$style.line, $style.anim]"/> + <path d="M96,63L63,96" style="--l:47;--duration:0.3s;--delay:0.2s;" :class="[$style.line, $style.anim]"/> + <circle cx="80" cy="80" r="56" style="--l:350;" :class="[$style.line, $style.anim]"/> </svg> </template> @@ -25,18 +34,25 @@ SPDX-License-Identifier: AGPL-3.0-only import {} from 'vue'; const props = defineProps<{ - type: 'info' | 'question' | 'warn' | 'error'; + type: 'info' | 'question' | 'success' | 'warn' | 'error'; }>(); </script> <style lang="scss" module> .icon { - color: var(--MI_THEME-accent); stroke-linecap: round; stroke-linejoin: round; + &.info { + color: var(--MI_THEME-accent); + } + &.question { - color: var(--MI_THEME-warn); + color: var(--MI_THEME-fg); + } + + &.success { + color: var(--MI_THEME-success); } &.warn { @@ -61,16 +77,33 @@ const props = defineProps<{ .anim { stroke-dasharray: var(--l); stroke-dashoffset: var(--l); - animation: line-animation var(--duration, 0.5s) ease-out 1 forwards; + animation: line-animation var(--duration, 0.5s) cubic-bezier(0,0,.25,1) 1 forwards; + animation-delay: var(--delay, 0s); +} + +.fade { + opacity: 0; + animation: fade-in var(--duration, 0.5s) cubic-bezier(0,0,.25,1) 1 forwards; animation-delay: var(--delay, 0s); } @keyframes line-animation { 0% { stroke-dashoffset: var(--l); + opacity: 0; } 100% { stroke-dashoffset: 0; + opacity: 1; + } +} + +@keyframes fade-in { + 0% { + opacity: 0; + } + 100% { + opacity: 1; } } </style> |