Dawnline 0.15.0
Build packages / CI (push) Blocked by required conditions
Build packages / Version (push) Waiting to run
CI / Web (format, types, tests, bundles) (push) Blocked by required conditions
CI / ShellCheck (push) Blocked by required conditions
CI / ucode static checks (push) Blocked by required conditions
CI / ucode compiles and tests pass (OpenWrt 24.10) (push) Blocked by required conditions
CI / ucode compiles and tests pass (OpenWrt 25.12) (push) Blocked by required conditions
Build packages / CI (push) Blocked by required conditions
Build packages / Version (push) Waiting to run
CI / Web (format, types, tests, bundles) (push) Blocked by required conditions
CI / ShellCheck (push) Blocked by required conditions
CI / ucode static checks (push) Blocked by required conditions
CI / ucode compiles and tests pass (OpenWrt 24.10) (push) Blocked by required conditions
CI / ucode compiles and tests pass (OpenWrt 25.12) (push) Blocked by required conditions
- The device menu (⋯) is an iOS-style menu on frosted glass: the copy actions show the address they copy, Rename, Reconnect and Remove sit under them, and one highlight glides from row to row - The language picker shows flags; pick a language with a click, or press the pill and slide onto one. The flag and the code change in place - The page's QR code opens as a small card under its button, with Copy link and Share - All dropdowns look and behave the same: frosted glass, one open at a time, and a press outside, Escape or the button again closes them - Setting a device up: when it can't finish connecting or connects but passes no data, the sheet keeps just the status and what it means. No data now says the router drops its traffic because the address doesn't match, and the device's card says "Connected, but no data" right away instead of "Connected" - Setting a phone up from another device: Download and Copy for the connection sit on its row, next to the arrow - On iPhone and iPad the caret shows as soon as a field is focused, the page no longer zooms on a pinch or a double tap, and sheets and their animations run smoother - A press near the edge of a button or a card always counts, even as it shrinks under the pointer - Animations settle without a jump at the end - New green, orange and red - The focus ring shows only while moving around with the keyboard
This commit is contained in:
1 parent
a1915f070b
commit
ba231e7187
51 files changed
+1713
-1062
No files matched your search
@@ -8,8 +8,25 @@
|
||||
// BOUNCY is the skiper103 accordion (about 11% overshoot), SMOOTH the skiper21
|
||||
// tab pill (critically damped). Reduced motion keeps fades and drops travel.
|
||||
|
||||
/** Asked once and kept (it answers as the setting changes): play() asks on every animation. */
|
||||
const REDUCE = typeof matchMedia === 'function' ? matchMedia('(prefers-reduced-motion: reduce)') : null;
|
||||
|
||||
/** The visitor asked for less motion: fades only, nothing travels. */
|
||||
export const calm = (): boolean => typeof matchMedia === 'function' && matchMedia('(prefers-reduced-motion: reduce)').matches;
|
||||
export const calm = (): boolean => !!REDUCE?.matches;
|
||||
|
||||
/** Past this many px² a blur is a large layer's, drawn anew on every frame: it fades without. */
|
||||
const BIG_BLUR = 30_000;
|
||||
|
||||
/**
|
||||
* A large element's frames without their blur (a fold, an accordion's body, a sheet): opacity, movement and size
|
||||
* go on as they were. Letters, icons and small things keep theirs.
|
||||
*/
|
||||
function lean(el: Element, frames: Keyframe[]): Keyframe[] {
|
||||
if (!frames.some((f) => 'filter' in f)) return frames;
|
||||
const r = el.getBoundingClientRect();
|
||||
if (r.width * r.height < BIG_BLUR) return frames;
|
||||
return frames.map(({ filter: _f, ...f }) => f);
|
||||
}
|
||||
|
||||
export interface Spring {
|
||||
/** Until it settles within 0.15% of the end. */
|
||||
@@ -38,11 +55,16 @@ export function spring(k: number, c: number, m = 1): Spring {
|
||||
let end = 0;
|
||||
for (let t = 0; t < 3; t += 0.004) if (Math.abs(1 - x(t)) > 0.0015) end = t;
|
||||
end += 0.004;
|
||||
// Cut where it is within 0.15% of the end, the spring still has that much to go: on a large travel (a row
|
||||
// folding 500 px) a step of a pixel in the last frame. What is left is spread over the way instead, most of
|
||||
// it near the end, so the curve arrives at 1 exactly and smoothly; overshoot and timing stay as they are.
|
||||
const rest = 1 - x(end);
|
||||
const y = (t: number) => x(t) + rest * (t / end) ** 3;
|
||||
const pts: number[] = [];
|
||||
for (let i = 0; i <= 64; i++) pts.push(+x((end * i) / 64).toFixed(4));
|
||||
for (let i = 0; i <= 64; i++) pts.push(+y((end * i) / 64).toFixed(4));
|
||||
pts[64] = 1;
|
||||
const duration = Math.round(end * 1000);
|
||||
return { duration, easing: `linear(${pts.join(', ')})`, at: (ms) => (ms >= duration ? 1 : x(ms / 1000)) };
|
||||
return { duration, easing: `linear(${pts.join(', ')})`, at: (ms) => (ms >= duration ? 1 : y(ms / 1000)) };
|
||||
}
|
||||
|
||||
/** The accordion, the toast, a card that pops in. */
|
||||
@@ -57,6 +79,8 @@ export const LEAD = spring(520, 46);
|
||||
export const SOFT = spring(380, 28);
|
||||
/** What follows the pointer (a menu's highlight): there in about 130 ms, no overshoot. */
|
||||
export const QUICK = spring(900, 60);
|
||||
/** A highlight gliding from row to row: quick, with a touch of give (about 2% over). */
|
||||
export const GLIDE = spring(640, 40);
|
||||
|
||||
export const EASE_OUT = 'cubic-bezier(0.23, 1, 0.32, 1)';
|
||||
export const EASE_IN = 'cubic-bezier(0.55, 0, 1, 0.45)';
|
||||
@@ -72,6 +96,8 @@ export function publishSprings(root: HTMLElement) {
|
||||
root.style.setProperty('--spring-soft-dur', `${SOFT.duration}ms`);
|
||||
root.style.setProperty('--spring-quick', QUICK.easing);
|
||||
root.style.setProperty('--spring-quick-dur', `${QUICK.duration}ms`);
|
||||
root.style.setProperty('--spring-glide', GLIDE.easing);
|
||||
root.style.setProperty('--spring-glide-dur', `${GLIDE.duration}ms`);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -79,7 +105,7 @@ export function publishSprings(root: HTMLElement) {
|
||||
* its fade (short); one that only moves or resizes jumps to its end.
|
||||
*/
|
||||
export function play(el: Element, frames: Keyframe[], o: KeyframeAnimationOptions): Animation {
|
||||
if (!calm()) return el.animate(frames, o);
|
||||
if (!calm()) return el.animate(lean(el, frames), o);
|
||||
if (frames.some((f) => 'opacity' in f))
|
||||
return el.animate(
|
||||
frames.map((f) => ('opacity' in f ? { opacity: f.opacity } : {})),
|
||||
|
||||
Reference in new issue
Block a user