mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
- 添加控制栏按钮的显示开关配置选项,实现根据设置动态添加/移除按钮 - 优化缩放逻辑,添加SCALE_MAPPING常量并实现循环切换预设缩放比例 - 移除不常用的50%和200%缩放选项,简化预设列表 - 缩短默认Toast显示时间从3秒至1.5秒
36 lines
863 B
TypeScript
36 lines
863 B
TypeScript
import { ScalePreset } from './types'
|
||
|
||
// 缩放比例预设选项数组
|
||
export const SCALE_PRESETS = ['75%', '100%', '110%', '125%', '150%', '自定义'] as const
|
||
|
||
// 缩放比例映射表
|
||
export const SCALE_MAPPING: Record<ScalePreset, number> = {
|
||
'75%': 0.75,
|
||
'100%': 1.0,
|
||
'110%': 1.1,
|
||
'125%': 1.25,
|
||
'150%': 1.5,
|
||
自定义: 1.0,
|
||
}
|
||
|
||
// 自定义缩放的范围设置
|
||
export const CUSTOM_SCALE_CONFIG = {
|
||
min: 50, // 50%
|
||
max: 300, // 300%
|
||
step: 10, // 步长为10%
|
||
}
|
||
|
||
// Toast显示时间配置
|
||
export const TOAST_DURATION_CONFIG = {
|
||
defaultValue: 1.5, // 默认显示1.5秒
|
||
min: 0.5, // 最小0.5秒
|
||
max: 5.0, // 最大5秒
|
||
step: 0.5, // 步长0.5秒
|
||
}
|
||
|
||
// Toast显示类名
|
||
export const TOAST_CLASS_NAME = 'be-video-scale-toast'
|
||
|
||
// 页面加载后不显示toast的时间阈值(毫秒)
|
||
export const NO_TOAST_TIME_THRESHOLD = 3000
|