Phase 1.2: session login + empty HTMX dashboard
- Session login for the single user Sam: server-side session store with an HMAC-signed session cookie, POST /login, POST /logout, and double-submit CSRF on every form post. Unauthenticated requests to / and /partials/* redirect to /login?next=... - Empty dashboard shell in the Family Home Lab design system: left nav (category and folder placeholders), centre list, right detail pane. - Copy tokens.css and the self-hosted Inter fonts from the family-home-lab design system into web/static; vendor htmx 2.0.4. No cross-project imports at runtime. - Dark mode via prefers-color-scheme plus a persisted toggle; phone-first layout with 44px touch targets, hairline borders, 8px grid, pill CTAs. - Config: EMAIL_AGENT_PASSWORD for the login password, falling back to EMAIL_AGENT_SESSION_SECRET so one configured secret is enough. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
293
web/static/app.css
Normal file
293
web/static/app.css
Normal file
@@ -0,0 +1,293 @@
|
||||
/* ============================================================
|
||||
Email Agent — application styles
|
||||
Built on Family Home Lab tokens.css (do not edit tokens here).
|
||||
Base unit: 8px. Touch targets >= 44px. Pill CTAs, 4px inputs.
|
||||
============================================================ */
|
||||
|
||||
*,
|
||||
*::before,
|
||||
*::after { box-sizing: border-box; }
|
||||
|
||||
html, body { height: 100%; }
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
font: var(--type-body-md);
|
||||
color: var(--ink-secondary);
|
||||
background: var(--canvas-soft);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
|
||||
h1, h2, h3, p { margin: 0; }
|
||||
|
||||
a { color: var(--primary); text-decoration: none; }
|
||||
a:hover { text-decoration: underline; }
|
||||
|
||||
:focus-visible {
|
||||
outline: 2px solid var(--primary);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
/* ---------- primitives ---------- */
|
||||
|
||||
.btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: var(--space-xs);
|
||||
min-height: 44px;
|
||||
padding: 0 var(--space-lg);
|
||||
border: 1px solid transparent;
|
||||
border-radius: var(--rounded-full);
|
||||
font: var(--type-button);
|
||||
cursor: pointer;
|
||||
transition: transform .08s ease, background-color .15s ease, box-shadow .15s ease;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.btn:active { transform: scale(.97); }
|
||||
|
||||
.btn-primary {
|
||||
background: var(--primary);
|
||||
color: var(--on-primary);
|
||||
}
|
||||
.btn-primary:hover { background: var(--primary-active); }
|
||||
|
||||
.btn-utility {
|
||||
background: var(--surface);
|
||||
color: var(--ink);
|
||||
border-radius: var(--rounded-md);
|
||||
min-height: 44px;
|
||||
padding: 0 var(--space-md);
|
||||
box-shadow: var(--shadow-level-1);
|
||||
border: 1px solid var(--hairline);
|
||||
}
|
||||
.btn-utility:hover { background: var(--surface-2); }
|
||||
|
||||
.btn-block { width: 100%; }
|
||||
|
||||
.text-input {
|
||||
width: 100%;
|
||||
min-height: 44px;
|
||||
padding: var(--space-xs) var(--space-sm);
|
||||
background: var(--surface);
|
||||
color: var(--ink);
|
||||
font: var(--type-body-md);
|
||||
border: 1px solid var(--hairline);
|
||||
border-radius: var(--rounded-xs);
|
||||
}
|
||||
.text-input:focus {
|
||||
outline: none;
|
||||
border-color: var(--primary);
|
||||
box-shadow: var(--shadow-level-1);
|
||||
}
|
||||
|
||||
.field { display: flex; flex-direction: column; gap: var(--space-xxs); }
|
||||
.field > label { font: var(--type-caption); color: var(--ink-muted); }
|
||||
|
||||
.pill {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: var(--space-xxs);
|
||||
padding: 4px 8px;
|
||||
border-radius: var(--rounded-full);
|
||||
font: var(--type-eyebrow);
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--hairline);
|
||||
color: var(--ink-muted);
|
||||
}
|
||||
|
||||
.hairline { border: 1px solid var(--hairline); }
|
||||
|
||||
.muted { color: var(--ink-muted); }
|
||||
.faint { color: var(--ink-faint); }
|
||||
|
||||
/* ---------- login ---------- */
|
||||
|
||||
.login-body {
|
||||
background: var(--secondary);
|
||||
}
|
||||
|
||||
.login-wrap {
|
||||
min-height: 100dvh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: var(--space-xl);
|
||||
padding: var(--space-lg);
|
||||
}
|
||||
|
||||
.login-greeting {
|
||||
font: var(--type-display-1);
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
letter-spacing: -1.5px;
|
||||
}
|
||||
|
||||
.auth-card {
|
||||
width: 100%;
|
||||
max-width: 400px;
|
||||
background: var(--surface);
|
||||
border-radius: var(--rounded-lg);
|
||||
box-shadow: var(--shadow-level-2);
|
||||
padding: var(--space-xxl) var(--space-lg);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--space-lg);
|
||||
}
|
||||
|
||||
.auth-brand {
|
||||
font: var(--type-eyebrow);
|
||||
color: var(--ink-faint);
|
||||
letter-spacing: .125px;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.auth-card h1, .auth-card h2 {
|
||||
font: var(--type-heading-1);
|
||||
color: var(--ink);
|
||||
}
|
||||
.auth-card h2 { font: var(--type-heading-2); }
|
||||
|
||||
.auth-card p { font: var(--type-body-sm); color: var(--ink-muted); }
|
||||
|
||||
.auth-form { display: flex; flex-direction: column; gap: var(--space-md); }
|
||||
|
||||
.alert {
|
||||
padding: var(--space-xs) var(--space-sm);
|
||||
border-radius: var(--rounded-xs);
|
||||
font: var(--type-body-sm);
|
||||
border: 1px solid var(--hairline);
|
||||
background: var(--surface-2);
|
||||
color: var(--ink-secondary);
|
||||
}
|
||||
.alert-error { border-color: var(--sticker-red); color: var(--sticker-red); }
|
||||
|
||||
/* ---------- dashboard chrome ---------- */
|
||||
|
||||
.nav-bar {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 10;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: var(--space-md);
|
||||
padding: var(--space-xs) var(--space-md);
|
||||
min-height: 56px;
|
||||
background: var(--surface);
|
||||
border-bottom: 1px solid var(--hairline);
|
||||
}
|
||||
.nav-bar .wordmark { font: var(--type-title); color: var(--ink); }
|
||||
.nav-bar .nav-actions { display: flex; align-items: center; gap: var(--space-xs); }
|
||||
|
||||
.page { max-width: var(--container-max); margin: 0 auto; padding: var(--space-lg) var(--space-md); }
|
||||
|
||||
.greeting { font: var(--type-heading-1); color: var(--ink); margin-bottom: var(--space-lg); }
|
||||
|
||||
.shell {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr;
|
||||
gap: var(--space-md);
|
||||
align-items: start;
|
||||
}
|
||||
|
||||
@media (min-width: 760px) {
|
||||
.shell { grid-template-columns: 220px minmax(0, 1fr); }
|
||||
}
|
||||
@media (min-width: 1080px) {
|
||||
.shell { grid-template-columns: 220px minmax(0, 1fr) 340px; }
|
||||
}
|
||||
|
||||
.panel {
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--hairline);
|
||||
border-radius: var(--rounded-lg);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.panel-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: var(--space-xs);
|
||||
padding: var(--space-sm) var(--space-md);
|
||||
border-bottom: 1px solid var(--hairline);
|
||||
}
|
||||
.panel-head h2 { font: var(--type-title); color: var(--ink); }
|
||||
|
||||
.panel-body { padding: var(--space-md); }
|
||||
|
||||
/* left nav: vertical list on desktop, horizontal scroller on phone */
|
||||
.nav-groups { display: flex; flex-direction: column; gap: var(--space-md); padding: var(--space-md); }
|
||||
|
||||
@media (max-width: 759px) {
|
||||
.nav-groups {
|
||||
flex-direction: row;
|
||||
overflow-x: auto;
|
||||
gap: var(--space-md);
|
||||
padding: var(--space-xs) var(--space-sm);
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
.nav-group { min-width: max-content; }
|
||||
.nav-group-items { flex-direction: row; }
|
||||
}
|
||||
|
||||
.nav-group-title {
|
||||
font: var(--type-eyebrow);
|
||||
color: var(--ink-faint);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: .125px;
|
||||
margin-bottom: var(--space-xs);
|
||||
}
|
||||
.nav-group-items { display: flex; flex-direction: column; gap: 2px; }
|
||||
|
||||
.nav-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--space-xs);
|
||||
min-height: 44px;
|
||||
padding: 0 var(--space-sm);
|
||||
border-radius: var(--rounded-sm);
|
||||
font: var(--type-body-sm);
|
||||
color: var(--ink-secondary);
|
||||
}
|
||||
.nav-item:hover { background: var(--surface-2); text-decoration: none; }
|
||||
.nav-item .dot {
|
||||
width: 8px; height: 8px; border-radius: var(--rounded-full);
|
||||
background: var(--ink-faint); flex: 0 0 auto;
|
||||
}
|
||||
.nav-item .count { margin-left: auto; font: var(--type-caption); color: var(--ink-faint); }
|
||||
|
||||
/* centre list */
|
||||
.msg-list { display: flex; flex-direction: column; }
|
||||
.msg-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--space-sm);
|
||||
min-height: 64px;
|
||||
padding: var(--space-sm) var(--space-md);
|
||||
border-bottom: 1px solid var(--hairline);
|
||||
}
|
||||
.msg-row:last-child { border-bottom: 0; }
|
||||
|
||||
.empty-state {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: var(--space-sm);
|
||||
text-align: center;
|
||||
padding: var(--space-xxl) var(--space-lg);
|
||||
}
|
||||
.empty-state .empty-title { font: var(--type-title); color: var(--ink); }
|
||||
.empty-state .empty-copy { font: var(--type-body-sm); color: var(--ink-muted); max-width: 32ch; }
|
||||
|
||||
.detail-body { padding: var(--space-lg) var(--space-md); }
|
||||
|
||||
/* dark-mode toggle shows the right glyph */
|
||||
.theme-toggle .icon-dark { display: none; }
|
||||
[data-theme="dark"] .theme-toggle .icon-dark { display: inline; }
|
||||
[data-theme="dark"] .theme-toggle .icon-light { display: none; }
|
||||
|
||||
/* subtle, non-decorative loading pulse (no spinners) */
|
||||
.htmx-request .empty-state { opacity: .55; transition: opacity .15s ease; }
|
||||
Reference in New Issue
Block a user