15 changed files with 198 additions and 42 deletions
@ -1 +1 @@ |
|||||
{"code":200,"msg":"操作成功","data":[60,5]} |
|
||||
|
{"code":200,"msg":"操作成功","data":[60,60]} |
||||
|
|||||
|
After Width: | Height: | Size: 82 KiB |
|
After Width: | Height: | Size: 564 KiB |
|
After Width: | Height: | Size: 632 KiB |
@ -0,0 +1,121 @@ |
|||||
|
<template> |
||||
|
<header class="header-container"> |
||||
|
<img src="../../assets/images/header/header_bg_blur.png" class="header-blur common-size" alt="" /> |
||||
|
<img src="../../assets/images/header/header_bg.png" class="header-bg common-size" alt="" /> |
||||
|
<div class="header-right"> |
||||
|
<div class="flex"> |
||||
|
<p class="current">{{ currentTime }}</p> |
||||
|
<div class="year"> |
||||
|
<div class="date">{{ formatDay(date) }}</div> |
||||
|
<div class="week">{{ whichWeek }}</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="language-items"> |
||||
|
<div class="language-item" :class="{ active: language === 'zh' }" @click="changeLang('zh')">中</div> |
||||
|
<div class="language-item" :class="{ active: language === 'en' }" @click="changeLang('en')">EN</div> |
||||
|
<div class="language-item" :class="{ active: language === 'tw' }" @click="changeLang('tw')">繁</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</header> |
||||
|
</template> |
||||
|
|
||||
|
<script setup lang="ts"> |
||||
|
import { storeToRefs } from 'pinia' |
||||
|
import { useRootStore } from '@/store/root' |
||||
|
import { useTime } from '@/composables/useTime' |
||||
|
import { useDay } from '@/composables/useDay' |
||||
|
import { formatDay } from '@/utils/utils' |
||||
|
|
||||
|
const store = useRootStore() |
||||
|
const { language } = storeToRefs(store) |
||||
|
|
||||
|
const { currentTime } = useTime() |
||||
|
const { date, whichWeek } = useDay() |
||||
|
|
||||
|
function changeLang(lang: Language) { |
||||
|
if (lang === language.value) { |
||||
|
return |
||||
|
} |
||||
|
store.SET_LANGUAGE(lang) |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.header-container { |
||||
|
position: absolute; |
||||
|
top: 0; |
||||
|
right: 0; |
||||
|
left: 0; |
||||
|
height: 150px; |
||||
|
.common-size { |
||||
|
position: absolute; |
||||
|
top: 0; |
||||
|
left: 0; |
||||
|
width: 1920px; |
||||
|
height: 150px; |
||||
|
} |
||||
|
.header-blur { |
||||
|
top: 30px; |
||||
|
z-index: 1; |
||||
|
filter: blur(20px); |
||||
|
} |
||||
|
.header-bg { |
||||
|
z-index: 2; |
||||
|
} |
||||
|
|
||||
|
.header-right { |
||||
|
position: absolute; |
||||
|
top: 25px; |
||||
|
right: 48px; |
||||
|
z-index: 3; |
||||
|
display: inline-flex; |
||||
|
align-items: flex-end; |
||||
|
flex-direction: column; |
||||
|
.flex { |
||||
|
display: flex; |
||||
|
align-items: flex-start; |
||||
|
margin-bottom: 8px; |
||||
|
} |
||||
|
.current { |
||||
|
margin-right: 16px; |
||||
|
font-size: 48px; |
||||
|
font-family: 'font_bold'; |
||||
|
color: rgb(0 0 0 / 90%); |
||||
|
font-weight: 700; |
||||
|
line-height: 56px; |
||||
|
} |
||||
|
.year { |
||||
|
padding-top: 10px; |
||||
|
font-size: 14px; |
||||
|
font-family: 'font_bold'; |
||||
|
color: rgb(0 0 0 / 60%); |
||||
|
font-weight: 700; |
||||
|
} |
||||
|
.date { |
||||
|
line-height: 22px; |
||||
|
padding-bottom: 2px; |
||||
|
} |
||||
|
|
||||
|
.language-items { |
||||
|
display: inline-flex; |
||||
|
justify-content: flex-end; |
||||
|
align-items: center; |
||||
|
height: 36px; |
||||
|
background: #fff; |
||||
|
border-radius: 37px; |
||||
|
} |
||||
|
.language-item { |
||||
|
width: 52px; |
||||
|
height: 36px; |
||||
|
text-align: center; |
||||
|
color: rgb(0 0 0 / 60%); |
||||
|
border-radius: 42px; |
||||
|
line-height: 36px; |
||||
|
&.active { |
||||
|
color: #fff; |
||||
|
background: linear-gradient(180deg, #c4b280 0%, #a89866 100%); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,5 @@ |
|||||
|
<template> |
||||
|
<div></div> |
||||
|
</template> |
||||
|
|
||||
|
<script setup lang="ts"></script> |
||||
Loading…
Reference in new issue