static-space / src /App.vue
zhouwei
first change
edda47e
<script setup lang="ts">
import { RouterLink, RouterView } from 'vue-router'
</script>
<template>
<div id="app">
<!-- 导航栏 -->
<nav class="floating-nav">
<RouterLink to="/" class="nav-item">首页</RouterLink>
<RouterLink to="/about" class="nav-item">关于</RouterLink>
</nav>
<!-- 路由视图 -->
<RouterView />
</div>
</template>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
line-height: 1.6;
color: #333;
overflow-x: hidden;
}
#app {
position: relative;
min-height: 100vh;
}
.floating-nav {
position: fixed;
top: 30px;
right: 30px;
z-index: 1000;
display: flex;
gap: 1rem;
background: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(10px);
padding: 0.8rem 1.5rem;
border-radius: 50px;
border: 1px solid rgba(255, 255, 255, 0.2);
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}
.nav-item {
color: white;
text-decoration: none;
font-weight: 500;
font-size: 0.9rem;
padding: 0.5rem 1rem;
border-radius: 25px;
transition: all 0.3s ease;
position: relative;
overflow: hidden;
}
.nav-item:hover {
background: rgba(255, 255, 255, 0.2);
transform: translateY(-2px);
}
.nav-item.router-link-exact-active {
background: rgba(255, 255, 255, 0.3);
color: white;
}
.nav-item.router-link-exact-active::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(45deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
z-index: -1;
}
@media (max-width: 768px) {
.floating-nav {
top: 20px;
right: 20px;
left: 20px;
justify-content: center;
}
.nav-item {
font-size: 0.8rem;
padding: 0.4rem 0.8rem;
}
}
/* 滚动条样式 */
::-webkit-scrollbar {
width: 8px;
}
::-webkit-scrollbar-track {
background: rgba(255, 255, 255, 0.1);
}
::-webkit-scrollbar-thumb {
background: rgba(255, 255, 255, 0.3);
border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
background: rgba(255, 255, 255, 0.5);
}
</style>