Files
Code-Create/src/components/main-header.vue

82 lines
1.5 KiB
Vue
Raw Normal View History

2026-05-14 14:23:32 +08:00
<template>
2026-05-14 14:38:12 +08:00
<header class="main-header" v-scroll-progress>
<img class="logo" src="../assets/logo-full.png" alt="code-create" />
<div class="center-nav">
<div class="nav-item" v-for="item in navList" :key="item.path">
<router-link class="nav-item-link" :to="item.path">
{{ item.name }}
</router-link>
</div>
</div>
<div class="right">
<span>English</span>
<span>My Account</span>
</div>
</header>
2026-05-14 14:23:32 +08:00
</template>
<script setup lang="ts">
import { ref, onMounted, onUnmounted } from "vue";
2026-05-14 14:38:12 +08:00
import { useRouter } from "vue-router";
const router = useRouter();
const navList = ref([
{
name: "Home",
path: "/",
},
{
name: "About Us",
path: "/about",
},
{
name: "Our Solutions",
path: "/solutions",
},
{
name: "Communities",
path: "/communities",
},
{
name: "Media",
path: "/media",
},
{
name: "Contact Us",
path: "/contact",
},
]);
2026-05-14 14:23:32 +08:00
</script>
<style lang="less" scoped>
.main-header {
position: fixed;
width: 100%;
2026-05-14 14:39:55 +08:00
height: 85px;
2026-05-14 14:38:12 +08:00
padding: 15px 30px;
2026-05-14 14:39:55 +08:00
box-sizing: border-box;
2026-05-14 14:23:32 +08:00
top: 0;
left: 0;
z-index: 10000;
transition: background-color 0.2s linear;
&.active {
background-color: #0a0a0a;
}
2026-05-14 14:38:12 +08:00
display: flex;
justify-content: space-between;
align-items: center;
> .logo {
height: 100%;
width: auto;
}
> .center-nav {
display: flex;
align-items: center;
justify-content: center;
> .nav-item {
> .nav-item-link {
margin: 0 14px;
color: #fff;
font-size: 16px;
}
}
}
2026-05-14 14:23:32 +08:00
}
</style>