|
|
@@ -1,11 +1,21 @@
|
|
|
<template>
|
|
|
<div id="app">
|
|
|
- <header class="app-header">
|
|
|
- <h1>FLV 视频播放器</h1>
|
|
|
- </header>
|
|
|
- <main>
|
|
|
- <VideoPlayer />
|
|
|
+ <!-- 添加全局导航栏 -->
|
|
|
+ <nav class="global-nav">
|
|
|
+ <div class="nav-container">
|
|
|
+ FLV 视频播放器
|
|
|
+ <div class="nav-links">
|
|
|
+ <router-link to="/" exact class="nav-link">首页</router-link>
|
|
|
+ <router-link to="/player" class="nav-link">播放器</router-link>
|
|
|
+ <router-link to="/about" class="nav-link">关于我们</router-link>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </nav>
|
|
|
+
|
|
|
+ <main class="main-content">
|
|
|
+ <router-view />
|
|
|
</main>
|
|
|
+
|
|
|
<footer class="app-footer">
|
|
|
<p>基于 Vue.js 和 flv.js 构建的 Material Design 风格视频播放器</p>
|
|
|
</footer>
|
|
|
@@ -13,13 +23,8 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import VideoPlayer from './components/VideoPlayer.vue'
|
|
|
-
|
|
|
export default {
|
|
|
- name: 'App',
|
|
|
- components: {
|
|
|
- VideoPlayer
|
|
|
- }
|
|
|
+ name: 'App'
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
@@ -36,55 +41,95 @@ body {
|
|
|
-webkit-font-smoothing: antialiased;
|
|
|
-moz-osx-font-smoothing: grayscale;
|
|
|
text-align: center;
|
|
|
+}
|
|
|
+
|
|
|
+/* 全局导航栏样式 */
|
|
|
+.global-nav {
|
|
|
+ background-color: #1976d2;
|
|
|
+ color: white;
|
|
|
+ padding: 0;
|
|
|
+ position: sticky;
|
|
|
+ top: 0;
|
|
|
+ z-index: 1000;
|
|
|
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
|
+}
|
|
|
+
|
|
|
+.nav-container {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
max-width: 1200px;
|
|
|
margin: 0 auto;
|
|
|
- padding: 20px;
|
|
|
+ padding: 0 20px;
|
|
|
+ height: 60px;
|
|
|
}
|
|
|
|
|
|
-.app-header {
|
|
|
- margin-bottom: 20px;
|
|
|
+.nav-logo {
|
|
|
+ font-size: 20px;
|
|
|
+ font-weight: bold;
|
|
|
+ color: white;
|
|
|
+ text-decoration: none;
|
|
|
}
|
|
|
|
|
|
-.logo {
|
|
|
- height: 80px;
|
|
|
- margin-bottom: 10px;
|
|
|
+.nav-links {
|
|
|
+ display: flex;
|
|
|
}
|
|
|
|
|
|
-h1 {
|
|
|
- font-size: 32px;
|
|
|
- font-weight: 600;
|
|
|
- margin: 10px 0;
|
|
|
- color: #1d1d1f;
|
|
|
+.nav-link {
|
|
|
+ color: white;
|
|
|
+ text-decoration: none;
|
|
|
+ margin-left: 20px;
|
|
|
+ padding: 5px 10px;
|
|
|
+ border-radius: 4px;
|
|
|
+ transition: background-color 0.3s;
|
|
|
}
|
|
|
|
|
|
-.tips-container {
|
|
|
- margin-bottom: 20px;
|
|
|
- padding: 12px 16px;
|
|
|
- background-color: #e3f2fd;
|
|
|
- border-radius: 8px;
|
|
|
- text-align: left;
|
|
|
+.nav-link:hover {
|
|
|
+ background-color: rgba(255, 255, 255, 0.1);
|
|
|
}
|
|
|
|
|
|
-.tip-item {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
+/* 修改选中样式,使用 router-link-exact-active 替代或配合 router-link-active */
|
|
|
+.router-link-exact-active {
|
|
|
+ background-color: rgba(255, 255, 255, 0.2);
|
|
|
+ font-weight: 500;
|
|
|
}
|
|
|
|
|
|
-.tip-icon {
|
|
|
- margin-right: 10px;
|
|
|
- font-style: normal;
|
|
|
+/* 可以保留原来的样式,但调整权重较低 */
|
|
|
+.router-link-active:not(.router-link-exact-active) {
|
|
|
+ color: rgba(255, 255, 255, 0.9);
|
|
|
}
|
|
|
|
|
|
-main {
|
|
|
- background-color: white;
|
|
|
- border-radius: 8px;
|
|
|
- padding: 30px;
|
|
|
- box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
|
|
|
+/* 主内容区域 */
|
|
|
+.main-content {
|
|
|
+ max-width: 1200px;
|
|
|
+ margin: 20px auto;
|
|
|
+ padding: 0 20px;
|
|
|
}
|
|
|
|
|
|
.app-footer {
|
|
|
margin-top: 30px;
|
|
|
+ padding: 20px;
|
|
|
font-size: 14px;
|
|
|
color: #86868b;
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
+
|
|
|
+/* 响应式设计 */
|
|
|
+@media (max-width: 768px) {
|
|
|
+ .nav-container {
|
|
|
+ flex-direction: column;
|
|
|
+ height: auto;
|
|
|
+ padding: 10px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .nav-links {
|
|
|
+ margin-top: 10px;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ justify-content: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ .nav-link {
|
|
|
+ margin: 5px;
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|