mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
23 lines
530 B
TypeScript
23 lines
530 B
TypeScript
import { addComponentListener } from '@/core/settings'
|
|
|
|
export enum NavbarNotifyStyle {
|
|
Number = '数字',
|
|
Hidden = '隐藏',
|
|
Dot = '点状',
|
|
}
|
|
|
|
export const setupNotifyStyle = () => {
|
|
const map = {
|
|
[NavbarNotifyStyle.Number]: 'number',
|
|
[NavbarNotifyStyle.Hidden]: 'hidden',
|
|
[NavbarNotifyStyle.Dot]: 'dot',
|
|
}
|
|
addComponentListener(
|
|
'customNavbar.notifyStyle',
|
|
(value: NavbarNotifyStyle) => {
|
|
document.documentElement.setAttribute('data-navbar-notify-style', map[value])
|
|
},
|
|
true,
|
|
)
|
|
}
|