Update index and nav bar style (#126)

Co-authored-by: AceDataCloud <office@acedata.cloud>
This commit is contained in:
GermeyandAceDataCloud authored and GitHub committed 2024-08-21 10:45:10 +08:00
1 parent d8632ff699
commit c74d9e5a37
5 files changed
+87 -46

No files matched your search

+35 -7
View File
@@ -4,17 +4,45 @@
<script lang="ts">
import { getCookie } from 'typescript-cookie';
import { defineComponent } from 'vue';
import { BASE_URL_HUB } from '@/constants';
export default defineComponent({
export default {
emits: ['click'],
computed: {
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: window.location.origin === BASE_URL_HUB,
interval: undefined as number | undefined
};
},
watch: {
dark() {
return getCookie('THEME') === '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';
},
url() {
return this.$store.state.site?.logo;
updateUrl() {
if (this.isOfficial) {
this.url = this.dark ? this.url2 : this.url1;
} else {
this.url = this.$store.state.site?.logo || '';
}
}
}
});
};
</script>
+4 -2
View File
@@ -4,7 +4,7 @@
<logo @click="onHome" />
</el-col>
<el-col :md="16" :xs="13">
<el-menu :default-active="active" mode="horizontal" :ellipsis="false" @select="onSelect">
<el-menu :default-active="active" mode="horizontal" class="menu" :ellipsis="true" @select="onSelect">
<el-sub-menu :index="1">
<template #title>{{ $t('common.nav.products') }}</template>
<el-menu-item v-if="site?.features?.chat?.enabled" v-t="'index.title.chat'" index="/chat"></el-menu-item>
@@ -156,12 +156,14 @@ $height: 60px;
float: right;
}
.el-menu {
.el-menu.menu {
--el-menu-hover-bg-color: var(--el-bg-color);
--el-menu-active-color: var(--el-color-primary);
background: none;
border: none;
height: $height;
min-width: 300px;
overflow-x: hidden;
.el-menu-item {
height: $height;
color: inherit !important;