From 4c188826ac7988e17f10ad244e7150ba877843f1 Mon Sep 17 00:00:00 2001 From: Megghy Date: Tue, 1 Apr 2025 03:10:19 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=94=A8=E6=88=B7=E9=A1=B5?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F,=20=E6=B7=BB=E5=8A=A0=E8=BF=87=E6=B8=A1?= =?UTF-8?q?=E5=8A=A8=E7=94=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 3 - src/views/ViewerLayout.vue | 806 +++++++++++------- src/views/view/QuestionBoxView.vue | 111 ++- src/views/view/SongListView.vue | 79 +- src/views/view/UserIndexView.vue | 12 +- src/views/view/VideoCollectView.vue | 44 +- .../TraditionalSongListTemplate.vue | 6 +- 7 files changed, 676 insertions(+), 385 deletions(-) diff --git a/src/App.vue b/src/App.vue index 52d4304..d5c25f5 100644 --- a/src/App.vue +++ b/src/App.vue @@ -50,12 +50,9 @@ const layout = computed(() => { watchEffect(() => { if (isDarkMode.value) { document.documentElement.classList.add('dark'); - console.log('Added dark class to HTML'); // For debugging } else { document.documentElement.classList.remove('dark'); - console.log('Removed dark class from HTML'); // For debugging } - // If you dynamically apply Naive UI theme to body or provider, do it here too }); const themeOverrides = { diff --git a/src/views/ViewerLayout.vue b/src/views/ViewerLayout.vue index cdc0191..acff05f 100644 --- a/src/views/ViewerLayout.vue +++ b/src/views/ViewerLayout.vue @@ -1,230 +1,272 @@ - + +// --- 布局样式 --- +.center-container { + height: 100vh; + display: flex; + align-items: center; + justify-content: center; +} + +.layout-header { + height: var(--vtsuru-header-height); + padding: 0 15px; // 左右内边距 + display: flex; + align-items: center; + border-bottom: 1px solid var(--n-border-color); // 底部边框 + flex-shrink: 0; // 防止头部被压缩 +} + +.site-title { + font-size: 1.5rem; + text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); +} + +.main-layout-body { + height: calc(100vh - var(--vtsuru-header-height)); // 填充剩余高度 +} + +.sider-avatar { + box-shadow: var(--n-avatar-box-shadow, 0 2px 3px rgba(0, 0, 0, 0.1)); // 使用 Naive UI 变量或默认值 + cursor: pointer; + transition: transform 0.2s ease; // 添加悬浮效果 + &:hover { + transform: scale(1.1); + } +} + +.sider-username { + max-width: 90%; + margin: 8px auto 0; + font-size: 14px; // 调整字体大小 +} + +.sider-loading { + display: flex; + justify-content: center; + align-items: center; // 垂直居中 + padding: 30px 0; // 增加上下间距 + height: 98px; // 大致等于头像+昵称的高度,防止跳动 +} + +.sider-menu { + margin-top: 10px; + width: 100%; // 确保菜单宽度正确 +} + +.sider-footer { + position: absolute; + bottom: 20px; + width: 100%; + text-align: center; + padding: 0 5px; // 左右留白,防止文字贴边 + box-sizing: border-box; +} + +.footer-text { + font-size: 12px; +} + +// --- 内容区域样式 --- +.content-layout-container { + height: 100%; + min-height: 100%; // 保证最小高度,防止塌陷 + overflow: hidden; // 关键: 隐藏此容器自身的滚动条,剪切内部溢出内容 + position: relative; // 关键: 作为内部绝对定位元素(过渡中的组件)的定位基准 +} + +.loading-container { + // ... (保持不变) ... + display: flex; + justify-content: center; + align-items: center; + height: 100%; + width: 100%; + background-color: var(--n-body-color); + position: absolute; // 相对于 content-layout-container 定位 + top: 0; + left: 0; + z-index: 5; +} + +.viewer-page-content { + height: 100%; + min-height: 100%; // 同样保证最小高度 + border-radius: 8px; + padding: var(--vtsuru-content-padding); + box-sizing: border-box; + overflow-y: auto; // 允许内容 Y 轴滚动 + overflow-x: hidden; // 禁止内容 X 轴滚动 (可选,但通常推荐) + position: relative; // 为内部非绝对定位的内容提供上下文,例如 NBackTop + background-color: var(--n-card-color); + box-shadow: var(--content-shadow); +} + +// --- 路由过渡动画 --- +.fade-slide-enter-active, +.fade-slide-leave-active { + transition: opacity 0.25s ease, transform 0.25s ease; + // 关键: 相对于 content-layout-container 定位 + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; // 让过渡元素也撑满容器高度 + // 关键: 保持内边距和盒模型一致 + padding: var(--vtsuru-content-padding); + box-sizing: border-box; + // 关键: 背景色防止透视 + background-color: var(--n-card-color); // 使用内容区的背景色 + z-index: 1; +} + +.fade-slide-enter-from { + opacity: 0; + transform: translateX(15px); +} + +.fade-slide-leave-to { + opacity: 0; + transform: translateX(-15px); +} + +// --- 返回顶部按钮 --- +.n-back-top { + z-index: 10; // 确保在最上层 +} + \ No newline at end of file diff --git a/src/views/view/QuestionBoxView.vue b/src/views/view/QuestionBoxView.vue index f5253d5..8409688 100644 --- a/src/views/view/QuestionBoxView.vue +++ b/src/views/view/QuestionBoxView.vue @@ -30,7 +30,6 @@ import { computed, onMounted, onUnmounted, ref } from 'vue' import VueTurnstile from 'vue-turnstile' const { biliInfo, userInfo } = defineProps<{ - // eslint-disable-next-line @typescript-eslint/no-explicit-any biliInfo: any | undefined userInfo: UserInfo | undefined }>() @@ -172,40 +171,50 @@ onUnmounted(() => {