Commit 01f9081a authored by liubinyu's avatar liubinyu

亮色

parent 5ea9dc39
<script setup> <script setup>
import { reactive, ref } from 'vue' import { reactive, ref, computed } from 'vue'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
const router = useRouter() const router = useRouter()
...@@ -27,16 +27,19 @@ function navClick(nav) { ...@@ -27,16 +27,19 @@ function navClick(nav) {
} }
navClick(navList.find(i => i.route === router.currentRoute.value.name)) navClick(navList.find(i => i.route === router.currentRoute.value.name))
const isLight = computed(() => locale.value !== 'En')
// function login() { // function login() {
// router.push({ name: 'Login' }) // router.push({ name: 'Login' })
// } // }
</script> </script>
<template> <template>
<div class="gc-header"> <div class="gc-header" :class="{ light: isLight }">
<img class="logo" src="/img/logo.png" alt=""> <img v-if="isLight" class="logo" src="/img/logo-color.png" alt="">
<img v-else class="logo" src="/img/logo.png" alt="">
<div class="nav-list"> <div class="nav-list">
<div v-for="nav in navList" class="btn" :class="{ active: active === nav.route }" @click="navClick(nav, 1)"> <div v-for="nav in navList" class="btn g-flex-center" :class="{ active: active === nav.route }" @click="navClick(nav, 1)">
{{ $t(nav.name) }} {{ $t(nav.name) }}
<Transition> <Transition>
<div v-show="active === nav.route" class="line"></div> <div v-show="active === nav.route" class="line"></div>
...@@ -64,15 +67,16 @@ navClick(navList.find(i => i.route === router.currentRoute.value.name)) ...@@ -64,15 +67,16 @@ navClick(navList.find(i => i.route === router.currentRoute.value.name))
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
background: linear-gradient(180deg, rgba(14, 0, 85, 0.71) 0%, rgba(4, 0, 106, 0) 100%);
} }
.gc-header .logo { .gc-header .logo {
/* width: 12vw; */ height: 60px;
width: 228px;
flex-shrink: 0; flex-shrink: 0;
} }
.gc-header .nav-list { .gc-header .nav-list {
height: 100%;
flex: 1; flex: 1;
margin: 0 5vw; margin: 0 5vw;
display: flex; display: flex;
...@@ -80,7 +84,8 @@ navClick(navList.find(i => i.route === router.currentRoute.value.name)) ...@@ -80,7 +84,8 @@ navClick(navList.find(i => i.route === router.currentRoute.value.name))
} }
.nav-list .btn { .nav-list .btn {
padding: 16px 2px; min-width: 50px;
height: 100%;
margin-right: 5vw; margin-right: 5vw;
font-family: Roboto-Regular; font-family: Roboto-Regular;
font-weight: 400; font-weight: 400;
...@@ -95,6 +100,7 @@ navClick(navList.find(i => i.route === router.currentRoute.value.name)) ...@@ -95,6 +100,7 @@ navClick(navList.find(i => i.route === router.currentRoute.value.name))
.nav-list .btn.active { .nav-list .btn.active {
font-family: Roboto-Bold; font-family: Roboto-Bold;
font-weight: bold;
color: var(--theme-color); color: var(--theme-color);
} }
...@@ -150,4 +156,28 @@ navClick(navList.find(i => i.route === router.currentRoute.value.name)) ...@@ -150,4 +156,28 @@ navClick(navList.find(i => i.route === router.currentRoute.value.name))
border-color: var(--theme-color); border-color: var(--theme-color);
color: var(--theme-color); color: var(--theme-color);
} }
.gc-header.light {
background: #FFFFFF;
}
.gc-header.light .nav-list .btn {
color: #666;
}
.gc-header.light .nav-list .btn:hover {
color: #000000;
}
.gc-header.light .nav-list .btn.active {
color: #000000;
}
.gc-header.light .nav-list .btn .line {
background-color: #503A9E;
}
.gc-header.light .right .icon-lang {
filter: contrast(0.1);
}
</style> </style>
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
color: #FFFFFF; color: #FFFFFF;
background-color: #0F0C29; background-color: #0F0C29;
--theme-color: #FF8800; --theme-color: #FF8800;
--layout-header-height: 100px; --layout-header-height: 80px;
} }
* { * {
......
...@@ -21,7 +21,6 @@ import GHeader from '@/components/GHeader.vue' ...@@ -21,7 +21,6 @@ import GHeader from '@/components/GHeader.vue'
right: 0; right: 0;
margin: 0 auto; margin: 0 auto;
height: var(--layout-header-height); height: var(--layout-header-height);
background: linear-gradient(180deg, rgba(14, 0, 85, 0.71) 0%, rgba(4, 0, 106, 0) 100%);
z-index: 2; z-index: 2;
} }
</style> </style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment