fix(web): danmaku density range 0.1-1 per product ruling

This commit is contained in:
noelorin 2026-09-25 11:30:44 +08:00
parent f96afbc4b5
commit 728a576a4f
3 changed files with 4 additions and 4 deletions

View File

@ -24,7 +24,7 @@ function readSettings(): DanmakuSettings {
return {
enabled,
opacity: Math.min(1, Math.max(0, opacityRaw)),
density: Math.min(3, Math.max(0.1, densityRaw)),
density: Math.min(1, Math.max(0.1, densityRaw)),
};
} catch {
return FALLBACK;
@ -79,7 +79,7 @@ function Inner(props: { locale: Locale }) {
<input
type="range"
min={0.1}
max={3}
max={1}
step={0.1}
value={density}
onChange={(e) => setDensity(Number(e.target.value))}

View File

@ -31,7 +31,7 @@ function readDanmakuPrefs(): DanmakuPrefs {
return {
enabled,
opacity: Math.min(1, Math.max(0, opacityRaw)),
density: Math.min(3, Math.max(0.1, densityRaw)),
density: Math.min(1, Math.max(0.1, densityRaw)),
};
} catch {
return fallback;

View File

@ -81,7 +81,7 @@ export const danmakuSchemas = {
settings: z.object({
enabled: z.boolean().default(true),
opacity: z.number().min(0).max(1).default(0.8),
density: z.number().min(0.1).max(3).default(1),
density: z.number().min(0.1).max(1).default(1),
}),
getSettings: z.object({}).optional(),
};