Refine console ux detail (#233)

This commit is contained in:
Germey authored and GitHub committed 2025-07-27 02:08:41 +08:00
1 parent 9019629c42
commit ffea198d14
15 files changed
+315 -393

No files matched your search

+7 -35
View File
@@ -4,45 +4,17 @@
<script lang="ts">
import { getCookie } from 'typescript-cookie';
import { isOfficial } from '@/utils';
import { defineComponent } from 'vue';
export default {
export default defineComponent({
emits: ['click'],
data() {
return {
url1: 'https://cdn.acedata.cloud/logo.png/thumb_450x_',
url2: 'https://cdn.acedata.cloud/logo2.png/thumb_450x_',
dark: getCookie('THEME') === 'dark',
url: '',
isOfficial: isOfficial(),
interval: undefined as number | undefined
};
},
watch: {
computed: {
dark() {
this.updateUrl();
}
},
mounted() {
this.interval = window.setInterval(this.checkCookie, 500);
this.updateUrl();
},
unmounted() {
if (this.interval) {
clearInterval(this.interval);
}
},
methods: {
checkCookie() {
this.dark = getCookie('THEME') === 'dark';
return getCookie('THEME') === 'dark';
},
updateUrl() {
if (this.isOfficial) {
this.url = this.dark ? this.url2 : this.url1;
} else {
this.url = this.$store.state.site?.logo || '';
}
url() {
return this.$store.state.site?.favicon;
}
}
};
});
</script>
-20
View File
@@ -1,20 +0,0 @@
<template>
<img :src="url" class="logo tiny" @click="$emit('click')" />
</template>
<script lang="ts">
import { getCookie } from 'typescript-cookie';
import { defineComponent } from 'vue';
export default defineComponent({
emits: ['click'],
computed: {
dark() {
return getCookie('THEME') === 'dark';
},
url() {
return this.$store.state.site?.favicon;
}
}
});
</script>
+15 -47
View File
@@ -1,8 +1,8 @@
<template>
<div :direction="direction" class="navigator">
<div class="top">
<div v-if="direction === 'column'">
<logo-tiny @click="onHome" />
<div class="w-full flex justify-center">
<logo v-if="direction === 'column'" @click.stop="onHome" />
</div>
<div
v-for="(link, linkIndex) in links"
@@ -44,14 +44,14 @@ import {
ROUTE_KLING_HISTORY
} from '@/router/constants';
import { CHAT_MODEL_ICON_CHATGPT, CHAT_MODEL_ICON_DEEPSEEK, CHAT_MODEL_ICON_GROK } from '@/constants/chat';
import LogoTiny from './LogoTiny.vue';
import Logo from './Logo.vue';
import UserCenter from '@/components/user/Center.vue';
export default defineComponent({
name: 'Navigator',
components: {
ElImage,
LogoTiny,
Logo,
ElTooltip,
UserCenter
},
@@ -267,53 +267,21 @@ export default defineComponent({
}
&[direction='column'] {
flex-direction: column;
.el-menu {
width: 150px;
border-right: none;
background: none;
.el-menu-item {
height: 50px;
color: var(--el-text-color-primary);
&.active,
&:hover,
&:focus {
background-color: var(--el-button-hover-bg-color);
color: var(--el-color-primary);
}
}
}
.chevron {
position: absolute;
right: -12px;
top: 50%;
transform: translateY(-50%) scale(0.8);
z-index: 10;
}
.logo {
width: 80%;
max-height: 50px;
cursor: pointer;
margin: 10px auto 20px auto;
display: block;
&.tiny {
margin: 0 auto 10px auto;
width: 40px;
height: 40px;
}
}
.top,
.bottom {
.top {
flex: 1;
display: flex;
flex-direction: column;
padding-top: 10px;
min-width: 60px;
width: 60px;
gap: 15px;
.logo {
width: 40px;
height: 40px;
cursor: pointer;
}
.link {
width: 100%;
height: 40px;
margin-bottom: 10px;
.avatar {
display: block;
margin: auto;
@@ -325,9 +293,9 @@ export default defineComponent({
}
}
}
.bottom {
position: absolute;
bottom: 0;
height: 50px;
display: flex;
flex-direction: column;
width: 100%;