pref: rebuild top bar

This commit is contained in:
KUN1007 2023-10-21 16:34:16 +08:00
parent c24f8410ed
commit 2aedb618d3
3 changed files with 92 additions and 88 deletions

View file

@ -59,28 +59,31 @@ onBeforeRouteLeave(() => {
</KeepAlive> </KeepAlive>
</transition> </transition>
</div> </div>
<div class="kungalgame">
<!-- 网站的名字和网站图标 --> <!-- 网站的名字和网站图标 -->
<div class="kungalgame">
<RouterLink to="/kun"> <RouterLink to="/kun">
<img src="@/assets/images/favicon.webp" alt="KUNgal" /> <img
</RouterLink> src="@/assets/images/favicon.webp"
<RouterLink to="/kun"> alt="KUN Visual Novel 鲲 Galgame"
/>
<span>{{ $tm('header.name') }}</span> <span>{{ $tm('header.name') }}</span>
</RouterLink> </RouterLink>
</div> </div>
<!-- 导航栏 -->
<div class="top-bar"> <div class="top-bar">
<ul>
<!-- 顶部单个板块 --> <!-- 顶部单个板块 -->
<li v-for="kun in topBarItem" :key="kun.index"> <span v-for="kun in topBarItem" :key="kun.index">
<RouterLink :to="{ path: kun.router }"> <RouterLink :to="{ path: kun.router }">
{{ $tm(`header['${kun.name}']`) }} {{ $tm(`header['${kun.name}']`) }}
</RouterLink> </RouterLink>
</li> </span>
<!-- 顶部板块下部的 hover 效果 --> <!-- 顶部板块下部的 hover 效果 -->
<div class="box"></div> <div class="box"></div>
</ul>
</div> </div>
</div> </div>
<div class="kungalgamer-info"> <div class="kungalgamer-info">
<!-- showKUNGalgamePanel store 里的布尔值,其真假控制设置面板的显示与关闭 --> <!-- showKUNGalgamePanel store 里的布尔值,其真假控制设置面板的显示与关闭 -->
<span @click="showKUNGalgamePanel = !showKUNGalgamePanel"> <span @click="showKUNGalgamePanel = !showKUNGalgamePanel">
@ -122,13 +125,10 @@ onBeforeRouteLeave(() => {
<style lang="scss" scoped> <style lang="scss" scoped>
/* 头部样式 */ /* 头部样式 */
.header { .header {
/* 头部高度 */
height: 58px; height: 58px;
/* 头部下方阴影 */
box-shadow: 0 2px 4px 0 var(--kungalgame-trans-blue-1); box-shadow: 0 2px 4px 0 var(--kungalgame-trans-blue-1);
/* 头部背景 */
backdrop-filter: blur(5px);
background-color: var(--kungalgame-trans-white-5); background-color: var(--kungalgame-trans-white-5);
backdrop-filter: blur(5px);
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
@ -151,22 +151,7 @@ onBeforeRouteLeave(() => {
.nav-top { .nav-top {
display: flex; display: flex;
align-items: center; align-items: center;
} height: 100%;
.kungalgame {
display: flex;
align-items: center;
img {
height: 50px;
margin-left: 50px;
cursor: pointer;
}
span {
margin-left: 20px;
margin-right: 7px;
color: var(--kungalgame-font-color-3);
font-weight: bold;
cursor: pointer;
}
} }
// //
@ -176,10 +161,8 @@ $navNumber: v-bind(navItemNum);
position: relative; position: relative;
text-align: center; text-align: center;
width: v-bind(navItemLength); width: v-bind(navItemLength);
ul {
align-items: center; align-items: center;
display: flex; display: flex;
right: 5%;
.box { .box {
border-radius: 2px; border-radius: 2px;
bottom: 0; bottom: 0;
@ -193,14 +176,15 @@ $navNumber: v-bind(navItemNum);
z-index: -1; z-index: -1;
} }
} }
a { a {
// a
display: block; display: block;
color: var(--kungalgame-blue-5); color: var(--kungalgame-blue-5);
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
li {
span {
cursor: pointer; cursor: pointer;
display: block; display: block;
font-weight: bold; font-weight: bold;
@ -232,6 +216,23 @@ $navNumber: v-bind(navItemNum);
left: calc(100% / $navNumber * 4); left: calc(100% / $navNumber * 4);
} }
} }
}
.kungalgame {
display: flex;
align-items: center;
margin-left: 50px;
a {
display: flex;
align-items: center;
color: var(--kungalgame-font-color-3);
img {
width: 50px;
height: 50px;
margin-right: 30px;
}
} }
} }

View file

@ -59,6 +59,8 @@ const user = computed(() => props.user)
flex-grow: 1; flex-grow: 1;
} }
img { img {
height: 50px;
width: 50px;
padding: 2px; padding: 2px;
border-radius: 50%; border-radius: 50%;
/* 页面缩小时头像缩小 */ /* 页面缩小时头像缩小 */

View file

@ -49,11 +49,12 @@ const user = computed(() => props.user)
} }
/* 头像 */ /* 头像 */
.avatar { .avatar {
/* 图像加载不出来时页面不塌陷 */
width: 100px; width: 100px;
margin-top: 17px; margin-top: 17px;
img { img {
width: 100px; width: 100px;
height: 100px;
} }
} }
/* 名字 */ /* 名字 */