feat(webui): animated login background + three independent motion settings
Login page now has a mouse-reactive wavy-line background (ported a-waves + embedded Perlin noise, themed to the accent, rendered behind the card which sits on a 95%-opaque blurred surface so content stays readable). A "我觉得这个 界面很卡怎么办?" link opens a dialog that toggles it off — a device-local preference (localStorage, works pre-auth, defaults off when the OS prefers reduced motion), independent of the system motion settings. Motion settings are now three: - 关闭登录页的动效 — the login background toggle above (device-local). - 减弱动效 (reduceMotion) — soft: transforms/springs off, durations collapsed, page/sidebar instant; gentle entrance fades remain. - 关闭全部动效 (disableMotion, NEW appearance field) — everything reduce does plus data-no-motion CSS (kills pulse dots; spinners excluded so "busy" stays legible) and the entrance opacity fades gated off across overview/processes/logs/config lists.
This commit is contained in:
12 files changed
+363
-33
No files matched your search
@@ -106,6 +106,7 @@ export const DEFAULT_APPEARANCE: UiAppearance = {
|
||||
radius: 0.75,
|
||||
density: 'cozy',
|
||||
reduceMotion: false,
|
||||
disableMotion: false,
|
||||
highContrast: false,
|
||||
sidebarDefaultCollapsed: false,
|
||||
timeFormat: '24h',
|
||||
@@ -304,7 +305,11 @@ function applyAppearance(a: UiAppearance, resolved: 'light' | 'dark'): void {
|
||||
root.setAttribute('data-palette', a.palette);
|
||||
root.setAttribute('data-sidebar-style', a.sidebarStyle);
|
||||
root.setAttribute('data-contrast', a.highContrast ? 'high' : 'normal');
|
||||
root.setAttribute('data-reduce-motion', a.reduceMotion ? '1' : '0');
|
||||
// 减弱动效 OR 关闭全部动效 both engage the reduce-motion CSS/Framer layer;
|
||||
// 关闭全部动效 additionally sets data-no-motion (kills CSS animations outright
|
||||
// and gates Framer entrance fades that reduce-motion leaves on).
|
||||
root.setAttribute('data-reduce-motion', (a.reduceMotion || a.disableMotion) ? '1' : '0');
|
||||
root.setAttribute('data-no-motion', a.disableMotion ? '1' : '0');
|
||||
|
||||
// Mode-independent vars go inline on :root.
|
||||
root.style.setProperty('--radius', `${a.radius}rem`);
|
||||
@@ -679,7 +684,7 @@ export function ThemeProvider({ children }: { children: ReactNode }) {
|
||||
|
||||
return (
|
||||
<ThemeContext.Provider value={value}>
|
||||
<MotionConfig reducedMotion={appearance.reduceMotion ? 'always' : 'user'}>
|
||||
<MotionConfig reducedMotion={(appearance.reduceMotion || appearance.disableMotion) ? 'always' : 'user'}>
|
||||
{children}
|
||||
</MotionConfig>
|
||||
</ThemeContext.Provider>
|
||||
|
||||
Reference in new issue
Block a user