Dawnline 0.16.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 personal page loads faster and costs the router less: its script and styles come compressed, stay in the browser until the next update, and the icon comes with the page instead of a request of its own - The page uses the system's own font (SF Pro on Apple devices, Segoe UI on Windows, Roboto on Android) instead of downloading one - The top of the page shows the server's name alone, so it fits on a phone - Text can be selected only where it is there to be copied (addresses, file names, the configuration), with the name field's own selection: a soft highlight with handles that glides after the pointer - Sheets scroll without a scrollbar - Red buttons (Remove) light up under the pointer, as the others do - Demo: "Demo" and GitHub are one button; on a phone it floats at the bottom of the screen, and switching scenarios no longer makes the edge fades jump
This commit is contained in:
1 parent
750564ab7e
commit
2388603322
91 files changed
+2564
-1027
No files matched your search
@@ -1,8 +1,7 @@
|
||||
// The demo's scenario picker: the "Demo" chip, opening a drawer with the
|
||||
// scenarios in groups (glass icon, name, what the page shows) and "Start over".
|
||||
// Picking one swaps the page in place. Built only from the portal's own parts
|
||||
// (sheet, glass icons, toast, motion); where the chip sits is crumbs.ts. On a
|
||||
// phone the drawer's foot also links to GitHub, the breadcrumb having no room.
|
||||
// The demo's scenario picker: a drawer with the scenarios in groups (glass
|
||||
// icon, name, what the page shows) and "Start over". Picking one swaps the page
|
||||
// in place. Built only from the portal's own parts (sheet, glass icons, toast,
|
||||
// motion); the "Demo" buttons that open it, and where they sit, are crumbs.ts.
|
||||
|
||||
import { h, ic } from '../dom';
|
||||
import { call } from '../api';
|
||||
@@ -11,7 +10,7 @@ import { closeSheet, head, onSheetEntry, openSheet, sub, type View } from '../ui
|
||||
import { glass, type Tone } from '../ui/glass';
|
||||
import { toast } from '../ui/feedback';
|
||||
import { EASE_OUT, play } from '../motion';
|
||||
import { REPO, groups, type Scenario, type ScenarioId } from './data';
|
||||
import { groups, type Scenario, type ScenarioId } from './data';
|
||||
import type { DemoRouter } from './router';
|
||||
|
||||
/** Each scenario's glass icon and tone (the glass set is smaller than the line icons). */
|
||||
@@ -28,8 +27,8 @@ const LOOK: Record<ScenarioId, [string, Tone]> = {
|
||||
full: ['phone', 'grey'],
|
||||
};
|
||||
|
||||
/** The chip that opens the scenarios. */
|
||||
export function scenarioChip(router: DemoRouter): HTMLElement {
|
||||
/** What opens the scenarios' drawer. */
|
||||
export function scenarioPicker(router: DemoRouter): () => void {
|
||||
const app = document.getElementById('app')!;
|
||||
|
||||
/** Swap the page in place: it dims away and comes back drawn from the scenario, the link saying which. */
|
||||
@@ -44,14 +43,16 @@ export function scenarioChip(router: DemoRouter): HTMLElement {
|
||||
else mark();
|
||||
closeSheet();
|
||||
router.use(s);
|
||||
const out = play(app, [{ opacity: 1 }, { opacity: 0, filter: 'blur(4px)' }], { duration: 160, easing: EASE_OUT, fill: 'forwards' });
|
||||
// The page, not #app: a filter or a transform on #app would carry its fixed edge fades along until it ends.
|
||||
const page = app.querySelector<HTMLElement>('.page') ?? app;
|
||||
const out = play(page, [{ opacity: 1 }, { opacity: 0, filter: 'blur(4px)' }], { duration: 160, easing: EASE_OUT, fill: 'forwards' });
|
||||
const st = await call<State>('state');
|
||||
await out.finished;
|
||||
setState(st);
|
||||
repaint();
|
||||
out.cancel();
|
||||
play(
|
||||
app,
|
||||
page,
|
||||
[
|
||||
{ opacity: 0, filter: 'blur(4px)', transform: 'translateY(6px)' },
|
||||
{ opacity: 1, filter: 'none', transform: 'none' },
|
||||
@@ -94,16 +95,10 @@ export function scenarioChip(router: DemoRouter): HTMLElement {
|
||||
ic('reset'),
|
||||
h('span', {}, _('Start over')),
|
||||
),
|
||||
h('a', { class: 'btn soft dm-gh-alt', href: REPO, target: '_blank', rel: 'noopener' }, ic('github'), h('span', {}, 'GitHub')),
|
||||
),
|
||||
);
|
||||
return { el, label: _('Try a scenario') };
|
||||
}
|
||||
|
||||
return h(
|
||||
'button',
|
||||
{ type: 'button', class: 'dm-chip', 'aria-haspopup': 'dialog', onclick: () => openSheet(scenarios) },
|
||||
h('span', {}, _('Demo')),
|
||||
ic('chevron', 'i'),
|
||||
);
|
||||
return () => openSheet(scenarios);
|
||||
}
|
||||
Reference in new issue
Block a user