The WebView requests a screenful of icons at once on several threads, and loading and drawing icon drawables concurrently failed for that first batch (and for every widget icon). Icons are now drawn one at a time under a lock from a mutated drawable, widget icons fall back to the app icon, and failures are logged under the "ultra" tag. The page retries a failed icon twice and then shows a blank disc instead of a broken image. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019EEjkJVV72Lu8ndDVWg5BT
103 lines
6.9 KiB
CSS
103 lines
6.9 KiB
CSS
/* 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, 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) + 2.5rem) 16px calc(var(--bottom) + 2rem); }
|
|
.pull { position: fixed; top: calc(var(--top) + .4rem); left: 50%; transform: translateX(-50%);
|
|
width: 3rem; height: 1.25rem; padding: 0; border: 0; background: none; cursor: pointer; }
|
|
.pull::before { content: ""; display: block; width: 2.25rem; height: .3rem; margin: auto;
|
|
border-radius: 999px; background: rgb(255 255 255 / .45); }
|
|
|
|
.clock { text-align: center; text-shadow: 0 1px 8px rgb(0 0 0 / .45); margin-bottom: 2rem; }
|
|
.clock .time { font-size: 4rem; font-weight: 200; line-height: 1; letter-spacing: -.02em;
|
|
font-variant-numeric: tabular-nums; }
|
|
.clock .date { margin-top: .5rem; font-size: 1rem; opacity: .9; }
|
|
|
|
.slots, .apps { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem .5rem;
|
|
grid-template-columns: repeat(4, minmax(0, 1fr)); }
|
|
@media (min-width: 480px) { .slots, .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); }
|
|
.icon { width: 3.25rem; height: 3.25rem; 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: .75rem; line-height: 1.2; text-align: center;
|
|
text-shadow: var(--shadow-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
|
|
/* A widget takes a whole row. 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 { grid-column: 1 / -1; 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); }
|
|
|
|
.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; }
|
|
|
|
/* ---- drawer: slides down 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 / .72);
|
|
backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
|
|
animation: drop .22s cubic-bezier(.2, .8, .2, 1); }
|
|
@keyframes drop { from { transform: translateY(-100%); } to { transform: none; } }
|
|
.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); }
|
|
.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; }
|
|
|
|
.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, .sheet { animation: none; } }
|