303 lines
20 KiB
CSS
303 lines
20 KiB
CSS
/* ultra launcher: shadcn-neutral tokens and the few components the views use (from legacy/web/ui.css), then the home screen layout. */
|
|
|
|
:root {
|
|
color-scheme: light dark;
|
|
--radius: .625rem;
|
|
--background: light-dark(oklch(1 0 0), oklch(.145 0 0));
|
|
--foreground: light-dark(oklch(.145 0 0), oklch(.985 0 0));
|
|
--card: light-dark(oklch(1 0 0), oklch(.205 0 0));
|
|
--card-foreground: var(--foreground);
|
|
--popover: var(--card);
|
|
--popover-foreground: var(--foreground);
|
|
--primary: light-dark(oklch(.205 0 0), oklch(.922 0 0));
|
|
--primary-foreground: light-dark(oklch(.985 0 0), oklch(.205 0 0));
|
|
--secondary: light-dark(oklch(.97 0 0), oklch(.269 0 0));
|
|
--secondary-foreground: light-dark(oklch(.205 0 0), oklch(.985 0 0));
|
|
--muted: var(--secondary);
|
|
--muted-foreground: light-dark(oklch(.556 0 0), oklch(.708 0 0));
|
|
--accent: var(--secondary);
|
|
--accent-foreground: var(--secondary-foreground);
|
|
--destructive: light-dark(oklch(.577 .245 27.325), oklch(.704 .191 22.216));
|
|
--border: light-dark(oklch(.922 0 0), oklch(1 0 0 / 10%));
|
|
--input: light-dark(oklch(.922 0 0), oklch(1 0 0 / 15%));
|
|
--input-bg: light-dark(transparent, oklch(1 0 0 / 4.5%));
|
|
--ring: light-dark(oklch(.708 0 0), oklch(.556 0 0));
|
|
--shadow-xs: 0 1px 2px 0 rgb(0 0 0 / .05);
|
|
--shadow-sm: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);
|
|
--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);
|
|
--font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
|
|
--font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
}
|
|
.light { color-scheme: light; }
|
|
.dark { color-scheme: dark; }
|
|
|
|
/* ---------------------------------------------------------------- base */
|
|
*, ::before, ::after { box-sizing: border-box; }
|
|
body {
|
|
margin: 0; background: var(--background); color: var(--foreground);
|
|
font: 14px/1.5 var(--font-sans); -webkit-font-smoothing: antialiased;
|
|
}
|
|
.light, .dark { color: var(--foreground); }
|
|
button, input { font: inherit; color: inherit; margin: 0; }
|
|
button { border: 0; background: none; padding: 0; }
|
|
:focus-visible { outline: none; }
|
|
.muted { color: var(--muted-foreground); }
|
|
.mono { font-family: var(--font-mono); }
|
|
.stack { display: grid; gap: 1rem; }
|
|
.row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
|
|
.grow { flex: 1; }
|
|
|
|
/* ---------------------------------------------------------------- button */
|
|
.btn {
|
|
display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
|
|
height: 2.25rem; padding: .5rem 1rem; border-radius: calc(var(--radius) - 2px);
|
|
border: 1px solid transparent; cursor: pointer; user-select: none;
|
|
background: var(--primary); color: var(--primary-foreground); box-shadow: var(--shadow-xs);
|
|
transition: background-color .15s, color .15s, box-shadow .15s, opacity .15s;
|
|
}
|
|
.btn:hover { background: color-mix(in oklab, var(--primary) 90%, transparent); }
|
|
.btn:disabled { opacity: .5; pointer-events: none; }
|
|
.btn:focus-visible, .input:focus-visible, .checkbox:focus-visible, .switch:focus-visible,
|
|
.tab:focus-visible, .toggle:focus-visible {
|
|
border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent);
|
|
}
|
|
.btn.secondary { background: var(--secondary); color: var(--secondary-foreground); }
|
|
.btn.secondary:hover { background: color-mix(in oklab, var(--secondary) 80%, transparent); }
|
|
.btn.outline {
|
|
background: light-dark(var(--background), var(--input-bg)); color: var(--foreground);
|
|
border-color: light-dark(var(--border), var(--input));
|
|
}
|
|
.btn.outline:hover, .btn.ghost:hover { background: var(--accent); color: var(--accent-foreground); }
|
|
.btn.ghost { background: transparent; color: var(--foreground); box-shadow: none; }
|
|
.btn.destructive { background: light-dark(var(--destructive), color-mix(in oklab, var(--destructive) 60%, transparent)); color: #fff; }
|
|
.btn.destructive:hover { background: color-mix(in oklab, var(--destructive) 90%, transparent); }
|
|
.btn.link { background: none; color: var(--primary); box-shadow: none; text-underline-offset: 4px; }
|
|
.btn.link:hover { text-decoration: underline; }
|
|
.btn.sm { height: 2rem; padding: 0 .75rem; gap: .375rem; }
|
|
.btn.lg { height: 2.5rem; padding: 0 1.5rem; }
|
|
.btn.icon { width: 2.25rem; padding: 0; }
|
|
.btn.icon.sm { width: 2rem; }
|
|
.input {
|
|
display: flex; width: 100%; min-width: 0; height: 2.25rem; padding: .25rem .75rem;
|
|
border: 1px solid var(--input); border-radius: calc(var(--radius) - 2px);
|
|
background: var(--input-bg); box-shadow: var(--shadow-xs); font-size: .875rem;
|
|
transition: box-shadow .15s, border-color .15s;
|
|
}
|
|
.input::placeholder { color: var(--muted-foreground); }
|
|
@keyframes ui-fade { from { opacity: 0; } }
|
|
.alert {
|
|
display: grid; gap: .125rem; width: 100%; padding: .75rem 1rem; font-size: .875rem;
|
|
border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); color: var(--card-foreground);
|
|
}
|
|
.alert-title { font-weight: 500; }
|
|
.alert-description { color: var(--muted-foreground); }
|
|
.alert.destructive { color: var(--destructive); }
|
|
.alert.destructive .alert-description { color: color-mix(in oklab, var(--destructive) 90%, transparent); }
|
|
|
|
/* Home screen layout; the components come from ui.css. The page is transparent so the
|
|
system wallpaper shows through the WebView. MainActivity sets --inset-top and
|
|
--inset-bottom to the status and navigation bar (and keyboard) heights. */
|
|
:root {
|
|
--top: var(--inset-top, env(safe-area-inset-top, 0px));
|
|
--bottom: var(--inset-bottom, env(safe-area-inset-bottom, 0px));
|
|
--shadow-text: 0 1px 4px rgb(0 0 0 / .6);
|
|
}
|
|
html, html.dark, html.light, body { background: transparent; }
|
|
html.demo { background: linear-gradient(160deg, #1e293b, #4c1d95 55%, #0f172a) fixed; }
|
|
body { margin: 0; min-height: 100vh; color: #fff; -webkit-tap-highlight-color: transparent;
|
|
user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
|
|
overscroll-behavior: none; }
|
|
#app { max-width: 560px; margin: 0 auto; }
|
|
|
|
/* ---- home */
|
|
.home { min-height: 100vh; box-sizing: border-box;
|
|
padding: calc(var(--top) + 1rem) 16px calc(var(--bottom) + 1.5rem); }
|
|
|
|
.panel { display: flex; gap: .5rem; margin: 0 auto 1rem; padding: .4rem; max-width: 22rem;
|
|
border-radius: 1.25rem; background: rgb(255 255 255 / .12); border: 1px solid rgb(255 255 255 / .16);
|
|
backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
|
|
.panel-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: .6rem;
|
|
min-height: 2.5rem; padding: .4rem 1rem; border: 0; border-radius: .9rem;
|
|
background: rgb(255 255 255 / .1); color: #fff; font: inherit; font-weight: 500;
|
|
cursor: pointer; text-shadow: 0 1px 4px rgb(0 0 0 / .35); }
|
|
.panel-btn:hover, .panel-btn:active { background: rgb(255 255 255 / .22); }
|
|
.windows-glyph { position: relative; width: 1.1rem; height: 1.1rem; }
|
|
.windows-glyph::before, .windows-glyph::after { content: ""; position: absolute; border: 2px solid currentColor;
|
|
border-radius: .25rem; box-sizing: border-box; }
|
|
.windows-glyph::before { inset: 0 .3rem .3rem 0; opacity: .6; }
|
|
.windows-glyph::after { inset: .3rem 0 0 .3rem; background: rgb(255 255 255 / .15); }
|
|
.slots, .apps { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem .5rem;
|
|
grid-template-columns: repeat(4, minmax(0, 1fr)); }
|
|
/* The home grid is placed explicitly by the model (app/view.mbt sets its columns, rows and
|
|
every slot's cell inline); the gaps and the 64px row height must match grid/grid.mbt. */
|
|
.slots { gap: 8px; }
|
|
@media (min-width: 480px) { .apps { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
|
|
.tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: .4rem;
|
|
padding: .35rem .15rem; border-radius: calc(var(--radius) + 4px); cursor: pointer; }
|
|
.tile:active { background: rgb(255 255 255 / .12); }
|
|
/* --s is the icon size setting as a factor (1 = the original size); the model sets it on
|
|
the home grid, the drawer list and the sheet's preview, and picks the row height and
|
|
column count to match (app/view.mbt, grid/scale.mbt). */
|
|
.icon { width: calc(3.25rem * var(--s, 1)); height: calc(3.25rem * var(--s, 1)); object-fit: contain; pointer-events: none;
|
|
filter: drop-shadow(0 2px 4px rgb(0 0 0 / .3)); }
|
|
.icon.missing { border-radius: 999px; background: rgb(255 255 255 / .18); object-position: -999px 0; }
|
|
.name { max-width: 100%; font-size: calc(.75rem * var(--s, 1)); line-height: 1.2; text-align: center;
|
|
text-shadow: var(--shadow-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
.slots .tile, .icon-preview .tile { gap: calc(.25rem * var(--s, 1)); padding: calc(.2rem * var(--s, 1)) .1rem; }
|
|
.slots .icon, .icon-preview .icon { width: calc(2.5rem * var(--s, 1)); height: calc(2.5rem * var(--s, 1)); }
|
|
.slots .name, .icon-preview .name { font-size: calc(.68rem * var(--s, 1)); }
|
|
.drawer .apps { gap: calc(1.25rem * var(--s, 1)) .5rem; }
|
|
.drawer .tile { gap: calc(.4rem * var(--s, 1)); }
|
|
|
|
/* A widget takes whole rows. On a phone the native widget view covers the slot;
|
|
the label only shows while the slot is not live (or in a desktop browser). */
|
|
.widget-slot { display: grid; place-items: center; box-sizing: border-box;
|
|
border-radius: 1.25rem; background: rgb(255 255 255 / .1);
|
|
border: 1px dashed rgb(255 255 255 / .3); }
|
|
.widget-label { font-size: .875rem; opacity: .75; text-shadow: var(--shadow-text);
|
|
max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
|
|
/* The native view can be narrower than the slot, so the label would peek out at its sides. */
|
|
.widget-slot[data-wid] .widget-label { visibility: hidden; }
|
|
/* A live widget sits bare on the wallpaper; the frame only comes back while it is picked
|
|
up or resized (or while its native view is away, e.g. another widget is being resized). */
|
|
.widget-slot[data-wid]:not(.lifted):not(.resizing) { background: none; border-color: transparent; }
|
|
|
|
/* A widget being resized: generous 36-40px handles straddle the widget border (inset enough
|
|
to stay inside the viewport on full-width widgets); WidgetView passes edge touches through. */
|
|
.widget-slot { position: relative; }
|
|
.widget-slot.resizing { z-index: 2; outline: 2px solid rgb(255 255 255 / .85);
|
|
outline-offset: 3px; transition: none; }
|
|
.resize-handle { position: absolute; z-index: 2; touch-action: none; cursor: nwse-resize; }
|
|
.resize-handle::after { content: ""; position: absolute; border-radius: 999px; background: #fff;
|
|
box-shadow: 0 1px 6px rgb(0 0 0 / .45);
|
|
transition: background-color .1s, box-shadow .1s; }
|
|
.resize-handle.active::after, .resize-handle:active::after {
|
|
background: #93c5fd;
|
|
box-shadow: 0 0 0 4px rgb(147 197 253 / .35), 0 2px 8px rgb(0 0 0 / .55);
|
|
}
|
|
.resize-handle[data-edge="l"] { top: 12px; bottom: 12px; left: -14px; width: 36px; cursor: ew-resize; }
|
|
.resize-handle[data-edge="l"]::after { top: 50%; left: 7px; width: 6px; height: 2.25rem; transform: translateY(-50%); }
|
|
.resize-handle[data-edge="r"] { top: 12px; bottom: 12px; right: -14px; width: 36px; cursor: ew-resize; }
|
|
.resize-handle[data-edge="r"]::after { top: 50%; right: 7px; width: 6px; height: 2.25rem; transform: translateY(-50%); }
|
|
.resize-handle[data-edge="t"] { left: 12px; right: 12px; top: -14px; height: 36px; cursor: ns-resize; }
|
|
.resize-handle[data-edge="t"]::after { left: 50%; top: 7px; width: 2.25rem; height: 6px; transform: translateX(-50%); }
|
|
.resize-handle[data-edge="b"] { left: 12px; right: 12px; bottom: -14px; height: 36px; cursor: ns-resize; }
|
|
.resize-handle[data-edge="b"]::after { left: 50%; bottom: 7px; width: 2.25rem; height: 6px; transform: translateX(-50%); }
|
|
.resize-handle[data-edge="rb"] { right: -14px; bottom: -14px; width: 40px; height: 40px; z-index: 3; cursor: nwse-resize; }
|
|
.resize-handle[data-edge="rb"]::after { right: 3px; bottom: 3px; width: 16px; height: 16px; border-radius: 5px; }
|
|
.resize-bar { position: fixed; left: 50%; bottom: calc(var(--bottom) + 1rem); z-index: 15; transform: translateX(-50%);
|
|
display: flex; align-items: center; gap: .5rem; padding: .4rem .4rem .4rem .75rem; border-radius: 999px;
|
|
background: rgb(0 0 0 / .82); color: #fff; font-size: .875rem; white-space: nowrap;
|
|
animation: ui-fade .15s; }
|
|
.resize-bar { max-width: calc(100vw - 1rem); }
|
|
.resize-size { flex: none; padding: .15rem .5rem; border-radius: 999px;
|
|
background: rgb(255 255 255 / .16); font-size: .75rem; font-weight: 600;
|
|
font-variant-numeric: tabular-nums; }
|
|
.resize-hint { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
|
|
.resize-bar .btn { flex: none; }
|
|
.resize-bar .btn.ghost { color: #fff; }
|
|
.resize-bar .btn.ghost:hover { background: rgb(255 255 255 / .12); color: #fff; }
|
|
|
|
/* A slot picked up by a long press, while it is dragged (index.html moves it). */
|
|
.slots > li { transition: transform .15s ease-out; }
|
|
.slots > .lifted { z-index: 1; transform: scale(1.12); background: rgb(255 255 255 / .16);
|
|
box-shadow: 0 8px 24px rgb(0 0 0 / .35); }
|
|
.slots.dragging > li:not(.lifted) { opacity: .8; }
|
|
.slots.dragging .tile:active { background: none; }
|
|
|
|
.hint, .empty { text-align: center; opacity: .85; text-shadow: var(--shadow-text); }
|
|
.hint { margin-top: 30vh; padding: 0 2rem; font-size: .9rem; line-height: 1.5; }
|
|
|
|
/* The search pill under the panel: a tap opens the drawer. */
|
|
.search-pill { display: flex; align-items: center; gap: .75rem; width: 100%; max-width: 22rem; height: 2.75rem;
|
|
margin: -.25rem auto 1rem; padding: 0 1.1rem; border-radius: 999px; cursor: pointer;
|
|
background: rgb(255 255 255 / .1); border: 1px solid rgb(255 255 255 / .15);
|
|
color: rgb(255 255 255 / .6); font-size: 1rem; text-align: left; }
|
|
.search-pill:active { background: rgb(255 255 255 / .18); }
|
|
.magnifier { position: relative; flex: none; width: 1rem; height: 1rem; }
|
|
.magnifier::before { content: ""; position: absolute; inset: 0 .3rem .3rem 0; border: 2px solid rgb(255 255 255 / .75);
|
|
border-radius: 999px; }
|
|
.magnifier::after { content: ""; position: absolute; right: 0; bottom: .05rem; width: .45rem; height: 2px;
|
|
background: rgb(255 255 255 / .75); border-radius: 1px; transform: rotate(45deg); }
|
|
button { cursor: pointer; }
|
|
|
|
/* ---- drawer: GPU-composited slide+fade over the home screen */
|
|
.drawer { position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column;
|
|
padding: calc(var(--top) + 1rem) 16px 0; background: rgb(10 10 14 / .84);
|
|
will-change: transform, opacity;
|
|
animation: drawer-in 180ms cubic-bezier(.2, .8, .2, 1); }
|
|
.drawer.closing { pointer-events: none;
|
|
animation: drawer-out 140ms cubic-bezier(.4, 0, 1, 1) forwards; }
|
|
@keyframes drawer-in {
|
|
from { opacity: 0; transform: translate3d(0, -20px, 0); }
|
|
to { opacity: 1; transform: translate3d(0, 0, 0); }
|
|
}
|
|
@keyframes drawer-out {
|
|
from { opacity: 1; transform: translate3d(0, 0, 0); }
|
|
to { opacity: 0; transform: translate3d(0, -16px, 0); }
|
|
}
|
|
.drawer-head { display: flex; gap: .5rem; align-items: center; margin-bottom: 1rem; }
|
|
.drawer-head .input { flex: 1; height: 2.75rem; border-radius: 999px; padding: 0 1.25rem; font-size: 1rem;
|
|
background: rgb(255 255 255 / .1); border-color: rgb(255 255 255 / .15); color: #fff; }
|
|
.drawer-head .input::placeholder { color: rgb(255 255 255 / .6); }
|
|
.drawer-head .input::-webkit-search-cancel-button { filter: invert(1); }
|
|
.drawer-head .btn.ghost { color: #fff; }
|
|
.drawer-head .btn.ghost:hover { background: rgb(255 255 255 / .12); color: #fff; }
|
|
.drawer-note { margin: 0 0 1rem; font-size: .875rem; opacity: .8; text-align: center; }
|
|
.drawer .apps { flex: 1; overflow-y: auto; align-content: start;
|
|
padding-bottom: calc(var(--bottom) + 1.5rem); overscroll-behavior: contain; }
|
|
.drawer .empty { flex: 1; }
|
|
.picking .tile::after { content: ""; position: absolute; top: .1rem; right: .6rem; width: 1.25rem; height: 1.25rem;
|
|
border-radius: 999px; border: 2px solid #fff; box-sizing: border-box;
|
|
background: rgb(0 0 0 / .35); }
|
|
.picking .tile.on::after { content: "✓"; display: grid; place-items: center; font-size: .75rem; font-weight: 700;
|
|
background: #fff; color: #111; }
|
|
|
|
/* ---- sheets (long-press menus, widget picker) */
|
|
.sheet-overlay { position: fixed; inset: 0; z-index: 20; background: rgb(0 0 0 / .45); animation: ui-fade .15s; }
|
|
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; max-width: 560px; margin: 0 auto;
|
|
max-height: 70vh; overflow-y: auto; box-sizing: border-box;
|
|
padding: .75rem 1rem calc(var(--bottom) + 1rem); border-radius: 1.25rem 1.25rem 0 0;
|
|
background: var(--popover); color: var(--popover-foreground);
|
|
animation: rise .2s cubic-bezier(.2, .8, .2, 1); }
|
|
.sheet::before { content: ""; display: block; width: 2.25rem; height: .3rem; margin: 0 auto .75rem;
|
|
border-radius: 999px; background: var(--border); }
|
|
@keyframes rise { from { transform: translateY(100%); } to { transform: none; } }
|
|
.sheet-title { margin: 0 .5rem .5rem; font-size: 1rem; font-weight: 600; }
|
|
.sheet-item { display: block; width: 100%; padding: .85rem .5rem; border: 0; border-radius: var(--radius);
|
|
background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
|
|
.sheet-item:hover, .sheet-item:active { background: var(--accent); }
|
|
.sheet .empty { text-shadow: none; color: var(--muted-foreground); }
|
|
/* ---- icon size sheet */
|
|
.icon-preview { list-style: none; margin: 0 0 1rem; padding: .75rem .5rem; display: flex; justify-content: space-around;
|
|
align-items: flex-start; min-height: 6rem; overflow: hidden; border-radius: var(--radius);
|
|
background: rgb(10 10 14 / .84); color: #fff; }
|
|
.icon-preview .tile { flex: 1 1 0; min-width: 0; cursor: default; }
|
|
.icon-size-row { display: flex; align-items: center; gap: .75rem; margin: 0 .5rem 1rem; }
|
|
.icon-size-slider { flex: 1; min-width: 0; height: 2rem; accent-color: var(--primary); touch-action: pan-y; }
|
|
.icon-size-value { min-width: 3.25rem; text-align: center; background: var(--secondary); }
|
|
.icon-presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: 0 .25rem 1rem; }
|
|
.icon-error { margin: 0 .25rem 1rem; }
|
|
.widget-list { list-style: none; margin: 0; padding: 0; display: grid; }
|
|
.widget-list li { display: flex; align-items: center; gap: .75rem; padding: .5rem; border-radius: var(--radius);
|
|
cursor: pointer; }
|
|
.widget-list li:hover, .widget-list li:active { background: var(--accent); }
|
|
.widget-list .icon { width: 2.5rem; height: 2.5rem; filter: none; }
|
|
.widget-name { display: grid; }
|
|
.widget-name small { color: var(--muted-foreground); font-size: .8rem; }
|
|
.widget-search { width: 100%; margin-bottom: .5rem; }
|
|
.sheet-copy { margin: 0 .5rem .75rem; font-size: .875rem; color: var(--muted-foreground); line-height: 1.45; }
|
|
.sheet-steps { margin: 0 .5rem 1rem; padding-left: 1.25rem; display: grid; gap: .5rem; font-size: .875rem; line-height: 1.45; }
|
|
.sheet-steps strong { font-weight: 600; color: var(--popover-foreground); }
|
|
.sheet-actions { display: grid; gap: .5rem; margin: 0 .25rem; }
|
|
.sheet-actions .btn { width: 100%; height: 2.5rem; }
|
|
|
|
.notice, #toast { position: fixed; left: 50%; bottom: calc(var(--bottom) + 2rem); z-index: 30;
|
|
transform: translateX(-50%); padding: .5rem 1rem; border-radius: 999px;
|
|
background: rgb(0 0 0 / .8); color: #fff; font-size: .875rem; white-space: nowrap;
|
|
pointer-events: none; animation: ui-fade .15s; }
|
|
#toast { opacity: 0; transition: opacity .2s; animation: none; }
|
|
#toast.show { opacity: 1; }
|
|
|
|
@media (prefers-reduced-motion: reduce) { .drawer, .drawer.closing, .sheet { animation: none; } }
|