Initial commit with webpage
This commit is contained in:
commit
26875de1dd
55 files changed
+5726
No files matched your search
@@ -0,0 +1,155 @@
|
||||
// Small progressive enhancements. Every page works without this file.
|
||||
(() => {
|
||||
"use strict";
|
||||
|
||||
// ---- live "2h 05m" counters ------------------------------------------
|
||||
const fmtDuration = (secs) => {
|
||||
const mins = Math.max(0, Math.floor(secs / 60));
|
||||
const d = Math.floor(mins / 1440), h = Math.floor((mins % 1440) / 60), m = mins % 60;
|
||||
if (d) return `${d}d ${h}h`;
|
||||
if (h) return `${h}h ${String(m).padStart(2, "0")}m`;
|
||||
return `${m}m`;
|
||||
};
|
||||
const tick = () => {
|
||||
const now = Date.now() / 1000;
|
||||
document.querySelectorAll("[data-since]").forEach((el) => {
|
||||
el.textContent = fmtDuration(now - Number(el.dataset.since));
|
||||
});
|
||||
document.querySelectorAll("[data-ago]").forEach((el) => {
|
||||
const s = now - Number(el.dataset.ago);
|
||||
el.textContent = s < 60 ? "just now" : `${fmtDuration(s)} ago`;
|
||||
});
|
||||
};
|
||||
tick();
|
||||
setInterval(tick, 30_000);
|
||||
|
||||
// ---- keep the Today page fresh -----------------------------------------
|
||||
// Reload when the parent comes back to the tab, or every N s while open,
|
||||
// unless they're in the middle of typing something.
|
||||
const auto = document.querySelector("[data-autorefresh]");
|
||||
if (auto) {
|
||||
const every = Number(auto.dataset.autorefresh) * 1000;
|
||||
let loaded = Date.now();
|
||||
const busy = () => document.activeElement && /INPUT|SELECT|TEXTAREA/.test(document.activeElement.tagName);
|
||||
const maybeReload = () => {
|
||||
if (document.visibilityState === "visible" && !busy() && Date.now() - loaded > every) {
|
||||
loaded = Date.now();
|
||||
location.reload();
|
||||
}
|
||||
};
|
||||
setInterval(maybeReload, 15_000);
|
||||
document.addEventListener("visibilitychange", maybeReload);
|
||||
}
|
||||
|
||||
// ---- confirm before destructive buttons --------------------------------
|
||||
document.addEventListener("submit", (e) => {
|
||||
const msg = e.target.dataset && e.target.dataset.confirm;
|
||||
if (msg && !window.confirm(msg)) e.preventDefault();
|
||||
});
|
||||
|
||||
// ---- copy buttons ------------------------------------------------------
|
||||
document.querySelectorAll("[data-copy]").forEach((btn) => {
|
||||
btn.addEventListener("click", async () => {
|
||||
const src = document.querySelector(btn.dataset.copy);
|
||||
try {
|
||||
await navigator.clipboard.writeText(src.textContent.trim());
|
||||
btn.textContent = "Copied";
|
||||
} catch {
|
||||
const r = document.createRange();
|
||||
r.selectNodeContents(src);
|
||||
getSelection().removeAllRanges();
|
||||
getSelection().addRange(r);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// ---- show "End" only for start/stop event types ------------------------
|
||||
document.querySelectorAll("[data-kind-form]").forEach((form) => {
|
||||
const select = form.querySelector("select[name=kind]");
|
||||
const end = form.querySelector("[data-end-field]");
|
||||
if (!select || !end) return;
|
||||
const sync = () => {
|
||||
end.hidden = select.selectedOptions[0]?.dataset.duration !== "1";
|
||||
};
|
||||
select.addEventListener("change", sync);
|
||||
sync();
|
||||
});
|
||||
|
||||
// ---- timezone mismatch hint --------------------------------------------
|
||||
const hint = document.getElementById("tz-hint");
|
||||
try {
|
||||
const browserTz = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
||||
if (hint && browserTz && browserTz !== document.body.dataset.tz) {
|
||||
hint.querySelector("[data-browser-tz]").textContent = browserTz;
|
||||
hint.querySelector("input[name=timezone]").value = browserTz;
|
||||
hint.hidden = false;
|
||||
}
|
||||
} catch { /* old browser: no hint */ }
|
||||
const tzSelect = document.querySelector("[data-tz-select]");
|
||||
if (tzSelect && document.body.dataset.tz === "UTC") {
|
||||
const browserTz = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
||||
const opt = [...tzSelect.options].find((o) => o.value === browserTz);
|
||||
if (opt) opt.selected = true;
|
||||
}
|
||||
|
||||
// ---- tooltips ------------------------------------------------------------
|
||||
const tip = document.getElementById("tip");
|
||||
const showTip = (text, x, y) => {
|
||||
const [head, rest] = String(text).split("|");
|
||||
tip.replaceChildren();
|
||||
const strong = document.createElement("strong");
|
||||
strong.textContent = head;
|
||||
tip.append(strong);
|
||||
if (rest) {
|
||||
const span = document.createElement("span");
|
||||
span.textContent = rest;
|
||||
tip.append(span);
|
||||
}
|
||||
tip.hidden = false;
|
||||
const w = tip.offsetWidth, h = tip.offsetHeight;
|
||||
const left = Math.min(Math.max(8, x - w / 2), innerWidth - w - 8);
|
||||
const top = y - h - 14 < 8 ? y + 18 : y - h - 14;
|
||||
tip.style.left = `${left}px`;
|
||||
tip.style.top = `${top}px`;
|
||||
};
|
||||
const hideTip = () => { tip.hidden = true; };
|
||||
let hideTimer;
|
||||
document.addEventListener("pointerover", (e) => {
|
||||
const el = e.target.closest("[data-tip]");
|
||||
if (!el) return;
|
||||
clearTimeout(hideTimer);
|
||||
showTip(el.dataset.tip, e.clientX, e.clientY);
|
||||
if (e.pointerType === "touch") hideTimer = setTimeout(hideTip, 2500);
|
||||
});
|
||||
document.addEventListener("pointermove", (e) => {
|
||||
const el = e.target.closest("[data-tip]");
|
||||
if (el && !tip.hidden && e.pointerType !== "touch") showTip(el.dataset.tip, e.clientX, e.clientY);
|
||||
});
|
||||
document.addEventListener("pointerout", (e) => {
|
||||
if (e.target.closest("[data-tip]") && e.pointerType !== "touch") hideTip();
|
||||
});
|
||||
addEventListener("scroll", hideTip, { passive: true });
|
||||
|
||||
// ---- line chart crosshair ---------------------------------------------------
|
||||
document.querySelectorAll("[data-line]").forEach((chart) => {
|
||||
const plot = chart.querySelector(".line-plot");
|
||||
const data = JSON.parse(plot.querySelector("script[type='application/json']").textContent);
|
||||
const cross = plot.querySelector(".line-cross");
|
||||
const dot = plot.querySelector(".line-dot");
|
||||
if (!data.length) return;
|
||||
const move = (e) => {
|
||||
const r = plot.getBoundingClientRect();
|
||||
const xPct = ((e.clientX - r.left) / r.width) * 100;
|
||||
let best = data[0];
|
||||
for (const p of data) if (Math.abs(p[0] - xPct) < Math.abs(best[0] - xPct)) best = p;
|
||||
cross.style.left = `${best[0]}%`;
|
||||
dot.style.left = `${best[0]}%`;
|
||||
dot.style.top = `${100 - best[1]}%`;
|
||||
cross.hidden = dot.hidden = false;
|
||||
showTip(best[2], r.left + (best[0] / 100) * r.width, r.top + (1 - best[1] / 100) * r.height);
|
||||
};
|
||||
plot.addEventListener("pointermove", move);
|
||||
plot.addEventListener("pointerdown", move);
|
||||
plot.addEventListener("pointerleave", () => { cross.hidden = dot.hidden = true; hideTip(); });
|
||||
});
|
||||
})();
|
||||
@@ -0,0 +1,11 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
|
||||
<rect width="64" height="64" rx="14" fill="#f9f9f7"/>
|
||||
<path d="M32 7c12.4 0 21 12 21 25.8C53 46 43.9 56 32 56S11 46 11 32.8C11 19 19.6 7 32 7Z" fill="#0b0b0b"/>
|
||||
<rect x="21" y="20" width="22" height="17" rx="4" fill="#f9f9f7"/>
|
||||
<circle cx="27.5" cy="27.5" r="1.8" fill="#0b0b0b"/>
|
||||
<circle cx="36.5" cy="27.5" r="1.8" fill="#0b0b0b"/>
|
||||
<path d="M28.5 31.5c2 1.8 5 1.8 7 0" stroke="#0b0b0b" stroke-width="1.6" fill="none" stroke-linecap="round"/>
|
||||
<circle cx="24" cy="46" r="2.6" fill="#eb6834"/>
|
||||
<circle cx="32" cy="47.5" r="2.6" fill="#2a78d6"/>
|
||||
<circle cx="40" cy="46" r="2.6" fill="#1baf7a"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 679 B |
@@ -0,0 +1,453 @@
|
||||
/* Mamadachi dashboard. Mobile first; no framework.
|
||||
Colour roles follow the validated data-viz palette: categories always wear
|
||||
the same series colour (sleep = 1, feeding = 2, diaper = 3, ...). */
|
||||
|
||||
:root {
|
||||
color-scheme: light;
|
||||
--page: #f9f9f7;
|
||||
--surface: #fcfcfb;
|
||||
--raised: #ffffff;
|
||||
--ink: #0b0b0b;
|
||||
--ink-2: #52514e;
|
||||
--muted: #898781;
|
||||
--grid: #e1e0d9;
|
||||
--baseline: #c3c2b7;
|
||||
--border: rgba(11, 11, 11, 0.10);
|
||||
--wash: rgba(11, 11, 11, 0.04);
|
||||
--focus: #2a78d6;
|
||||
|
||||
--series-1: #2a78d6; /* sleep */
|
||||
--series-2: #eb6834; /* feeding */
|
||||
--series-3: #1baf7a; /* diaper */
|
||||
--series-4: #eda100; /* pump */
|
||||
--series-5: #e87ba4; /* health */
|
||||
--series-6: #008300; /* activity */
|
||||
--other: #a3a19b; /* other / folded */
|
||||
|
||||
--good: #0ca30c;
|
||||
--warning: #fab219;
|
||||
--serious: #ec835a;
|
||||
--critical: #d03b3b;
|
||||
--good-ink: #006300;
|
||||
|
||||
--radius: 14px;
|
||||
--gap: 16px;
|
||||
--font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root:not([data-theme="light"]) {
|
||||
color-scheme: dark;
|
||||
--page: #0d0d0d;
|
||||
--surface: #1a1a19;
|
||||
--raised: #222220;
|
||||
--ink: #ffffff;
|
||||
--ink-2: #c3c2b7;
|
||||
--muted: #898781;
|
||||
--grid: #2c2c2a;
|
||||
--baseline: #383835;
|
||||
--border: rgba(255, 255, 255, 0.10);
|
||||
--wash: rgba(255, 255, 255, 0.05);
|
||||
--focus: #3987e5;
|
||||
--series-1: #3987e5;
|
||||
--series-2: #d95926;
|
||||
--series-3: #199e70;
|
||||
--series-4: #c98500;
|
||||
--series-5: #d55181;
|
||||
--series-6: #008300;
|
||||
--other: #6b6a65;
|
||||
--good-ink: #0ca30c;
|
||||
}
|
||||
}
|
||||
:root[data-theme="dark"] {
|
||||
color-scheme: dark;
|
||||
--page: #0d0d0d; --surface: #1a1a19; --raised: #222220; --ink: #ffffff; --ink-2: #c3c2b7;
|
||||
--muted: #898781; --grid: #2c2c2a; --baseline: #383835; --border: rgba(255, 255, 255, 0.10);
|
||||
--wash: rgba(255, 255, 255, 0.05); --focus: #3987e5; --series-1: #3987e5; --series-2: #d95926;
|
||||
--series-3: #199e70; --series-4: #c98500; --series-5: #d55181; --series-6: #008300; --other: #6b6a65;
|
||||
--good-ink: #0ca30c;
|
||||
}
|
||||
|
||||
.cat-sleep { --c: var(--series-1); }
|
||||
.cat-feeding { --c: var(--series-2); }
|
||||
.cat-diaper { --c: var(--series-3); }
|
||||
.cat-pump { --c: var(--series-4); }
|
||||
.cat-health { --c: var(--series-5); }
|
||||
.cat-activity { --c: var(--series-6); }
|
||||
.cat-other { --c: var(--other); }
|
||||
|
||||
/* ------------------------------------------------------------ base */
|
||||
|
||||
*, *::before, *::after { box-sizing: border-box; }
|
||||
html { -webkit-text-size-adjust: 100%; }
|
||||
body {
|
||||
margin: 0;
|
||||
background: var(--page);
|
||||
color: var(--ink);
|
||||
font: 16px/1.45 var(--font);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
h1, h2, h3 { margin: 0 0 8px; line-height: 1.2; font-weight: 650; }
|
||||
h1 { font-size: 1.5rem; }
|
||||
h2 { font-size: 1.1rem; }
|
||||
h3 { font-size: 0.95rem; }
|
||||
p { margin: 0 0 8px; }
|
||||
a { color: inherit; text-decoration-color: var(--baseline); text-underline-offset: 3px; }
|
||||
a:hover { text-decoration-color: currentColor; }
|
||||
code, pre { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 0.85em; }
|
||||
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
|
||||
[hidden] { display: none !important; }
|
||||
|
||||
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }
|
||||
.muted { color: var(--ink-2); }
|
||||
.small { font-size: 0.85rem; }
|
||||
.emoji { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
|
||||
.empty { padding: 8px 0; }
|
||||
ul.plain { list-style: none; margin: 0; padding: 0; }
|
||||
.links li { padding: 6px 0; }
|
||||
|
||||
/* ------------------------------------------------------------ header */
|
||||
|
||||
.top {
|
||||
position: sticky; top: 0; z-index: 10;
|
||||
background: color-mix(in srgb, var(--page) 88%, transparent);
|
||||
backdrop-filter: saturate(1.4) blur(10px);
|
||||
-webkit-backdrop-filter: saturate(1.4) blur(10px);
|
||||
border-bottom: 1px solid var(--border);
|
||||
padding-top: env(safe-area-inset-top);
|
||||
}
|
||||
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; padding-bottom: 6px; }
|
||||
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 700; letter-spacing: -0.01em; }
|
||||
.logo { width: 26px; height: 26px; color: var(--ink); }
|
||||
.baby { font-size: 0.95rem; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
||||
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-bottom: 8px; }
|
||||
.tabs::-webkit-scrollbar { display: none; }
|
||||
.tabs a {
|
||||
flex: none; padding: 6px 12px; border-radius: 999px; text-decoration: none;
|
||||
color: var(--ink-2); font-weight: 550; font-size: 0.95rem;
|
||||
}
|
||||
.tabs a:hover { background: var(--wash); color: var(--ink); }
|
||||
.tabs a[aria-current="page"] { background: var(--ink); color: var(--page); }
|
||||
|
||||
main.wrap { padding-top: 16px; padding-bottom: 24px; display: flex; flex-direction: column; gap: var(--gap); }
|
||||
main.wrap > div[data-autorefresh] { display: flex; flex-direction: column; gap: var(--gap); }
|
||||
.foot { display: flex; gap: 16px; align-items: center; padding-bottom: 32px; font-size: 0.85rem; }
|
||||
.foot form { margin: 0; }
|
||||
|
||||
/* ------------------------------------------------------------ cards & tiles */
|
||||
|
||||
.card {
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius);
|
||||
padding: 16px;
|
||||
min-width: 0;
|
||||
}
|
||||
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
|
||||
.card-head h2 { margin: 0; }
|
||||
.eyebrow { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 2px; }
|
||||
|
||||
.hero { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px; }
|
||||
.hero-num { font-size: clamp(3rem, 12vw, 4.25rem); font-weight: 650; line-height: 1; letter-spacing: -0.03em; margin: 4px 0 10px; }
|
||||
.hero .muted { margin: 0; }
|
||||
.next-side {
|
||||
flex: none; text-align: center; padding: 12px 16px; border-radius: 12px;
|
||||
background: var(--wash); min-width: 96px;
|
||||
}
|
||||
.next-side strong { display: block; font-size: 1.6rem; font-weight: 650; }
|
||||
|
||||
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
|
||||
@media (min-width: 760px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
|
||||
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; min-width: 0; }
|
||||
.tile-label { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; color: var(--ink-2); margin-bottom: 4px; }
|
||||
.tile-value { font-size: 1.6rem; font-weight: 650; line-height: 1.15; margin: 0 0 4px; }
|
||||
.tile-value small { font-size: 0.85rem; font-weight: 500; color: var(--ink-2); }
|
||||
.tile-sub { font-size: 0.8rem; color: var(--ink-2); margin: 0; }
|
||||
|
||||
.dot { flex: none; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--other)); }
|
||||
.key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c); margin-right: 8px; vertical-align: 0; }
|
||||
|
||||
.running ul li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 0; flex-wrap: wrap; }
|
||||
.running form { margin: 0; }
|
||||
|
||||
/* ------------------------------------------------------------ alerts & flashes */
|
||||
|
||||
.alert, .flash {
|
||||
display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px;
|
||||
border-radius: 12px; border: 1px solid var(--border); background: var(--surface); font-size: 0.95rem;
|
||||
}
|
||||
.flash { align-items: center; justify-content: space-between; background: var(--raised); }
|
||||
.flash form { margin: 0; flex: none; }
|
||||
.flash-error { border-color: var(--critical); }
|
||||
.alert-icon {
|
||||
flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
|
||||
font-size: 0.75rem; font-weight: 800; color: #0b0b0b;
|
||||
}
|
||||
.alert-info .alert-icon { background: var(--grid); color: var(--ink); }
|
||||
.alert-warning { border-left: 4px solid var(--warning); }
|
||||
.alert-warning .alert-icon { background: var(--warning); }
|
||||
.alert-serious { border-left: 4px solid var(--critical); }
|
||||
.alert-serious .alert-icon { background: var(--critical); color: #fff; }
|
||||
.alert-label { font-weight: 650; }
|
||||
|
||||
/* ------------------------------------------------------------ buttons & forms */
|
||||
|
||||
.btn {
|
||||
display: inline-flex; align-items: center; justify-content: center; gap: 6px;
|
||||
font: inherit; font-weight: 600; font-size: 0.95rem;
|
||||
padding: 9px 16px; border-radius: 10px; border: 1px solid transparent;
|
||||
background: var(--ink); color: var(--page); cursor: pointer; text-decoration: none;
|
||||
min-height: 40px;
|
||||
}
|
||||
.btn:hover { opacity: 0.88; }
|
||||
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--baseline); }
|
||||
.btn-ghost:hover { background: var(--wash); opacity: 1; }
|
||||
.btn-danger { background: transparent; color: var(--critical); border-color: var(--critical); }
|
||||
.btn-small { padding: 5px 12px; min-height: 32px; font-size: 0.875rem; }
|
||||
.btn-wide { width: 100%; }
|
||||
.link-btn { font: inherit; font-weight: 600; background: none; border: 0; padding: 4px 6px; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
|
||||
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
|
||||
.actions form { margin: 0; }
|
||||
|
||||
label { display: flex; flex-direction: column; gap: 4px; font-size: 0.875rem; font-weight: 550; min-width: 0; }
|
||||
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
|
||||
input[type="text"], input[type="password"], input[type="number"], input[type="date"],
|
||||
input[type="datetime-local"], select {
|
||||
font: inherit; font-weight: 400; font-size: 1rem; /* 16px stops iOS zooming in */
|
||||
width: 100%; min-width: 0; padding: 8px 10px; min-height: 40px;
|
||||
border-radius: 10px; border: 1px solid var(--baseline); background: var(--raised); color: var(--ink);
|
||||
}
|
||||
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--ink); }
|
||||
.form-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 8px; align-items: end; }
|
||||
@media (min-width: 640px) {
|
||||
.form-grid { grid-template-columns: 1fr 1fr; }
|
||||
.form-grid .span-2 { grid-column: span 2; }
|
||||
}
|
||||
.form-error { color: var(--critical); font-weight: 600; }
|
||||
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; margin: 0; }
|
||||
.inline-form input { flex: 1 1 180px; width: auto; }
|
||||
|
||||
details > summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
|
||||
details > summary::-webkit-details-marker { display: none; }
|
||||
details > summary h2, details > summary h3 { margin: 0; }
|
||||
details > summary::before { content: "▸"; color: var(--muted); font-size: 0.8em; transition: transform 0.15s; }
|
||||
details[open] > summary::before { transform: rotate(90deg); }
|
||||
details[open] > summary { margin-bottom: 12px; }
|
||||
|
||||
/* ------------------------------------------------------------ quick log */
|
||||
|
||||
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
|
||||
.quick form { margin: 0; }
|
||||
.quick-btn {
|
||||
width: 100%; display: flex; align-items: center; gap: 8px; text-align: left;
|
||||
font: inherit; font-weight: 550; font-size: 0.95rem; color: var(--ink);
|
||||
padding: 10px 12px; min-height: 48px; border-radius: 12px; cursor: pointer;
|
||||
background: var(--raised); border: 1px solid var(--border);
|
||||
box-shadow: inset 3px 0 0 var(--c);
|
||||
}
|
||||
.quick-btn:hover { background: var(--wash); }
|
||||
.quick-btn:active { transform: scale(0.98); }
|
||||
.quick-btn .emoji { font-size: 1.25rem; }
|
||||
.quick-btn.is-open { border-color: var(--c); box-shadow: inset 0 0 0 1px var(--c), inset 3px 0 0 var(--c); }
|
||||
|
||||
/* ------------------------------------------------------------ event list */
|
||||
|
||||
.events { list-style: none; margin: 0; padding: 0; }
|
||||
.events.card { padding: 4px 16px; }
|
||||
.ev {
|
||||
display: grid; grid-template-columns: 4.6rem auto 1fr auto auto; align-items: baseline;
|
||||
column-gap: 10px; padding: 10px 0; border-top: 1px solid var(--grid);
|
||||
}
|
||||
.ev:first-child { border-top: 0; }
|
||||
.ev time { font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 0.9rem; white-space: nowrap; }
|
||||
.ev time .muted { display: block; font-size: 0.75rem; }
|
||||
.ev .dot { align-self: center; }
|
||||
.ev-main { display: flex; flex-direction: column; min-width: 0; }
|
||||
.ev-title { font-weight: 550; }
|
||||
.ev-main .muted { font-size: 0.875rem; }
|
||||
.note { font-size: 0.875rem; color: var(--ink-2); font-style: italic; overflow-wrap: anywhere; }
|
||||
.ev-src { font-size: 0.75rem; white-space: nowrap; }
|
||||
.ev-edit { font-size: 0.85rem; color: var(--ink-2); padding: 4px 0 4px 4px; }
|
||||
.badge { display: inline-block; font-size: 0.8rem; font-weight: 600; padding: 1px 8px; border-radius: 999px; width: fit-content; margin-top: 2px; }
|
||||
.badge-live { background: color-mix(in srgb, var(--series-1) 16%, transparent); color: var(--ink); }
|
||||
|
||||
.day { display: flex; flex-direction: column; gap: 8px; }
|
||||
.day-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; padding: 0 4px; }
|
||||
.day-head h2 { margin: 0; }
|
||||
.day-head p { margin: 0; }
|
||||
|
||||
.chips, .segmented { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
|
||||
.chips::-webkit-scrollbar, .segmented::-webkit-scrollbar { display: none; }
|
||||
.chips a, .segmented a {
|
||||
flex: none; display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
|
||||
padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
|
||||
font-size: 0.9rem; font-weight: 550; color: var(--ink-2);
|
||||
}
|
||||
.chips a[aria-current], .segmented a[aria-current] { background: var(--ink); color: var(--page); border-color: var(--ink); }
|
||||
.pager { display: flex; justify-content: space-between; }
|
||||
|
||||
.pill { display: inline-block; font-size: 0.8rem; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--wash); margin: 2px 0; }
|
||||
.pill-ok { background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good-ink); }
|
||||
.pill-off { background: var(--wash); color: var(--ink-2); }
|
||||
|
||||
/* ------------------------------------------------------------ legend */
|
||||
|
||||
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.8rem; color: var(--ink-2); }
|
||||
.legend li { display: inline-flex; align-items: center; gap: 6px; }
|
||||
.lg { display: inline-block; flex: none; }
|
||||
.lg-bar { width: 16px; height: 8px; border-radius: 3px; background: var(--c); }
|
||||
.lg-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
|
||||
.lg-ring { width: 9px; height: 9px; border-radius: 2px; transform: rotate(45deg); border: 2px solid var(--c); }
|
||||
.lg-diamond { width: 9px; height: 9px; border-radius: 2px; transform: rotate(45deg); background: var(--c); }
|
||||
.lg-tick { width: 3px; height: 11px; border-radius: 2px; background: var(--c); }
|
||||
|
||||
/* ------------------------------------------------------------ rhythm chart */
|
||||
|
||||
.rhythm { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
|
||||
.rh-row { display: grid; grid-template-columns: 3.2rem 1fr; align-items: center; gap: 8px; }
|
||||
.rhythm.compact .rh-row { grid-template-columns: 0 1fr; gap: 0; }
|
||||
.rh-label { font-size: 0.75rem; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
|
||||
.rh-ticks { position: relative; height: 16px; }
|
||||
.rh-ticks span { position: absolute; transform: translateX(-50%); font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
|
||||
.rh-ticks span:first-child { transform: none; }
|
||||
.rh-track {
|
||||
position: relative; height: 22px;
|
||||
background-image: linear-gradient(to right, var(--grid) 1px, transparent 1px);
|
||||
background-size: 25% 100%;
|
||||
border-right: 1px solid var(--grid);
|
||||
}
|
||||
.rhythm.compact .rh-track { height: 30px; }
|
||||
.rh-track::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--grid); }
|
||||
.m { position: absolute; top: 50%; z-index: 1; cursor: default; }
|
||||
.m-bar {
|
||||
height: 10px; transform: translateY(-50%); border-radius: 4px; background: var(--c);
|
||||
box-shadow: 0 0 0 1px var(--surface); min-width: 3px;
|
||||
}
|
||||
.rhythm.compact .m-bar { height: 14px; }
|
||||
.m-bar.m-open { background: repeating-linear-gradient(135deg, var(--c) 0 6px, color-mix(in srgb, var(--c) 55%, var(--surface)) 6px 9px); }
|
||||
.m-dot, .m-ring, .m-diamond { width: 10px; height: 10px; margin-left: -5px; margin-top: -5px; z-index: 2; }
|
||||
.m-dot { border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px var(--surface); }
|
||||
.m-diamond { border-radius: 2px; transform: rotate(45deg); background: var(--c); box-shadow: 0 0 0 2px var(--surface); }
|
||||
.m-ring { border-radius: 2px; transform: rotate(45deg); background: var(--surface); border: 2px solid var(--c); box-shadow: 0 0 0 1px var(--surface); }
|
||||
.m-tick { width: 3px; height: 12px; margin-left: -1.5px; margin-top: -6px; border-radius: 2px; background: var(--c); }
|
||||
.m::before { content: ""; position: absolute; inset: -7px; } /* bigger hit area than the mark */
|
||||
.m:hover { filter: brightness(1.12); z-index: 3; }
|
||||
.m-now { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--ink); border-radius: 1px; z-index: 4; }
|
||||
|
||||
/* ------------------------------------------------------------ column charts */
|
||||
|
||||
.chart-grid { display: grid; grid-template-columns: 1fr; gap: var(--gap); }
|
||||
@media (min-width: 760px) { .chart-grid { grid-template-columns: 1fr 1fr; } }
|
||||
.chart { margin: 0; }
|
||||
.chart figcaption h3 { display: flex; align-items: center; margin-bottom: 2px; }
|
||||
.chart figcaption p { font-size: 0.85rem; margin-bottom: 12px; }
|
||||
.cols { --label-w: 2rem; }
|
||||
.cols-plot { position: relative; height: 140px; margin: 8px 0 0 var(--label-w); border-bottom: 1px solid var(--baseline); }
|
||||
.gridline { position: absolute; left: 0; right: 0; border-top: 1px solid var(--grid); height: 0; }
|
||||
.gridline em {
|
||||
position: absolute; right: 100%; transform: translateY(-50%); padding-right: 6px;
|
||||
font-style: normal; font-size: 0.72rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap;
|
||||
}
|
||||
.cols-bars { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 2px; }
|
||||
.col { flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; position: relative; }
|
||||
.col:hover { background: var(--wash); border-radius: 4px 4px 0 0; }
|
||||
.col-bar { position: relative; width: min(24px, 70%); background: var(--c); border-radius: 4px 4px 0 0; min-height: 0; }
|
||||
.col-bar.is-zero { height: 0 !important; }
|
||||
.col-bar.is-partial { opacity: 0.55; }
|
||||
.col-bar b {
|
||||
position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); padding-bottom: 3px;
|
||||
font-size: 0.75rem; font-weight: 650; color: var(--ink); white-space: nowrap;
|
||||
}
|
||||
.cols-x { display: flex; gap: 2px; margin-left: var(--label-w); padding-top: 4px; }
|
||||
.cols-x span { flex: 1; text-align: center; font-size: 0.7rem; color: var(--muted); white-space: nowrap; overflow: visible; min-width: 0; }
|
||||
|
||||
/* ------------------------------------------------------------ line chart (battery) */
|
||||
|
||||
.line { --label-w: 3rem; margin: 8px 0 12px; }
|
||||
.line-plot { position: relative; height: 160px; margin-left: var(--label-w); border-bottom: 1px solid var(--baseline); touch-action: pan-y; }
|
||||
.line-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
|
||||
.line-path { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
|
||||
.line-area { fill: var(--series-1); opacity: 0.1; stroke: none; }
|
||||
.line-cross { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--baseline); pointer-events: none; }
|
||||
.line-dot { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--series-1); box-shadow: 0 0 0 2px var(--surface); pointer-events: none; }
|
||||
.line-x { position: relative; height: 18px; margin-left: var(--label-w); }
|
||||
.line-x span { position: absolute; transform: translateX(-50%); font-size: 0.72rem; color: var(--muted); white-space: nowrap; top: 4px; }
|
||||
.line-x span:first-child { transform: none; }
|
||||
|
||||
/* ------------------------------------------------------------ tooltip */
|
||||
|
||||
.tip {
|
||||
position: fixed; z-index: 50; pointer-events: none; max-width: 260px;
|
||||
background: var(--raised); color: var(--ink); border: 1px solid var(--border);
|
||||
border-radius: 10px; padding: 6px 10px; font-size: 0.85rem; line-height: 1.35;
|
||||
box-shadow: 0 6px 24px rgba(0, 0, 0, 0.16);
|
||||
}
|
||||
.tip strong { display: block; font-weight: 650; }
|
||||
.tip span { color: var(--ink-2); }
|
||||
|
||||
/* ------------------------------------------------------------ device & tables */
|
||||
|
||||
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; margin: 4px 0 16px; }
|
||||
@media (min-width: 760px) { .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
|
||||
.facts dt { font-size: 0.8rem; color: var(--ink-2); }
|
||||
.facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
|
||||
.facts dd .muted { font-weight: 400; font-size: 0.85rem; }
|
||||
.device.is-revoked { opacity: 0.7; }
|
||||
.device h3 { margin-top: 4px; }
|
||||
.device details { margin: 12px 0; }
|
||||
.token-card { border: 2px solid var(--ink); }
|
||||
.copy-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
|
||||
.copy-row code { font-size: 0.95rem; padding: 8px 10px; background: var(--wash); border-radius: 8px; overflow-wrap: anywhere; }
|
||||
pre.code { background: var(--wash); border-radius: 10px; padding: 12px; overflow-x: auto; margin: 0 0 12px; white-space: pre; }
|
||||
.steps { padding-left: 20px; }
|
||||
.steps li { margin-bottom: 6px; }
|
||||
|
||||
.table-scroll { overflow-x: auto; }
|
||||
.num-table { border-collapse: collapse; width: 100%; font-size: 0.875rem; }
|
||||
.num-table th, .num-table td { padding: 6px 10px; text-align: right; border-bottom: 1px solid var(--grid); white-space: nowrap; font-variant-numeric: tabular-nums; }
|
||||
.num-table th:first-child { text-align: left; font-weight: 550; }
|
||||
.num-table thead th { color: var(--ink-2); font-weight: 600; font-size: 0.8rem; }
|
||||
|
||||
/* ------------------------------------------------------------ settings */
|
||||
|
||||
.button-grid { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 8px 0 16px; }
|
||||
@media (min-width: 560px) { .button-grid { grid-template-columns: 1fr 1fr; grid-auto-flow: column; grid-template-rows: repeat(4, auto); } }
|
||||
.button-slot { flex-direction: row; align-items: center; gap: 10px; }
|
||||
.button-num {
|
||||
flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
|
||||
background: var(--ink); color: var(--page); font-weight: 700; font-size: 0.9rem;
|
||||
}
|
||||
.kinds { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 16px; }
|
||||
.kind-row {
|
||||
display: grid; grid-template-columns: 4rem 1fr 1fr; gap: 8px 10px; align-items: end;
|
||||
border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px 12px; margin: 0;
|
||||
}
|
||||
.kind-row legend { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--ink-2); padding: 0 4px; }
|
||||
.kind-row.is-hidden { opacity: 0.6; }
|
||||
.k-mode { grid-column: span 2; }
|
||||
@media (min-width: 760px) {
|
||||
.kind-row { grid-template-columns: 4rem 1.4fr 1fr 1.2fr 0.8fr auto; }
|
||||
.k-mode { grid-column: auto; }
|
||||
}
|
||||
.k-emoji input { text-align: center; }
|
||||
.k-active { padding-bottom: 10px; }
|
||||
.add-kind { margin-top: 8px; }
|
||||
|
||||
.login { max-width: 420px; width: 100%; margin: 40px auto; }
|
||||
.login form { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
|
||||
|
||||
.device-chip { text-align: center; font-size: 0.85rem; margin: 0; }
|
||||
|
||||
@media (max-width: 420px) {
|
||||
.ev { grid-template-columns: 4.1rem auto 1fr auto; }
|
||||
.ev-src { display: none; }
|
||||
.hero { padding: 16px; }
|
||||
.next-side { min-width: 80px; padding: 10px 12px; }
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
* { transition: none !important; }
|
||||
}
|
||||
@media (forced-colors: active) {
|
||||
.m, .dot, .key, .col-bar, .lg { forced-color-adjust: none; }
|
||||
}
|
||||
Reference in new issue
Block a user