mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-27 07:16:19 +09:00
feat(web): redesign settings page (#26)
* perf: change model ui * feat: edit provider * feat: layout update * fix: scroll bug * feat: model and provider * feat: Setting * perf: chat page
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
<script setup lang="ts">
|
||||
import type { HTMLAttributes } from 'vue'
|
||||
import { computed, onMounted, ref } from 'vue'
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
words: string;
|
||||
filter?: boolean;
|
||||
duration?: number;
|
||||
delay?: number;
|
||||
class?: HTMLAttributes['class'];
|
||||
}>(),
|
||||
{ duration: 0.7, delay: 0, filter: true },
|
||||
)
|
||||
|
||||
const scope = ref(null)
|
||||
const wordsArray = computed(() => props.words.split(''))
|
||||
|
||||
const spanStyle = computed(() => ({
|
||||
opacity: 0,
|
||||
filter: props.filter ? 'blur(10px)' : 'none',
|
||||
transition: `opacity ${props.duration}s, filter ${props.duration}s`,
|
||||
}))
|
||||
|
||||
onMounted(() => {
|
||||
if (scope.value) {
|
||||
const spans = (scope.value as HTMLElement).querySelectorAll('span')
|
||||
|
||||
setTimeout(() => {
|
||||
spans.forEach((span: HTMLElement, index: number) => {
|
||||
setTimeout(() => {
|
||||
span.style.opacity = '1'
|
||||
span.style.filter = props.filter ? 'blur(0px)' : 'none'
|
||||
}, index * 200)
|
||||
})
|
||||
}, props.delay)
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div
|
||||
class="leading-snug tracking-wide"
|
||||
:class="[props.class]"
|
||||
>
|
||||
<div ref="scope">
|
||||
<span
|
||||
v-for="(word, idx) in wordsArray"
|
||||
:key="word + idx"
|
||||
class="inline-block"
|
||||
:style="spanStyle"
|
||||
>
|
||||
{{ word }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1 @@
|
||||
export { default as TextGenerateEffect } from "./TextGenerateEffect.vue";
|
||||
@@ -35,6 +35,7 @@ export * from './components/switch/index'
|
||||
export * from './components/table/index'
|
||||
export * from './components/tabs/index'
|
||||
export * from './components/tags-input/index'
|
||||
export * from './components/text-generate-effect/index'
|
||||
export * from './components/textarea/index'
|
||||
export * from './components/toggle/index'
|
||||
export * from './components/tooltip/index'
|
||||
Reference in New Issue
Block a user