147 lines
2.8 KiB
Vue
147 lines
2.8 KiB
Vue
<template>
|
|
<div class="app-container">
|
|
<nav class="navbar">
|
|
<div class="nav-content">
|
|
<router-link to="/" class="logo">
|
|
<h1>{{ siteTitle }}</h1>
|
|
</router-link>
|
|
<div class="nav-links">
|
|
<router-link to="/" class="nav-link">首页</router-link>
|
|
<router-link to="/json-formatter" class="nav-link">JSON</router-link>
|
|
<router-link to="/comparator" class="nav-link">对比</router-link>
|
|
<router-link to="/encoder-decoder" class="nav-link">编解码</router-link>
|
|
<router-link to="/variable-name" class="nav-link">变量名</router-link>
|
|
<router-link to="/qr-code" class="nav-link">二维码</router-link>
|
|
<router-link to="/timestamp-converter" class="nav-link">时间戳</router-link>
|
|
<router-link to="/color-converter" class="nav-link">颜色</router-link>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
<main class="main-content">
|
|
<router-view />
|
|
</main>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup>
|
|
import { siteConfig } from './config/site.js'
|
|
|
|
const siteTitle = siteConfig.title
|
|
</script>
|
|
|
|
<style scoped>
|
|
.app-container {
|
|
min-height: 100vh;
|
|
display: flex;
|
|
flex-direction: column;
|
|
}
|
|
|
|
.navbar {
|
|
background: #ffffff;
|
|
border-bottom: 1px solid #e5e5e5;
|
|
padding: 0;
|
|
position: sticky;
|
|
top: 0;
|
|
z-index: 100;
|
|
min-height: 40px;
|
|
}
|
|
|
|
.nav-content {
|
|
max-width: 1200px;
|
|
margin: 0 auto;
|
|
padding: 0 1rem;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
min-height: 40px;
|
|
}
|
|
|
|
.logo {
|
|
text-decoration: none;
|
|
color: #1a1a1a;
|
|
padding-left: 0.5rem;
|
|
}
|
|
|
|
.logo h1 {
|
|
font-size: 1.25rem;
|
|
font-weight: 700;
|
|
margin: 0;
|
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
|
letter-spacing: -0.02em;
|
|
}
|
|
|
|
.nav-links {
|
|
display: flex;
|
|
gap: 0;
|
|
align-items: center;
|
|
}
|
|
|
|
.nav-link {
|
|
text-decoration: none;
|
|
color: #666666;
|
|
font-weight: 500;
|
|
font-size: 0.875rem;
|
|
padding: 0.5rem 1rem;
|
|
border: none;
|
|
background: transparent;
|
|
border-bottom: 2px solid transparent;
|
|
margin-bottom: -1px;
|
|
transition: all 0.2s;
|
|
cursor: pointer;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
line-height: 1.5;
|
|
}
|
|
|
|
.nav-link:hover {
|
|
color: #1a1a1a;
|
|
background: #f5f5f5;
|
|
}
|
|
|
|
.nav-link.router-link-active {
|
|
color: #ffffff;
|
|
background: #1a1a1a;
|
|
border-bottom-color: #1a1a1a;
|
|
}
|
|
|
|
.main-content {
|
|
flex: 1;
|
|
width: 100%;
|
|
padding: 1rem;
|
|
}
|
|
|
|
@media (max-width: 768px) {
|
|
.nav-content {
|
|
flex-direction: column;
|
|
gap: 0;
|
|
padding: 0.5rem 0.75rem;
|
|
}
|
|
|
|
.logo {
|
|
padding-left: 0;
|
|
margin-bottom: 0.5rem;
|
|
}
|
|
|
|
.logo h1 {
|
|
font-size: 1.125rem;
|
|
}
|
|
|
|
.nav-links {
|
|
flex-wrap: wrap;
|
|
justify-content: flex-start;
|
|
width: 100%;
|
|
}
|
|
|
|
.nav-link {
|
|
padding: 0.5rem 0.75rem;
|
|
font-size: 0.8125rem;
|
|
}
|
|
|
|
.main-content {
|
|
padding: 1rem;
|
|
}
|
|
}
|
|
</style>
|
|
|