1
0
forked from Leaf/amber-ui

移除测试文件

增加 fav
This commit is contained in:
ivamp 2024-09-14 01:00:49 +08:00
parent 6bfef7890b
commit 1053f6479c
7 changed files with 5 additions and 246 deletions

View File

@ -3,9 +3,13 @@
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta content="width=device-width, initial-scale=1.0" name="viewport" /> <meta content="width=device-width, initial-scale=1.0" name="viewport" />
<meta name="msapplication-TileImage" content="/assets/images/leaflow.png" />
<link rel="icon" href="/src/assets/images/leaflow.png" />
<link rel="apple-touch-icon" href="/src/assets/images/leaflow.png" />
<title>Amberlet 琥珀</title> <title>Amberlet 琥珀</title>
<style> <style>
/* 检测当前主题 */
@media (prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {
body { body {
background-color: #000; background-color: #000;

1
src/components.d.ts vendored
View File

@ -8,7 +8,6 @@ export {}
declare module 'vue' { declare module 'vue' {
export interface GlobalComponents { export interface GlobalComponents {
AssistantMenu: typeof import('./components/AssistantMenu.vue')['default'] AssistantMenu: typeof import('./components/AssistantMenu.vue')['default']
Assistants: typeof import('./components/assistants/index.vue')['default']
AssistantSettings: typeof import('./components/AssistantSettings.vue')['default'] AssistantSettings: typeof import('./components/AssistantSettings.vue')['default']
Chat: typeof import('./components/chat/Chat.vue')['default'] Chat: typeof import('./components/chat/Chat.vue')['default']
ChatMenu: typeof import('./components/ChatMenu.vue')['default'] ChatMenu: typeof import('./components/ChatMenu.vue')['default']

View File

@ -1,70 +0,0 @@
<template>
<div>
<p ref="textRef">
<span v-for="(part, index) in textParts" :key="index" :style="{ animationDelay: `${index * 0.1}s` }">{{ part }}</span>
</p>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, onUnmounted } from 'vue';
//
const generateText = (length: number) => {
const characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
let text = '';
for (let i = 0; i < length; i++) {
text += characters[Math.floor(Math.random() * characters.length)];
}
return text;
};
const textLength = 10; //
const text = ref('');
const textParts = ref<string[]>([]);
// 10
const updateTextParts = () => {
textParts.value = text.value.match(/.{1,10}/g) || [];
};
//
const updateInterval = 500; // 5
let intervalId: any;
onMounted(() => {
intervalId = setInterval(() => {
text.value += generateText(textLength);
updateTextParts();
}, updateInterval);
});
onUnmounted(() => {
clearInterval(intervalId);
});
//
onMounted(() => {
updateTextParts();
});
</script>
<style lang="css" scoped>
p {
position: relative;
overflow: hidden;
}
span {
display: inline-block;
transform: translateY(100%);
transition: transform 0.5s ease-in-out;
animation: fadeIn 0.5s ease-in-out forwards;
}
@keyframes fadeIn {
to {
transform: translateY(0);
}
}
</style>

View File

@ -1,60 +0,0 @@
<template>
<div>
<p ref="textRef">
<span v-for="(part, index) in textParts" :key="index" :style="{ opacity: `${1 - index * 0.1}` }">{{ part }}</span>
</p>
</div>
</template>
<script setup lang="ts">
import { ref, computed, onMounted, onUnmounted, watch } from 'vue';
interface Props {
text: string;
}
const props = withDefaults(defineProps<Props>(), {
text: ''
});
const textLength = 10; //
const textParts = ref<string[]>([]);
// 10
const updateTextParts = () => {
textParts.value = props.text.match(/.{1,10}/g) || [];
};
// text textParts
watch(computed(() => props.text), (newText) => {
updateTextParts();
});
onMounted(() => {
updateTextParts();
});
onUnmounted(() => {
//
});
</script>
<style lang="css" scoped>
p {
position: relative;
overflow: hidden;
white-space: nowrap; /* 保持文本在同一行 */
}
span {
display: inline-block;
opacity: 0;
transition: opacity 0.5s ease-in-out;
animation: fadeIn 0.5s ease-in-out forwards;
}
@keyframes fadeIn {
to {
opacity: 1;
}
}
</style>

View File

@ -1,100 +0,0 @@
<template>
<div>
<p ref="textRef">
<span
v-for="(part, index) in textParts"
:key="index"
:style="{ opacity: `${1 - index * 0.1}` }"
>{{ part }}</span
>
</p>
<!-- 包裹 v-md-editor div -->
<div class="editor-container">
<v-md-preview
:text="text"
@input="handleInput"
height="500px"
></v-md-preview>
</div>
</div>
</template>
<script setup lang="ts">
import { ref, computed, onMounted, onUnmounted, watch } from "vue";
import VMdPreview from "@kangc/v-md-editor/lib/preview";
import "@kangc/v-md-editor/lib/style/preview.css";
import githubTheme from "@kangc/v-md-editor/lib/theme/github.js";
import "@kangc/v-md-editor/lib/theme/style/github.css";
// highlightjs
import hljs from "highlight.js";
VMdPreview.use(githubTheme, {
Hljs: hljs,
});
const text = ref("text");
const textLength = 10; //
const textParts = ref<string[]>([]);
// 10
const updateTextParts = () => {
textParts.value = text.value.match(/.{1,10}/g) || [];
};
// text textParts
watch(
() => text.value,
(newText) => {
updateTextParts();
}
);
onMounted(() => {
updateTextParts();
// text.value
// setInterval(() => {
// const randomString = Math.random().toString(36).substring(2, 2 + textLength);
// text.value += randomString;
// }, 1000);
});
onUnmounted(() => {
//
});
//
const handleInput = (value: string) => {
text.value = value;
};
</script>
<style lang="css" scoped>
p {
position: relative;
overflow: hidden;
white-space: nowrap; /* 保持文本在同一行 */
}
span {
display: inline-block;
opacity: 0;
transition: opacity 0.5s ease-in-out;
animation: fadeIn 0.5s ease-in-out forwards;
}
.editor-container {
opacity: 0;
transition: opacity 0.5s ease-in-out;
animation: fadeIn 0.5s ease-in-out forwards;
}
@keyframes fadeIn {
to {
opacity: 1;
}
}
</style>

View File

@ -1,10 +0,0 @@
<script setup lang="ts">
import Test3 from './test3.vue';
const text = ref("some text");
</script>
<template>
<Test3 :text="text"></Test3>
</template>01

View File

@ -26,9 +26,5 @@ declare module 'vue-router/auto-routes' {
'/chat/[id]/': RouteRecordInfo<'/chat/[id]/', '/chat/:id', { id: ParamValue<true> }, { id: ParamValue<false> }>, '/chat/[id]/': RouteRecordInfo<'/chat/[id]/', '/chat/:id', { id: ParamValue<true> }, { id: ParamValue<false> }>,
'/chat/[id]/index copy': RouteRecordInfo<'/chat/[id]/index copy', '/chat/:id/index copy', { id: ParamValue<true> }, { id: ParamValue<false> }>, '/chat/[id]/index copy': RouteRecordInfo<'/chat/[id]/index copy', '/chat/:id/index copy', { id: ParamValue<true> }, { id: ParamValue<false> }>,
'/guest/': RouteRecordInfo<'/guest/', '/guest', Record<never, never>, Record<never, never>>, '/guest/': RouteRecordInfo<'/guest/', '/guest', Record<never, never>, Record<never, never>>,
'/test': RouteRecordInfo<'/test', '/test', Record<never, never>, Record<never, never>>,
'/test2': RouteRecordInfo<'/test2', '/test2', Record<never, never>, Record<never, never>>,
'/test3': RouteRecordInfo<'/test3', '/test3', Record<never, never>, Record<never, never>>,
'/test4': RouteRecordInfo<'/test4', '/test4', Record<never, never>, Record<never, never>>,
} }
} }