Homepage (TDD slice 4): the pages, theme, and toggle
Red tests first, then the pages. - tests/homepage_pages.bats: the pages reference the data + theme; no auto-refresh (Q41); no cursor alteration (Q28); the styling toggle strips to bare HTML (Q27); the footer shows the last master deployment datetime (Q43). - index.html / admin.html: the user and admin pages. A grid of TUI panels, a summary line, the bare toggle, the deployed-at footer. - app.js: reads status.json + services.json once (no auto-refresh), renders one panel per service for the page's category, the toggle, the footer. - style.css: the terminal TUI theme (green-on-black, phosphor palette, scanlines) + a ?bare=1 mode that strips to unstyled HTML. No custom cursor. Functionally verified with a Node DOM shim: 9 user panels, correct summary, correct footer datetime.
This commit is contained in:
1 parent
ce55d1dc3a
commit
01c42202b8
5 files changed
+220
-132
No files matched your search
+68
-46
@@ -1,63 +1,85 @@
|
||||
/* The homepage theme: terminal TUI, green-on-black, 1995 phosphor palette.
|
||||
A ?bare=1 toggle strips the page to bare, unstyled HTML (Q27). The page
|
||||
never sets a custom or hidden cursor, so the user's cursor is untouched (Q28). */
|
||||
|
||||
:root {
|
||||
--bg: #0f1115;
|
||||
--card: #171a21;
|
||||
--border: #2a2f3a;
|
||||
--text: #e6e8eb;
|
||||
--muted: #8b93a1;
|
||||
--up: #3fb950;
|
||||
--down: #f85149;
|
||||
--accent: #58a6ff;
|
||||
--bg: #050805;
|
||||
--fg: #33ff66;
|
||||
--dim: #2f8f52;
|
||||
--down: #ff5555;
|
||||
--wip: #ffcc33;
|
||||
--link: #33ccff;
|
||||
--head: #aaffcc;
|
||||
--border: #1a4d2e;
|
||||
--panel: #0a120a;
|
||||
}
|
||||
|
||||
* { box-sizing: border-box; margin: 0; padding: 0; }
|
||||
* { box-sizing: border-box; }
|
||||
|
||||
html { background: var(--bg); }
|
||||
|
||||
body {
|
||||
background: var(--bg);
|
||||
color: var(--text);
|
||||
font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
|
||||
line-height: 1.5;
|
||||
min-height: 100vh;
|
||||
color: var(--fg);
|
||||
font-family: "Terminus", "Fira Code", "DejaVu Sans Mono", "Consolas", monospace;
|
||||
font-size: 15px;
|
||||
line-height: 1.55;
|
||||
margin: 0;
|
||||
padding: 24px;
|
||||
text-shadow: 0 0 4px rgba(51, 255, 102, 0.30);
|
||||
}
|
||||
|
||||
main { max-width: 960px; margin: 0 auto; padding: 2rem 1.5rem; }
|
||||
/* Subtle scanlines. */
|
||||
body::before {
|
||||
content: "";
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
pointer-events: none;
|
||||
z-index: 9999;
|
||||
background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0) 0 2px, rgba(0, 0, 0, 0.14) 2px 4px);
|
||||
}
|
||||
|
||||
header { margin-bottom: 2rem; }
|
||||
h1 { font-size: 2rem; font-weight: 650; letter-spacing: -0.02em; }
|
||||
.subtitle { color: var(--muted); margin-top: 0.25rem; }
|
||||
.top {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: baseline;
|
||||
border-bottom: 1px solid var(--border);
|
||||
padding-bottom: 8px;
|
||||
}
|
||||
.title { color: var(--head); }
|
||||
.toggle { color: var(--link); text-decoration: none; border: 1px solid var(--border); padding: 0 8px; }
|
||||
|
||||
.summary { color: var(--dim); margin: 12px 0; letter-spacing: 0.05em; }
|
||||
|
||||
.grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
|
||||
gap: 1rem;
|
||||
grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.card {
|
||||
background: var(--card);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 10px;
|
||||
padding: 1rem 1.1rem;
|
||||
.panel { border: 1px solid var(--border); background: var(--panel); padding: 12px 14px; border-radius: 2px; }
|
||||
.panel-head { display: flex; justify-content: space-between; align-items: center; }
|
||||
.name { color: var(--head); }
|
||||
.badge { border: 1px solid currentColor; padding: 0 6px; border-radius: 2px; font-size: 12px; }
|
||||
.badge.up { color: var(--fg); }
|
||||
.badge.down { color: var(--down); }
|
||||
.badge.wip { color: var(--wip); }
|
||||
.desc { color: var(--fg); margin: 8px 0; }
|
||||
.links a { color: var(--link); text-decoration: underline; margin-right: 12px; }
|
||||
|
||||
.foot {
|
||||
margin-top: 24px;
|
||||
border-top: 1px solid var(--border);
|
||||
padding-top: 12px;
|
||||
color: var(--dim);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.4rem;
|
||||
transition: border-color 0.15s ease;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.foot a { color: var(--link); text-decoration: none; }
|
||||
|
||||
.card:hover { border-color: var(--accent); }
|
||||
|
||||
.card .top { display: flex; align-items: center; gap: 0.6rem; }
|
||||
.card h2 { font-size: 1.05rem; font-weight: 600; }
|
||||
|
||||
.badge {
|
||||
width: 10px; height: 10px; border-radius: 50%;
|
||||
background: var(--muted); flex-shrink: 0;
|
||||
}
|
||||
.badge.up { background: var(--up); box-shadow: 0 0 6px var(--up); }
|
||||
.badge.down { background: var(--down); box-shadow: 0 0 6px var(--down); }
|
||||
.badge.checking { background: var(--accent); }
|
||||
|
||||
.card p { color: var(--muted); font-size: 0.9rem; }
|
||||
.card .links { margin-top: auto; display: flex; gap: 1rem; font-size: 0.85rem; }
|
||||
.card a { color: var(--accent); text-decoration: none; }
|
||||
.card a:hover { text-decoration: underline; }
|
||||
|
||||
footer { margin-top: 2.5rem; color: var(--muted); font-size: 0.8rem; }
|
||||
/* Bare mode (Q27): strip to default browser rendering. */
|
||||
html[data-bare="1"] body { background: #fff; color: #000; font-family: serif; text-shadow: none; font-size: 16px; }
|
||||
html[data-bare="1"] body::before { display: none; }
|
||||
html[data-bare="1"] .panel, html[data-bare="1"] .top, html[data-bare="1"] .foot { border-color: #000; background: none; }
|
||||
html[data-bare="1"] .badge, html[data-bare="1"] .name, html[data-bare="1"] .desc, html[data-bare="1"] .summary { color: #000; }
|
||||
html[data-bare="1"] .links a, html[data-bare="1"] .toggle, html[data-bare="1"] .foot a { color: #000; }
|
||||
Reference in new issue
Block a user