Files
hyprcrd/relay/ui/style.css
T
thandClaude Opus 4.6 a67bedc6f2 relay: burger menu for mobile, admin reachable, badge matches header buttons
The relay's nav row used to flatten on mobile by hiding admin / user
identity / compose buttons outright, leaving only "account" + "logout".
Admin was completely unreachable from a phone. Replaces that with a
proper burger menu and exposes every nav target.

* layout.php: new <button id="nav-burger"> with a ph-list icon between
  the spacer and #nav-buttons. Inline `style="display:flex"` removed
  from #nav-buttons — display is now CSS-driven, so the burger
  popover and the desktop row don't fight each other.
* app.js showView(): the mobile-block on `name === 'admin'` is gone.
  Burger button visibility is now mirrored against the same
  setup/login/change-password gating that hides #nav-buttons. Picking
  any view also clears `.menu-open` so the popover collapses behind
  the freshly-shown view.
* app.js toggleNavMenu(): exposed on window for the inline onclick.
  Document-level click outside closes the menu.
* style.css: default `#nav-buttons:not(.hidden)` becomes flex (same
  semantics as the old inline). #nav-burger is `display:none` on
  desktop, `inline-flex` on mobile. Mobile media query drops the old
  display:none rules for #nav-admin / #view-admin / #nav-compose,
  keeps #nav-user hidden (redundant with the menu), and adds a
  `.menu-open` rule that turns #nav-buttons into a popover anchored
  to the header (position:absolute, right:12px, surface bg, border,
  shadow, z-index 50). Buttons inside the popover go full-width
  left-aligned. header { position:relative } so the absolute
  positioning has an anchor.
* style.css: also #view-admin .section gets a simple display:block
  override on mobile so the desktop grid-area layout doesn't break
  the page when admin is opened from a phone.

header .user .badge sizing (carried over from the previous turn): the
admin badge in the relay header now matches the .nav-btn box-model
exactly (5px 10px padding, 9px font, 1px border, 3px radius, line-
height:1, pixel font), so it sits flush with the nav buttons instead
of being a tiny pill in the middle of the row.

chore: bump version to 0.9.8

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 23:40:26 +02:00

455 lines
15 KiB
CSS

