173 lines
4.7 KiB
Vue
173 lines
4.7 KiB
Vue
<!-- src/App.vue -->
|
||
<template>
|
||
<div id="app">
|
||
<!-- 公共组件:当 hideHeader 为 false 时显示 -->
|
||
<Navbar v-if="!route.meta.hideHeader" />
|
||
<BackToTop v-if="!route.meta.hideHeader" />
|
||
|
||
<!-- 路由出口:根据当前路由渲染对应组件 -->
|
||
<!-- 首页路由渲染 HomePage.vue,详情页路由渲染 Project3Zh.vue 等 -->
|
||
<router-view />
|
||
|
||
<!-- 公共页脚:当 hideHeader 为 false 时显示 -->
|
||
<footer class="footer" v-if="!route.meta.hideHeader">
|
||
<div class="container">
|
||
<div class="footer-content">
|
||
<p>© {{ new Date().getFullYear() }} Company Name. All rights reserved.</p>
|
||
<div class="social-links">
|
||
<!-- 社交图标代码不变 -->
|
||
<a href="#"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z"></path></svg></a>
|
||
<a href="#"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M23 3a10.9 10.9 0 0 1-3.14 1.53 4.48 4.48 0 0 0-7.86 3v1A10.66 10.66 0 0 1 3 4s-4 9 5 13a11.64 11.64 0 0 1-7 2c9 5 20 0 20-11.5a4.5 4.5 0 0 0-.08-.83A7.72 7.72 0 0 0 23 3z"></path></svg></a>
|
||
<a href="#"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="2" width="20" height="20" rx="5" ry="5"></rect><path d="M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z"></path><line x1="17.5" y1="6.5" x2="17.51" y2="6.5"></line></svg></a>
|
||
<a href="#"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z"></path><rect x="2" y="9" width="4" height="12"></rect><circle cx="4" cy="4" r="2"></circle></svg></a>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</footer>
|
||
</div>
|
||
</template>
|
||
|
||
<script setup lang="ts">
|
||
import BackToTop from './components/common/BackToTop.vue'
|
||
import Navbar from './components/common/Navbar.vue'
|
||
import { useLanguageStore } from './store/language'
|
||
import { provide } from 'vue'
|
||
import { useRoute } from 'vue-router';
|
||
|
||
|
||
|
||
// 初始化语言store并提供翻译函数
|
||
const languageStore = useLanguageStore()
|
||
provide('t', (key: string) => languageStore.t(key))
|
||
|
||
// 获取当前路由
|
||
const route = useRoute();
|
||
|
||
|
||
</script>
|
||
|
||
<style scoped>
|
||
#app {
|
||
font-family: 'Avenir', Helvetica, Arial, sans-serif;
|
||
-webkit-font-smoothing: antialiased;
|
||
-moz-osx-font-smoothing: grayscale;
|
||
color: #2c3e50;
|
||
}
|
||
|
||
|
||
@keyframes fadeInUp {
|
||
from {
|
||
opacity: 0;
|
||
transform: translateY(30px);
|
||
}
|
||
to {
|
||
opacity: 1;
|
||
transform: translateY(0);
|
||
}
|
||
}
|
||
|
||
.hero-content h1 {
|
||
font-size: 3.5rem;
|
||
margin-bottom: 1rem;
|
||
background: linear-gradient(90deg, white, var(--primary-light));
|
||
-webkit-background-clip: text;
|
||
background-clip: text;
|
||
color: transparent;
|
||
line-height: 1.1;
|
||
letter-spacing: -1px;
|
||
}
|
||
|
||
.hero-content p {
|
||
font-size: 1.2rem;
|
||
margin-bottom: 2.5rem;
|
||
color: rgba(255, 255, 255, 0.9);
|
||
max-width: 600px;
|
||
margin-left: auto;
|
||
margin-right: auto;
|
||
}
|
||
|
||
.cta-buttons {
|
||
display: flex;
|
||
justify-content: center;
|
||
gap: 1rem;
|
||
}
|
||
|
||
.btn-primary, .btn-secondary {
|
||
padding: 0.8rem 2rem;
|
||
border-radius: 8px;
|
||
text-decoration: none;
|
||
font-weight: 600;
|
||
transition: var(--transition);
|
||
display: inline-block;
|
||
text-transform: uppercase;
|
||
letter-spacing: 0.5px;
|
||
}
|
||
|
||
.btn-primary {
|
||
background-color: var(--primary-color);
|
||
color: white;
|
||
border: none;
|
||
box-shadow: var(--shadow);
|
||
}
|
||
|
||
.btn-primary:hover {
|
||
background-color: var(--primary-dark);
|
||
transform: translateY(-3px);
|
||
box-shadow: var(--shadow-lg);
|
||
}
|
||
|
||
.btn-secondary {
|
||
background-color: transparent;
|
||
color: white;
|
||
border: 2px solid white;
|
||
}
|
||
|
||
.btn-secondary:hover {
|
||
background-color: white;
|
||
color: var(--bg-color);
|
||
transform: translateY(-3px);
|
||
}
|
||
|
||
.footer {
|
||
background-color: #1a1a2e;
|
||
color: white;
|
||
padding: 2rem 0;
|
||
}
|
||
|
||
.footer-content {
|
||
display: flex;
|
||
justify-content: space-between;
|
||
align-items: center;
|
||
}
|
||
|
||
.social-links {
|
||
display: flex;
|
||
gap: 1rem;
|
||
}
|
||
|
||
.social-links a {
|
||
color: white;
|
||
transition: color 0.3s;
|
||
}
|
||
|
||
.social-links a:hover {
|
||
color: #4cc9f0;
|
||
}
|
||
|
||
@media (max-width: 768px) {
|
||
.hero-content h1 {
|
||
font-size: 2.5rem;
|
||
}
|
||
|
||
.hero-content p {
|
||
font-size: 1rem;
|
||
}
|
||
|
||
.footer-content {
|
||
flex-direction: column;
|
||
text-align: center;
|
||
gap: 1rem;
|
||
}
|
||
}
|
||
</style>
|