|
@@ -0,0 +1,134 @@
|
|
|
+<template>
|
|
|
+ <nav
|
|
|
+ :class="[
|
|
|
+ scrollValue > 200 ? 'nav-scrolled' : 'nav-not-scrolled',
|
|
|
+ ]"
|
|
|
+ >
|
|
|
+ <div class="group">
|
|
|
+ <RouterLink to="/">首页</RouterLink>
|
|
|
+ <RouterLink to="/news">资讯动态</RouterLink>
|
|
|
+ <RouterLink to="/introduction">文化概况</RouterLink>
|
|
|
+ <RouterLink to="/inheritor">保护传承</RouterLink>
|
|
|
+ </div>
|
|
|
+ <div class="group">
|
|
|
+ <div class="headerlogos">
|
|
|
+ <img src="@/assets/images/LogoIcon.png" />
|
|
|
+ <div>
|
|
|
+ <p class="large">闽南文化生态保护区<span>(厦门市)</span></p>
|
|
|
+ <p>Minnan Cultural Ecological Protection Area</p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="group">
|
|
|
+ <RouterLink to="/communicate">传播交流</RouterLink>
|
|
|
+ <RouterLink to="/research">理论研究</RouterLink>
|
|
|
+ <RouterLink to="/fusion">文旅融合</RouterLink>
|
|
|
+ <RouterLink to="/about">关于我们</RouterLink>
|
|
|
+ </div>
|
|
|
+ </nav>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup lang="ts">
|
|
|
+import { onBeforeUnmount, onMounted, ref } from 'vue';
|
|
|
+
|
|
|
+const scrollValue = ref(0);
|
|
|
+
|
|
|
+function onScroll() {
|
|
|
+ scrollValue.value = window.scrollY;
|
|
|
+}
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ window.addEventListener('scroll', onScroll);
|
|
|
+});
|
|
|
+onBeforeUnmount(() => {
|
|
|
+ window.removeEventListener('scroll', onScroll);
|
|
|
+});
|
|
|
+
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss">
|
|
|
+@use '@/assets/scss/colors.scss' as *;
|
|
|
+
|
|
|
+nav {
|
|
|
+ $nav-height: 65px;
|
|
|
+
|
|
|
+ position: fixed;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-around;
|
|
|
+ align-items: center;
|
|
|
+ z-index: 100;
|
|
|
+ width: 100%;
|
|
|
+ height: $nav-height;
|
|
|
+ background-color: transparent;
|
|
|
+ border-bottom: 1px solid rgba(#fff, 0.2);
|
|
|
+ color: #fff;
|
|
|
+ transition: all ease-in-out 0.3s;
|
|
|
+
|
|
|
+ &.nav-scrolled {
|
|
|
+ background-color: $primary-color;
|
|
|
+ }
|
|
|
+
|
|
|
+ .group {
|
|
|
+ display: flex;
|
|
|
+ gap: 1rem;
|
|
|
+
|
|
|
+ a {
|
|
|
+ color: rgba(#fff, 0.8);
|
|
|
+ width: 100px;
|
|
|
+ height: $nav-height;
|
|
|
+ line-height: $nav-height;
|
|
|
+ text-align: center;
|
|
|
+ text-decoration: none;
|
|
|
+
|
|
|
+ &:focus {
|
|
|
+ outline: none;
|
|
|
+ }
|
|
|
+ &.router-link-active, &.router-link-exact-active, &:hover {
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
+ &.router-link-exact-active {
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ .headerlogos {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
+ img {
|
|
|
+ width: 45px;
|
|
|
+ height: 45px;
|
|
|
+ margin-right: 10px;
|
|
|
+ }
|
|
|
+ > div {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: center;
|
|
|
+ font-family: nzgrRuyinZouZhangKai;
|
|
|
+ margin-bottom: 6px;
|
|
|
+
|
|
|
+ p {
|
|
|
+ margin: 0;
|
|
|
+ font-size: 1rem;
|
|
|
+ height: 20px;
|
|
|
+
|
|
|
+ span {
|
|
|
+ font-size: 1rem;
|
|
|
+ margin-left: 10px;
|
|
|
+ }
|
|
|
+ &.large {
|
|
|
+ height: 33px;
|
|
|
+ font-size: 1.8rem;
|
|
|
+ letter-spacing: -0.1rem;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+@media (min-width: 1024px) {
|
|
|
+
|
|
|
+}
|
|
|
+</style>
|