@font-face { font-family:'Silkscreen'; font-weight:400; src:url('../fonts/silkscreen-400.ttf') format('truetype'); }
@font-face { font-family:'Silkscreen'; font-weight:700; src:url('../fonts/silkscreen-700.ttf') format('truetype'); }
@font-face { font-family:'JetBrains Mono'; font-weight:400; src:url('../fonts/jetbrains-mono-400.ttf') format('truetype'); }
:root {
--bg:#1e293b; --surface:#273349; --raised:#2e3d56; --border:#384a64;
--dim:#64748b; --muted:#94a3b8; --text:#cbd5e1; --bright:#f1f5f9;
--accent:#38bdf8; --accent2:#818cf8; --danger:#fb7185;
--pixel:'Silkscreen', cursive;
}
* { margin:0; padding:0; box-sizing:border-box; }
body {
font-family:'JetBrains Mono', monospace;
background:var(--bg); color:var(--text);
min-height:100dvh; display:flex; flex-direction:column;
}
.pixel { font-family:var(--pixel); }
.hidden { display:none !important; }
.shrink { flex-shrink:0; }
/* ── Header ── */
header {
padding:12px 20px; border-bottom:1px solid var(--border);
display:flex; align-items:center; gap:12px; flex-shrink:0;
background:var(--surface);
}
header h1 { font-family:var(--pixel); font-size:14px; color:var(--accent); }
header .dot {
width:8px; height:8px; border-radius:50%;
background:var(--accent); animation:pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }
header .spacer { flex:1; }
header .user {
font-family:var(--pixel); font-size:10px; color:var(--muted);
display:flex; align-items:center; gap:6px;
}
header .user .badge {
background:var(--accent); color:var(--bg);
/* Match the .nav-btn box-model exactly so the badge sits flush with
the header buttons instead of being a tiny pill in the middle. */
padding:5px 10px; font-size:9px;
border:1px solid var(--accent); border-radius:3px;
line-height:1; font-family:var(--pixel);
}
header .nav-btn {
background:none; border:1px solid var(--border); color:var(--muted);
cursor:pointer; padding:5px 10px;
font-family:var(--pixel); font-size:9px; border-radius:3px;
transition:all .15s;
}
header .nav-btn:hover { color:var(--accent); border-color:var(--accent); }
header .nav-btn.active { background:var(--accent); color:var(--bg); border-color:var(--accent); }
header .nav-btn.danger:hover { color:var(--danger); border-color:var(--danger); }
/* ── Layouts ── */
main {
flex:1; display:flex; flex-direction:column;
padding:20px; gap:16px; max-width:920px; width:100%;
margin:0 auto;
}
@media (max-width: 600px) { main { padding:12px; gap:12px; } }
.auth-form {
display:flex; flex-direction:column; align-items:center;
padding:48px 24px; gap:14px; max-width:380px; margin:0 auto;
}
.auth-form h2 { font-family:var(--pixel); font-size:13px; color:var(--accent); margin-bottom:4px; }
.auth-form p { font-size:11px; color:var(--muted); text-align:center; line-height:1.5; }
.auth-form .field { width:100%; }
.auth-form .field label {
font-family:var(--pixel); font-size:9px; color:var(--dim);
text-transform:uppercase; display:block; margin-bottom:4px;
}
.auth-form input {
width:100%; background:var(--surface); border:1px solid var(--border);
color:var(--bright); padding:9px 12px; font-size:13px;
font-family:'JetBrains Mono', monospace; border-radius:3px;
}
.auth-form input:focus { border-color:var(--accent); outline:none; }
.auth-form .btn { width:100%; }
.auth-form .err {
font-family:var(--pixel); font-size:9px; color:var(--danger);
min-height:11px; text-align:center;
}
/* ── Buttons ── */
.btn {
padding:10px 18px; border:none; border-radius:3px;
font-family:var(--pixel); font-size:11px; cursor:pointer;
transition:all .15s;
}
.btn:active { opacity:.7; }
.btn-primary { background:var(--accent); color:var(--bg); }
.btn-primary:hover { filter:brightness(1.1); }
.btn-secondary { background:transparent; border:1px solid var(--border); color:var(--muted); }
.btn-secondary:hover { color:var(--accent); border-color:var(--accent); }
.btn-danger { background:transparent; border:1px solid var(--danger); color:var(--danger); }
.btn-danger:hover { background:var(--danger); color:var(--bg); }
/* ── Compose view ── */
#view-compose:not(.hidden) {
display: flex;
flex-direction: column;
gap: 16px;
}
.compose-card {
background:var(--surface); border:1px solid var(--border);
border-radius:4px; padding:16px;
display:flex; flex-direction:column; gap:10px;
}
.compose-card h2 {
font-family:var(--pixel); font-size:11px; color:var(--accent);
text-transform:uppercase;
}
.compose-card .field { display:flex; flex-direction:column; gap:4px; }
.compose-card .field label {
font-family:var(--pixel); font-size:9px; color:var(--dim);
text-transform:uppercase;
}
.compose-card input, .compose-card select, .compose-card textarea {
background:var(--bg); border:1px solid var(--border); color:var(--bright);
padding:8px 10px; font-size:13px;
font-family:'JetBrains Mono', monospace; border-radius:3px;
}
.compose-card input:focus, .compose-card select:focus, .compose-card textarea:focus {
border-color:var(--accent); outline:none;
}
.compose-card textarea { min-height:140px; resize:vertical; line-height:1.55; }
.compose-card .actions { display:flex; gap:8px; align-items:center; }
.compose-card .actions .spacer { flex:1; }
.compose-card .status { font-family:var(--pixel); font-size:9px; color:var(--dim); }
.compose-card .status.ok { color:var(--accent); }
.compose-card .status.err { color:var(--danger); }
/* ── Inbox + admin lists ── */
.section {
background:var(--surface); border:1px solid var(--border);
border-radius:4px; padding:16px;
}
.section h2 {
font-family:var(--pixel); font-size:11px; color:var(--accent);
text-transform:uppercase; margin-bottom:10px;
display:flex; align-items:center; gap:8px;
}
.section h2 .count {
background:var(--bg); padding:2px 6px; border-radius:2px;
font-size:9px; color:var(--muted);
}
.section .empty { font-size:11px; color:var(--dim); font-style:italic; padding:8px 0; }
.inbox-item {
display:flex; align-items:flex-start; gap:10px;
padding:10px 0; border-bottom:1px solid var(--border);
}
.inbox-item:last-child { border-bottom:none; }
.inbox-item .meta {
font-family:var(--pixel); font-size:9px; color:var(--dim);
white-space:nowrap; flex-shrink:0;
}
.inbox-item .content { flex:1; min-width:0; }
.inbox-item .content .title {
font-size:12px; color:var(--bright); font-weight:bold;
margin-bottom:2px; word-break:break-word;
}
.inbox-item .content .body {
font-size:11px; color:var(--text); white-space:pre-wrap;
word-break:break-word; max-height:120px; overflow:auto;
}
.inbox-item .from { font-family:var(--pixel); font-size:9px; color:var(--accent2); }
.inbox-item .del {
background:none; border:none; color:var(--dim); cursor:pointer;
padding:4px; font-size:14px; flex-shrink:0;
}
.inbox-item .del:hover { color:var(--danger); }
.user-row {
display:flex; align-items:center; gap:12px;
padding:10px 0; border-bottom:1px solid var(--border);
}
.user-row:last-child { border-bottom:none; }
.user-row .info { flex:1; }
.user-row .name { font-family:var(--pixel); font-size:11px; color:var(--bright); }
.user-row .meta { font-size:10px; color:var(--muted); margin-top:2px; }
.user-row .badge {
background:var(--accent); color:var(--bg);
padding:1px 6px; font-family:var(--pixel); font-size:8px;
text-transform:uppercase; border-radius:2px;
}
.user-row .actions { display:flex; gap:6px; }
.user-row .actions .btn { padding:4px 10px; font-size:9px; }
.create-user-form {
display:flex; flex-direction:column; gap:10px;
padding-top:14px; border-top:1px solid var(--border); margin-top:14px;
}
.create-user-form .field-label {
font-family:var(--pixel); font-size:9px; color:var(--dim);
text-transform:uppercase; display:block; margin-bottom:4px;
}
.create-user-form input[type="text"],
.create-user-form input[type="password"] {
width:100%;
background:var(--bg); border:1px solid var(--border); color:var(--bright);
padding:8px 11px; font-size:12px;
font-family:'JetBrains Mono', monospace; border-radius:3px;
}
.create-user-form input:focus { border-color:var(--accent); outline:none; }
.create-user-form label.checkbox {
font-family:var(--pixel); font-size:9px; color:var(--dim);
text-transform:uppercase;
display:flex; align-items:center; gap:6px; cursor:pointer;
}
.create-user-form label.checkbox input[type="checkbox"] {
accent-color:var(--accent); cursor:pointer;
}
.create-user-form .actions {
display:flex; gap:8px; align-items:center;
margin-top:4px;
}
.toast {
position:fixed; top:20px; right:20px;
background:var(--accent); color:var(--bg);
padding:10px 18px; border-radius:3px;
font-family:var(--pixel); font-size:11px;
opacity:0; transition:opacity .3s; z-index:100; pointer-events:none;
}
.toast.show { opacity:1; }
.toast.err { background:var(--danger); }
.notice { padding:10px 14px; border-radius:3px; font-size:11px; margin-bottom:12px; }
.notice.info { background:rgba(56,189,248,0.1); border:1px solid var(--accent); color:var(--accent); }
.notice.warn { background:rgba(251,113,133,0.1); border:1px solid var(--danger); color:var(--danger); }
/* ── Phosphor icons ── */
.ph { display:inline-block; vertical-align:-2px; }
header .nav-btn .ph { font-size:11px; vertical-align:-1px; margin-right:2px; }
header h1 + .ph { font-size:12px; }
.btn .ph { font-size:12px; vertical-align:-2px; margin-right:2px; }
.section h2 .ph, .compose-card h2 .ph { font-size:13px; vertical-align:-2px; }
/* ── Default nav layout (desktop) ── */
#nav-buttons:not(.hidden) {
display:flex; gap:6px; align-items:center;
}
#nav-burger {
display:none; /* desktop hides the burger */
padding:5px 10px; font-size:11px;
}
/* ── Mobile: collapse nav into a burger menu ── */
@media (max-width: 700px) {
/* Hide identity tag on mobile — it's redundant with the menu */
#nav-user { display:none !important; }
/* Burger replaces the inline nav row */
#nav-burger { display:inline-flex !important; align-items:center; }
/* Default-hide the nav row; .menu-open re-shows it as a popover */
#nav-buttons:not(.hidden) { display:none; }
#nav-buttons.menu-open {
display:flex !important;
flex-direction:column;
align-items:stretch;
position:absolute;
top:100%;
right:12px;
margin-top:6px;
background:var(--surface);
border:1px solid var(--border);
border-radius:4px;
box-shadow:0 8px 24px rgba(0,0,0,0.4);
padding:6px;
gap:4px;
min-width:160px;
z-index:50;
}
#nav-buttons.menu-open .nav-btn {
text-align:left;
width:100%;
}
/* Anchor the popover to the header row */
header { position:relative; }
/* Admin view on mobile: stack the two columns. The desktop layout
has its own grid; here we just let the section scroll naturally. */
#view-admin .section {
display:block !important;
padding:14px 12px;
}
#view-admin .section h2 { margin-bottom:10px; }
#view-admin .section .create-user-form { margin-top:14px; }
}
/* ── Desktop layout ── */
@media (min-width: 901px) {
/* Subtle background gradient gives the page some depth */
body {
background:
radial-gradient(ellipse at top left, rgba(56,189,248,0.04), transparent 50%),
radial-gradient(ellipse at bottom right, rgba(129,140,248,0.04), transparent 50%),
var(--bg);
}
/* Wider canvas, more breathing room */
main {
max-width: 1200px;
padding: 32px 32px 48px;
gap: 24px;
}
/* Header: bigger title, more padding */
header {
padding: 14px 32px;
}
header h1 {
font-size: 15px;
letter-spacing: 1px;
}
header .nav-btn {
padding: 7px 12px;
}
header .user {
padding: 4px 10px;
background: var(--bg);
border: 1px solid var(--border);
border-radius: 3px;
}
/* Compose view: 2-column grid (compose | inbox) */
#view-compose:not(.hidden) {
display: grid !important;
grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
gap: 24px;
align-items: start;
}
/* Cards: depth via shadow + larger padding */
.compose-card,
.section {
padding: 22px 24px;
box-shadow:
0 1px 2px rgba(0,0,0,0.3),
0 8px 24px -8px rgba(0,0,0,0.4);
border-color: color-mix(in srgb, var(--border) 70%, var(--accent) 12%);
}
.compose-card h2,
.section h2 {
font-size: 12px;
margin-bottom: 16px;
padding-bottom: 12px;
border-bottom: 1px solid var(--border);
}
/* Big textarea for desktop typing */
.compose-card textarea {
min-height: 320px;
font-size: 14px;
padding: 12px 14px;
}
.compose-card input,
.compose-card select {
padding: 9px 12px;
font-size: 14px;
}
.compose-card .field label {
font-size: 10px;
margin-bottom: 6px;
}
.compose-card .actions {
margin-top: 6px;
padding-top: 12px;
border-top: 1px solid var(--border);
}
.compose-card .actions .btn {
padding: 11px 22px;
font-size: 12px;
}
/* Inbox card: stick to top of viewport, hover lifts it */
#inbox-section {
position: sticky;
top: 24px;
transition: transform .15s, box-shadow .15s;
}
#inbox-section:hover {
box-shadow:
0 1px 2px rgba(0,0,0,0.3),
0 12px 32px -8px rgba(0,0,0,0.5),
0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent);
}
/* Admin view: 2-column grid (user list | create form) */
#view-admin:not(.hidden) .section {
display: grid;
grid-template-columns: minmax(0, 1fr) 360px;
grid-template-areas:
"header header"
"list form";
gap: 28px;
align-items: start;
}
#view-admin .section h2 { grid-area: header; }
#view-admin .section #users-list { grid-area: list; }
#view-admin .section .create-user-form {
grid-area: form;
margin-top: 0;
padding-top: 0;
border-top: none;
padding-left: 24px;
border-left: 1px solid var(--border);
}
/* User row polish: hover lift */
.user-row {
padding: 14px 12px;
margin: 0 -12px;
border-radius: 3px;
transition: background .12s;
}
.user-row:hover {
background: color-mix(in srgb, var(--raised) 70%, transparent);
}
.user-row .name {
font-size: 12px;
}
/* Auth forms (setup/login) — vertically center on viewport */
.auth-form {
margin-top: 64px;
padding: 40px 32px;
background: var(--surface);
border: 1px solid var(--border);
border-radius: 4px;
box-shadow:
0 1px 2px rgba(0,0,0,0.3),
0 16px 48px -16px rgba(0,0,0,0.5);
max-width: 420px;
}
.auth-form h2 {
font-size: 14px;
margin-bottom: 8px;
}
/* Buttons: subtle press */
.btn { transition: all .12s; }
.btn-primary:hover {
filter: brightness(1.15);
transform: translateY(-1px);
box-shadow: 0 4px 12px -4px rgba(56,189,248,0.5);
}
.btn-secondary:hover { transform: translateY(-1px); }
.btn-danger:hover { transform: translateY(-1px); }
}