mirror of
https://github.com/Megghy/vtsuru.live.git
synced 2025-12-06 18:36:55 +08:00
feat: 优化弹幕窗口样式系统并添加 Cookie 状态监控
- 将 naive-ui 版本约束从固定版本改为 ^ 范围约束 - 重构弹幕窗口背景渲染:分离窗口背景和弹幕背景,支持独立配置 - 新增颜色解析工具函数 parseColorToRgba,支持 hex/rgba 格式及透明度提取 - 优化 CSS 变量系统:添加 --dw-bg-color-rgb、--dw-bg-alpha、--dw-window-bg-color 变量 - 改进弹幕窗口布局:使用独立背景层支持 backdrop-filter 和圆角边框 - 在
This commit is contained in:
82
src/client/components/CookieInvalidAlert.vue
Normal file
82
src/client/components/CookieInvalidAlert.vue
Normal file
@@ -0,0 +1,82 @@
|
||||
<script setup lang="ts">
|
||||
import { useRouter } from 'vue-router'
|
||||
import { NAlert, NButton } from 'naive-ui'
|
||||
|
||||
import { useBiliCookie } from '../store/useBiliCookie'
|
||||
|
||||
const biliCookie = useBiliCookie()
|
||||
const router = useRouter()
|
||||
|
||||
const props = withDefaults(defineProps<{
|
||||
variant?: 'home' | 'fetcher'
|
||||
}>(), {
|
||||
variant: 'home',
|
||||
})
|
||||
|
||||
const goToFetcher = () => {
|
||||
router.push({ name: 'client-fetcher' })
|
||||
}
|
||||
|
||||
const goToSettings = () => {
|
||||
router.push({ name: 'client-settings' })
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NAlert
|
||||
v-if="biliCookie.hasBiliCookie && !biliCookie.isCookieValid"
|
||||
class="cookie-invalid-alert"
|
||||
type="error"
|
||||
:title="props.variant === 'home' ? '需重新登录 B 站账号' : 'EventFetcher 需要有效的 B 站 Cookie'"
|
||||
:show-icon="true"
|
||||
:bordered="false"
|
||||
>
|
||||
<div class="cookie-invalid-alert__content">
|
||||
<p>
|
||||
{{ props.variant === 'home'
|
||||
? '检测到 B 站 Cookie 已失效,客户端功能将受限。'
|
||||
: '请尽快同步或重新登录 Cookie,以保证事件采集稳定运行。'
|
||||
}}
|
||||
</p>
|
||||
<p>
|
||||
如果已经部署 CookieCloud,请尝试重新同步;否则请重新扫码登录。
|
||||
</p>
|
||||
<div class="cookie-invalid-alert__actions">
|
||||
<NButton
|
||||
size="small"
|
||||
type="primary"
|
||||
@click="goToFetcher"
|
||||
>
|
||||
前往 EventFetcher
|
||||
</NButton>
|
||||
<NButton
|
||||
size="small"
|
||||
tertiary
|
||||
@click="goToSettings"
|
||||
>
|
||||
Cookie 设置
|
||||
</NButton>
|
||||
</div>
|
||||
</div>
|
||||
</NAlert>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.cookie-invalid-alert {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.cookie-invalid-alert__content {
|
||||
font-size: 13px;
|
||||
line-height: 1.6;
|
||||
color: rgb(51 54 57 / 90%);
|
||||
}
|
||||
|
||||
.cookie-invalid-alert__actions {
|
||||
margin-top: 8px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user