mirror of
https://github.com/ZHANGTIANYAO1/teamspeak-music-bot.git
synced 2026-10-02 04:52:50 +08:00
feat: add Vue.js WebUI — YesPlayMusic-inspired SPA with all pages and components
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
2a966e914c
commit
694e3c953b
25 files changed
+5388
-1
No files matched your search
@@ -0,0 +1,98 @@
|
||||
<template>
|
||||
<nav class="navbar frosted-glass">
|
||||
<RouterLink to="/" class="logo">TSMusicBot</RouterLink>
|
||||
|
||||
<div class="nav-links">
|
||||
<RouterLink to="/" class="nav-link" active-class="active">发现</RouterLink>
|
||||
<RouterLink to="/search" class="nav-link" active-class="active">搜索</RouterLink>
|
||||
<RouterLink to="/history" class="nav-link" active-class="active">播放历史</RouterLink>
|
||||
</div>
|
||||
|
||||
<div class="nav-right">
|
||||
<div v-if="activeBot" class="bot-status" :class="{ online: activeBot.connected }">
|
||||
{{ activeBot.name }} {{ activeBot.connected ? '在线' : '离线' }}
|
||||
</div>
|
||||
<RouterLink to="/settings" class="settings-btn">
|
||||
<Icon icon="mdi:cog" />
|
||||
</RouterLink>
|
||||
</div>
|
||||
</nav>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue';
|
||||
import { Icon } from '@iconify/vue';
|
||||
import { usePlayerStore } from '../stores/player.js';
|
||||
|
||||
const store = usePlayerStore();
|
||||
const activeBot = computed(() => store.activeBot);
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.navbar {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: var(--navbar-height);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 10vw;
|
||||
z-index: 100;
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
|
||||
@media (max-width: 1336px) {
|
||||
padding: 0 5vw;
|
||||
}
|
||||
}
|
||||
|
||||
.logo {
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
color: var(--color-primary);
|
||||
margin-right: 40px;
|
||||
}
|
||||
|
||||
.nav-links {
|
||||
display: flex;
|
||||
gap: 24px;
|
||||
}
|
||||
|
||||
.nav-link {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
opacity: 0.6;
|
||||
transition: opacity var(--transition-fast);
|
||||
|
||||
&:hover { opacity: 0.8; }
|
||||
&.active { opacity: 1; color: var(--color-primary); }
|
||||
}
|
||||
|
||||
.nav-right {
|
||||
margin-left: auto;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.bot-status {
|
||||
padding: 4px 12px;
|
||||
background: var(--hover-bg);
|
||||
border-radius: var(--radius-sm);
|
||||
font-size: 12px;
|
||||
opacity: 0.6;
|
||||
|
||||
&.online {
|
||||
background: rgba(51, 94, 234, 0.15);
|
||||
color: var(--color-primary);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.settings-btn {
|
||||
font-size: 20px;
|
||||
opacity: 0.6;
|
||||
transition: opacity var(--transition-fast);
|
||||
&:hover { opacity: 1; }
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user