Files
dawnline/web/src/portal/styles/sheet.css
T
Aemeath ba231e7187
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
Dawnline 0.15.0
- 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
2026-10-22 04:02:54 +03:00

297 lines
6.6 KiB
CSS
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/* The sheet: a drawer floating at the bottom of a phone, a dialog in the middle of a computer, × and a view's
own buttons pinned in its corner, the views inside (head, line under it), and the question look (Remove,
Reconnect). */
/* Closed, the sheet is out of the page (display, not visibility): each open computes its styles
afresh. Hidden by visibility, Chromium could keep the inherited "hidden" on the views' box after a
quick close and reopen (a double tap on Reconnect), and the sheet opened empty but for its buttons. */
.sheet-root {
position: fixed;
inset: 0;
z-index: 50;
display: none;
}
.sheet-root.open {
display: block;
}
/* The dim alone, no blur behind it: a blur of the whole page would be drawn again on every frame the sheet and
the dim move, and the system's own sheets dim too. */
.scrim {
position: absolute;
inset: 0;
background: var(--scrim);
}
.sheet {
position: absolute;
left: var(--gutter-l);
right: var(--gutter-r);
bottom: calc(16px + env(safe-area-inset-bottom, 0px));
margin: 0 auto;
max-width: 400px;
max-height: calc(100% - 32px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
background: var(--raised);
border-radius: var(--r-sheet);
box-shadow: var(--sheet-shadow);
overflow: hidden;
display: flex;
flex-direction: column;
}
/* On a computer (and a tablet held wide): a dialog in the middle of the screen, which comes up from
its centre (ui/sheet.ts); a phone keeps the drawer at the bottom. The breakpoint is the one the
sheet widens at for a dense code. Centred by the layout, not a transform, so its text stays on the
pixel grid and its own transform stays free for the motion. */
@media (min-width: 760px) {
.sheet-root.open {
display: flex;
align-items: center;
justify-content: center;
}
.sheet {
position: relative;
left: auto;
right: auto;
bottom: auto;
margin: 0;
width: calc(100% - var(--gutter-l) - var(--gutter-r));
}
}
.sheet .x {
position: absolute;
z-index: 3;
right: 22px;
top: 22px;
}
/* The viewport: as tall as its view, give or take the gap or overhang under the view while it glides to a new height
(ui/sheet.ts); what does not fit yet, and a view on its way out, is clipped. */
.vp {
position: relative;
overflow: hidden;
flex: none;
}
.sheet-scroll {
flex: 1 1 auto;
min-height: 0;
overflow-y: auto;
overscroll-behavior: contain;
}
.view {
padding: 0 24px 24px;
display: flex;
flex-direction: column;
}
/* Pulled down by its head to close: the head takes the touch, the rest scrolls. */
.vhead {
display: flex;
align-items: center;
gap: 12px;
height: 76px;
padding-right: 44px;
flex: none;
cursor: grab;
touch-action: none;
}
.vhead h2 {
flex: 1;
margin: 0;
font-size: 20px;
line-height: 28px;
font-weight: 500;
letter-spacing: -0.5px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.vhead.center h2 {
text-align: center;
}
.vhead.with-acts {
padding-right: 126px;
}
.vsub {
margin: -16px 0 18px;
color: var(--text-2);
font-size: 14px;
line-height: 20px;
}
.vhead.center + .vsub {
text-align: center;
margin: -6px auto 24px;
max-width: 32ch;
text-wrap: balance;
}
.view > .hint.bad-t {
margin-top: 8px;
}
.secure-note {
margin-top: 12px;
text-align: center;
}
/* A view's own buttons beside × and pinned like it: icons only, each the size and colour of ×; the
two join with tighter inner corners. */
.sheet-acts {
position: absolute;
z-index: 3;
top: 22px;
right: 58px;
}
/* The connection's download and copy, on its row beside the chevron: quiet icons in the chevron's grey, a knob
circle behind one under the pointer. */
.hpill {
position: relative;
display: flex;
}
.hp-b {
display: grid;
place-items: center;
width: 32px;
height: 32px;
border-radius: 50%;
color: var(--text-2);
transition:
background-color 150ms,
color 150ms,
transform 150ms var(--ease-out);
}
.hp-b .i {
width: 16px;
height: 16px;
}
.hp-b:hover {
background: var(--knob);
color: var(--text);
}
.hp-b:active {
transform: scale(0.94);
}
.hp-b.done {
color: var(--ok);
}
/* Their tooltip: a small toast-coloured pill under the keys, one for both. */
.hp-tip {
position: absolute;
z-index: 4;
left: 0;
top: calc(100% + 8px);
height: 26px;
padding: 0 10px;
display: flex;
align-items: center;
border-radius: 999px;
background: var(--toast);
color: var(--toast-fg);
font: 500 12px/1 var(--font);
letter-spacing: -0.1px;
white-space: nowrap;
box-shadow:
0 0 0 1px var(--line-glass),
var(--pop-shadow);
opacity: 0;
pointer-events: none;
overflow: hidden;
transform-origin: 50% 0;
}
.hp-tip.on {
opacity: 1;
}
.hp-tip .tt {
position: relative;
display: inline-flex;
justify-content: center;
white-space: nowrap;
}
.hp-tip .tt-m {
position: absolute;
left: 0;
top: 0;
visibility: hidden;
white-space: nowrap;
}
/* Connected: nothing is left to do here, so × and the view's buttons step away; the sheet then closes
by itself. A question has its own Cancel: no × beside it either. */
.sheet .x,
.sheet-acts {
transition:
transform 150ms var(--ease-out),
background-color 150ms,
opacity 240ms var(--ease-out),
filter 240ms var(--ease-out),
scale 240ms var(--ease-out);
}
.sheet.arrived .x,
.sheet.arrived .sheet-acts,
.sheet.asks .x {
opacity: 0;
filter: blur(3px);
scale: 0.9;
pointer-events: none;
}
/* A question before something that cannot be undone. */
.center-col,
.ask {
display: flex;
flex-direction: column;
}
.center-col {
align-items: center;
text-align: center;
}
/* A question before something that cannot be undone (Reconnect, Remove): the icon, the question
and what happens on the left edge, as iOS asks now, as far from the top as from the sides; the
buttons span the sheet under them. */
.ask {
align-items: flex-start;
text-align: left;
padding-top: 24px;
}
.center-col.secure {
padding-top: 4px;
}
:is(.center-col, .ask) .gi.xl {
width: 64px;
height: 64px;
margin: 8px 0 16px;
}
.ask .gi.xl {
margin: 0 0 18px;
}
:is(.center-col, .ask) h3 {
margin: 0;
font-size: 20px;
line-height: 28px;
font-weight: 500;
letter-spacing: -0.5px;
}
:is(.center-col, .ask) p {
margin: 6px 0 22px;
color: var(--text-2);
font-size: 15px;
line-height: 21px;
}
.center-col p {
max-width: 30ch;
text-wrap: balance;
}
.ask p {
text-wrap: pretty;
}
.center-col.secure p {
margin-top: 0;
}
.btnrow {
display: flex;
gap: 8px;
width: 100%;
}
.btnrow .btn {
flex: 1;
}
.btnrow2 {
display: grid;
gap: 8px;
}
.btnrow2 .btn {
width: 100%;
}