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:
DrSmoothl committed 2026-06-14 00:41:18 +08:00
1 parent 9dd46198cb
commit 985dfd4705
12 files changed
+363 -33

No files matched your search

@@ -46,6 +46,7 @@ function renderWidget(block: UiLayoutItem): ReactNode {
export function OverviewPage() {
const { qqList, processList } = useAppState();
const { overviewBlocks, setOverviewBlocks, resetLayout, editing: editingCtx, setEditing } = useLayout();
const off = useTheme().appearance.disableMotion;
const isWide = useMediaQuery('(min-width: 768px)');
// Free-grid editing is desktop-only (no room to drag/resize on a phone).
const editing = isWide && editingCtx;
@@ -100,7 +101,7 @@ export function OverviewPage() {
{/* First-run nudge — always shown (not a grid widget) so it can't be hidden. */}
{qqList.length === 0 && (
<motion.div initial={{ opacity: 0, y: -4 }} animate={{ opacity: 1, y: 0 }}>
<motion.div initial={off ? false : { opacity: 0, y: -4 }} animate={{ opacity: 1, y: 0 }}>
<Link
to="/processes"
className="flex items-center gap-3 rounded-xl border border-primary/30 bg-primary/5 px-4 py-3 transition-colors hover:bg-primary/10"
@@ -367,6 +368,7 @@ function HostBlock() {
function SessionsBlock({ config }: { config: SessionsConfig }) {
const { qqList } = useAppState();
const off = useTheme().appearance.disableMotion;
const list = useMemo(() => {
const f = config.filter.trim().toLowerCase();
let arr = f
@@ -398,10 +400,10 @@ function SessionsBlock({ config }: { config: SessionsConfig }) {
{list.map((q, idx) => (
<motion.div
key={q.uin}
initial={{ opacity: 0, y: 6 }}
initial={off ? false : { opacity: 0, y: 6 }}
animate={{ opacity: 1, y: 0 }}
transition={{ delay: 0.03 + idx * 0.04, duration: 0.22 }}
whileHover={{ y: -2 }}
transition={off ? { duration: 0 } : { delay: 0.03 + idx * 0.04, duration: 0.22 }}
whileHover={off ? undefined : { y: -2 }}
className="flex items-center gap-3 rounded-lg border bg-card/40 p-3"
>
<Avatar size={40}>