Add mobile-first web UI
Compare (duel with row-by-row comparison and thumb-reach pick bar), Ranking, Triage (keep/drop pass, problem schools first), school detail with sources and notes, Settings. Picks go to a localStorage outbox first and sync in the background, so nothing is lost on a flaky connection. Light/dark themes, installable to the home screen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HA82gXkMmmRRKLSnY6vQN3
This commit is contained in:
parent
67f9b199ec
commit
0951f34a9d
15 changed files with 1531 additions and 0 deletions
288
public/css/app.css
Normal file
288
public/css/app.css
Normal file
|
|
@ -0,0 +1,288 @@
|
|||
/* Elorasmus: mobile-first. Light/dark via tokens; data-theme on <html> overrides the system. */
|
||||
|
||||
:root {
|
||||
--bg: #f6f4ef; --surface: #ffffff; --surface-2: #eeebe3; --text: #1b1f24; --muted: #5f6873; --line: #e1ddd3;
|
||||
--accent: #2d5bd7; --accent-text: #ffffff;
|
||||
--a: #0f7f75; --a-soft: #d8efeb; --b: #b4570f; --b-soft: #f9e4d1;
|
||||
--good: #1d7a43; --warn: #9a6400; --bad: #c0352e;
|
||||
--radius: 14px; --shadow: 0 1px 2px rgb(0 0 0 / .06), 0 6px 20px rgb(0 0 0 / .06);
|
||||
--max: 760px; --gutter: 16px;
|
||||
color-scheme: light;
|
||||
}
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root:not([data-theme="light"]) {
|
||||
--bg: #111418; --surface: #1a1e24; --surface-2: #252b33; --text: #e8eaed; --muted: #9aa4ae; --line: #2d343d;
|
||||
--accent: #7ea2ff; --accent-text: #0c1222;
|
||||
--a: #3fc4b4; --a-soft: #153532; --b: #f2a45f; --b-soft: #3b2715;
|
||||
--good: #5fcf8c; --warn: #f0b94e; --bad: #ff7d74;
|
||||
--shadow: 0 1px 2px rgb(0 0 0 / .4), 0 6px 20px rgb(0 0 0 / .3);
|
||||
color-scheme: dark;
|
||||
}
|
||||
}
|
||||
:root[data-theme="dark"] {
|
||||
--bg: #111418; --surface: #1a1e24; --surface-2: #252b33; --text: #e8eaed; --muted: #9aa4ae; --line: #2d343d;
|
||||
--accent: #7ea2ff; --accent-text: #0c1222;
|
||||
--a: #3fc4b4; --a-soft: #153532; --b: #f2a45f; --b-soft: #3b2715;
|
||||
--good: #5fcf8c; --warn: #f0b94e; --bad: #ff7d74;
|
||||
--shadow: 0 1px 2px rgb(0 0 0 / .4), 0 6px 20px rgb(0 0 0 / .3);
|
||||
color-scheme: dark;
|
||||
}
|
||||
|
||||
* { box-sizing: border-box; }
|
||||
html { -webkit-text-size-adjust: 100%; }
|
||||
body {
|
||||
margin: 0; background: var(--bg); color: var(--text);
|
||||
font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
a { color: var(--accent); }
|
||||
button { font: inherit; color: inherit; }
|
||||
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; }
|
||||
h1 { font-size: 1.35rem; } h2 { font-size: 1.05rem; } h3 { font-size: .95rem; }
|
||||
p { margin: .4em 0; }
|
||||
ul, ol { margin: .3em 0; padding-left: 1.2em; }
|
||||
.muted { color: var(--muted); }
|
||||
.small { font-size: .82rem; }
|
||||
.loading { padding: 40px var(--gutter); text-align: center; color: var(--muted); }
|
||||
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
|
||||
|
||||
/* ---------- top bar ---------- */
|
||||
.topbar {
|
||||
position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px;
|
||||
padding: 6px var(--gutter); padding-top: calc(6px + env(safe-area-inset-top));
|
||||
background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
|
||||
border-bottom: 1px solid var(--line);
|
||||
}
|
||||
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); text-decoration: none; }
|
||||
.picks { color: var(--muted); font-size: .8rem; display: none; }
|
||||
.tabs { margin-left: auto; display: flex; gap: 2px; }
|
||||
.tabs a {
|
||||
display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 52px; padding: 4px 6px;
|
||||
border-radius: 10px; color: var(--muted); text-decoration: none; font-size: .68rem;
|
||||
}
|
||||
.tabs a svg { width: 22px; height: 22px; }
|
||||
.tabs a.active { color: var(--accent); background: var(--surface); box-shadow: var(--shadow); }
|
||||
body.logged-out .tabs { display: none; }
|
||||
|
||||
.view { max-width: var(--max); margin: 0 auto; padding: 12px var(--gutter) 24px; }
|
||||
|
||||
/* ---------- shared bits ---------- */
|
||||
.btn {
|
||||
display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px;
|
||||
border: 0; border-radius: 12px; background: var(--accent); color: var(--accent-text); font-weight: 600;
|
||||
text-decoration: none; cursor: pointer;
|
||||
}
|
||||
.btn.ghost { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
|
||||
.link { background: none; border: 0; padding: 6px 0; color: var(--accent); cursor: pointer; text-decoration: underline; }
|
||||
.chip {
|
||||
display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .74rem; background: var(--surface-2);
|
||||
color: var(--muted); white-space: nowrap;
|
||||
}
|
||||
.chip.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
|
||||
.notice { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
|
||||
.empty { text-align: center; padding: 40px 0; }
|
||||
|
||||
.bar { display: inline-block; width: 46px; height: 6px; border-radius: 3px; background: var(--surface-2); vertical-align: middle; overflow: hidden; }
|
||||
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
|
||||
.num { margin-left: 6px; font-variant-numeric: tabular-nums; }
|
||||
.w0 { width: 0; } .w1 { width: 10%; } .w2 { width: 20%; } .w3 { width: 30%; } .w4 { width: 40%; } .w5 { width: 50%; }
|
||||
.w6 { width: 60%; } .w7 { width: 70%; } .w8 { width: 80%; } .w9 { width: 90%; } .w10 { width: 100%; }
|
||||
|
||||
.tone-ok, .tone-best, .tone-good { color: var(--good); }
|
||||
.tone-fail, .tone-none, .tone-poor { color: var(--bad); }
|
||||
.tone-unknown, .tone-weak { color: var(--warn); }
|
||||
b.tone-ok { color: var(--good); }
|
||||
|
||||
/* ---------- duel ---------- */
|
||||
.duel { padding-bottom: 150px; }
|
||||
.prompt { margin: 0 0 8px; color: var(--muted); font-size: .85rem; text-align: center; }
|
||||
.duel-heads { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: stretch; }
|
||||
.vs { align-self: center; font-weight: 700; color: var(--muted); font-size: .8rem; }
|
||||
.school-head {
|
||||
position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
|
||||
padding: 10px 10px 10px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow);
|
||||
border: 2px solid transparent; cursor: pointer; min-width: 0;
|
||||
}
|
||||
.school-head.side-a { border-color: var(--a); }
|
||||
.school-head.side-b { border-color: var(--b); }
|
||||
.side-tag {
|
||||
display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; font-size: .72rem; font-weight: 800;
|
||||
color: #fff;
|
||||
}
|
||||
.side-a .side-tag { background: var(--a); }
|
||||
.side-b .side-tag { background: var(--b); }
|
||||
.school-head .side-tag { position: absolute; top: 8px; right: 8px; }
|
||||
.school-head .flag { font-size: 1.5rem; line-height: 1; }
|
||||
.sname { font-weight: 700; font-size: .98rem; line-height: 1.2; overflow-wrap: anywhere; padding-right: 18px; }
|
||||
.splace { color: var(--muted); font-size: .78rem; line-height: 1.25; }
|
||||
.srating { margin-top: 4px; font-weight: 700; font-variant-numeric: tabular-nums; }
|
||||
.srating small { display: block; font-weight: 400; color: var(--muted); font-size: .72rem; }
|
||||
.provisional { opacity: .75; }
|
||||
|
||||
.cmp { margin-top: 10px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 4px 10px 8px; }
|
||||
.cmp-section {
|
||||
grid-column: 1 / -1; margin-top: 10px; padding: 2px 0; font-size: .7rem; letter-spacing: .06em; text-transform: uppercase;
|
||||
color: var(--muted); font-weight: 700;
|
||||
}
|
||||
.cmp-row {
|
||||
display: grid; grid-template-columns: minmax(84px, .9fr) 1fr 1fr; gap: 6px; align-items: center;
|
||||
padding: 3px 0; border-top: 1px solid var(--line); font-size: .86rem;
|
||||
}
|
||||
.cmp-section + .cmp-row { border-top: 0; }
|
||||
.cmp-label { color: var(--muted); font-size: .8rem; line-height: 1.2; }
|
||||
.cmp-val { padding: 4px 6px; border-radius: 8px; min-width: 0; overflow-wrap: anywhere; line-height: 1.25; }
|
||||
.cmp-val .bar { width: 38px; }
|
||||
.cmp-val .bar > i { background: var(--muted); opacity: .55; }
|
||||
.cmp-val.win .bar > i { opacity: 1; }
|
||||
.win-a { background: var(--a-soft); }
|
||||
.win-b { background: var(--b-soft); }
|
||||
.win-a .bar > i { background: var(--a); }
|
||||
.win-b .bar > i { background: var(--b); }
|
||||
.win { font-weight: 600; }
|
||||
|
||||
.duel-flags { display: grid; gap: 10px; margin-top: 12px; }
|
||||
.flags { background: var(--surface); border-radius: var(--radius); padding: 10px 12px; box-shadow: var(--shadow); border-left: 4px solid; }
|
||||
.flags.side-a { border-left-color: var(--a); }
|
||||
.flags.side-b { border-left-color: var(--b); }
|
||||
.flags h3 { display: flex; align-items: center; gap: 6px; }
|
||||
.flags .summary { font-size: .88rem; }
|
||||
.flags ul { list-style: none; padding: 0; font-size: .86rem; }
|
||||
.flags li, .hl-list li, .wo-list li { padding-left: 1.3em; position: relative; margin: .25em 0; }
|
||||
.flags li::before, .hl-list li::before, .wo-list li::before { position: absolute; left: 0; font-weight: 700; }
|
||||
.flags li.hl::before, .hl-list li::before { content: "+"; color: var(--good); }
|
||||
.flags li.wo::before, .wo-list li::before { content: "!"; color: var(--bad); left: .25em; }
|
||||
.hl-list, .wo-list { list-style: none; padding: 0; }
|
||||
.duel-drop { display: flex; justify-content: space-between; margin-top: 10px; font-size: .82rem; }
|
||||
|
||||
/* ---------- bottom action bar ---------- */
|
||||
.actionbar {
|
||||
position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; background: var(--surface); border-top: 1px solid var(--line);
|
||||
box-shadow: 0 -6px 20px rgb(0 0 0 / .08); padding: 6px var(--gutter) calc(10px + env(safe-area-inset-bottom));
|
||||
}
|
||||
.actionbar > div { max-width: var(--max); margin: 0 auto; }
|
||||
.actionbar-sub { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px !important; }
|
||||
.ghost { background: none; border: 0; padding: 6px 4px; color: var(--accent); cursor: pointer; font-weight: 600; font-size: .9rem; }
|
||||
.ghost:disabled { color: var(--muted); opacity: .5; cursor: default; }
|
||||
.actionbar-main { display: grid; grid-template-columns: 1fr 56px 1fr; gap: 8px; }
|
||||
.pick {
|
||||
min-height: 54px; border: 0; border-radius: 14px; font-weight: 700; font-size: .95rem; cursor: pointer; padding: 0 10px;
|
||||
white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff;
|
||||
}
|
||||
.pick span { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: rgb(255 255 255 / .22); font-size: .8rem; }
|
||||
.pick-a { background: var(--a); text-align: left; }
|
||||
.pick-b { background: var(--b); text-align: right; }
|
||||
.pick-draw { background: var(--surface-2); color: var(--text); font-size: 1.3rem; }
|
||||
.pick:active { transform: scale(.98); }
|
||||
:root[data-theme="dark"] .pick-a, :root[data-theme="dark"] .pick-b { color: #0d1117; }
|
||||
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pick-a, :root:not([data-theme="light"]) .pick-b { color: #0d1117; } }
|
||||
.triage + .actionbar .actionbar-main, .actionbar-main:has(.pick-keep) { grid-template-columns: 1fr 1fr; }
|
||||
.pick-drop { background: var(--surface-2); color: var(--bad) !important; }
|
||||
.pick-keep { background: var(--accent); color: var(--accent-text) !important; }
|
||||
|
||||
/* ---------- ranking ---------- */
|
||||
.rank-tools { display: grid; gap: 8px; margin-bottom: 8px; }
|
||||
.rank-tools input[type=search], select, input[type=number], textarea, .login input {
|
||||
width: 100%; min-height: 42px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line);
|
||||
background: var(--surface); color: var(--text); font: inherit;
|
||||
}
|
||||
.rank-filters { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
|
||||
.rank-filters select { font-size: .85rem; padding: 6px; }
|
||||
.check { display: flex; gap: 8px; align-items: flex-start; font-size: .9rem; margin: 6px 0; }
|
||||
.check input { margin-top: 3px; width: 18px; height: 18px; flex: none; }
|
||||
.rank-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
|
||||
.rank-list li { display: grid; }
|
||||
.rank-row {
|
||||
display: grid; grid-template-columns: 26px 26px 1fr auto; gap: 8px; align-items: center; width: 100%; text-align: left;
|
||||
padding: 10px; border: 0; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); cursor: pointer;
|
||||
}
|
||||
.rank-row.dropped { opacity: .55; }
|
||||
.pos { font-weight: 700; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
|
||||
.rank-row .flag { font-size: 1.3rem; }
|
||||
.rmain { display: grid; min-width: 0; }
|
||||
.rname { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.rmeta { font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.rchips { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
|
||||
.rscore { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
|
||||
.rscore small { display: block; font-weight: 400; color: var(--muted); font-size: .72rem; }
|
||||
.restore { justify-self: end; font-size: .85rem; }
|
||||
|
||||
/* ---------- detail ---------- */
|
||||
.back { display: inline-flex; align-items: center; gap: 2px; background: none; border: 0; color: var(--accent); padding: 4px 0; cursor: pointer; font-weight: 600; }
|
||||
.back svg { width: 20px; height: 20px; }
|
||||
.dhead { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; margin: 6px 0 12px; }
|
||||
.dflag { font-size: 2rem; line-height: 1; margin-bottom: 4px; }
|
||||
.dstats { font-variant-numeric: tabular-nums; }
|
||||
.dactions { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 8px; }
|
||||
.dsummary { font-size: 1rem; }
|
||||
.hlwo { display: grid; gap: 4px; margin: 8px 0 12px; font-size: .92rem; }
|
||||
.dsec { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; margin-bottom: 12px; }
|
||||
.dsec h2 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
|
||||
.dsec h3 { margin-top: .8em; }
|
||||
.dsec p, .dsec li { font-size: .92rem; }
|
||||
.conf { font-size: .7rem; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
|
||||
.conf-low { color: var(--warn); }
|
||||
.scored { margin: 8px 0 12px; }
|
||||
.scored-head { display: flex; justify-content: space-between; align-items: center; font-weight: 650; }
|
||||
.scored-head .bar { width: 90px; }
|
||||
.kv { display: grid; grid-template-columns: 1fr; gap: 2px 12px; margin: 0; }
|
||||
.kv dt { font-weight: 650; font-size: .85rem; margin-top: 8px; }
|
||||
.kv dd { margin: 0; font-size: .92rem; }
|
||||
.agreements { list-style: none; padding: 0; display: grid; gap: 8px; }
|
||||
.agreements li { padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
|
||||
.lang { font-weight: 600; }
|
||||
.sources { font-size: .85rem; overflow-wrap: anywhere; }
|
||||
.history { list-style: none; padding: 0; font-size: .9rem; }
|
||||
.history .up { color: var(--good); font-weight: 700; display: inline-block; width: 3em; }
|
||||
.history .down { color: var(--bad); font-weight: 700; display: inline-block; width: 3em; }
|
||||
.advisory { font-weight: 700; }
|
||||
.adv-none { color: var(--good); } .adv-caution { color: var(--warn); } .adv-partial-avoid, .adv-avoid { color: var(--bad); }
|
||||
textarea { min-height: 96px; resize: vertical; }
|
||||
|
||||
/* ---------- triage ---------- */
|
||||
.triage { padding-bottom: 110px; }
|
||||
.progress { position: relative; height: 28px; border-radius: 10px; background: var(--surface-2); overflow: hidden; margin-bottom: 6px; }
|
||||
.progress > i { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--accent) 30%, transparent); }
|
||||
.progress > span { position: relative; z-index: 1; display: block; text-align: center; line-height: 28px; font-size: .82rem; font-weight: 600; }
|
||||
.tcard { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; margin-top: 8px; }
|
||||
.tcard header { display: flex; gap: 10px; align-items: center; }
|
||||
.tcard .flag { font-size: 2rem; }
|
||||
.concerns { background: color-mix(in srgb, var(--bad) 12%, transparent); border-radius: 10px; padding: 8px 8px 8px 26px; color: var(--bad); font-size: .9rem; }
|
||||
.tgrid { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: .9rem; margin: 10px 0; }
|
||||
.tgrid dt { color: var(--muted); } .tgrid dd { margin: 0; }
|
||||
|
||||
/* ---------- settings & login ---------- */
|
||||
.settings h2 { margin-top: 1.4em; }
|
||||
.field { display: grid; gap: 6px; margin: 10px 0; border: 0; padding: 0; font-weight: 600; font-size: .92rem; }
|
||||
.field legend { padding: 0; margin-bottom: 6px; }
|
||||
.seg { display: flex; gap: 6px; flex-wrap: wrap; font-weight: 400; }
|
||||
.seg label { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
|
||||
.langs { list-style: none; padding: 0; display: grid; gap: 6px; font-weight: 400; }
|
||||
.langs li { display: grid; grid-template-columns: 1fr 90px auto; gap: 8px; align-items: center; }
|
||||
.addlang { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
|
||||
.row { display: flex; flex-wrap: wrap; gap: 8px; }
|
||||
.file { position: relative; overflow: hidden; }
|
||||
.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
|
||||
.about li { margin: .3em 0; }
|
||||
.login { max-width: 340px; margin: 40px auto; display: grid; gap: 10px; background: var(--surface); padding: 20px; border-radius: var(--radius); box-shadow: var(--shadow); }
|
||||
.error { color: var(--bad); min-height: 1.2em; }
|
||||
|
||||
/* ---------- toast ---------- */
|
||||
.toast {
|
||||
position: fixed; left: 50%; bottom: calc(132px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); z-index: 30;
|
||||
display: flex; gap: 12px; align-items: center; max-width: calc(100vw - 32px); padding: 10px 14px; border-radius: 12px;
|
||||
background: #1f252d; color: #f1f3f5; font-size: .88rem; box-shadow: 0 8px 24px rgb(0 0 0 / .25);
|
||||
opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
|
||||
}
|
||||
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
|
||||
.toast button { background: none; border: 0; color: #8fb4ff; font-weight: 700; cursor: pointer; padding: 4px; }
|
||||
|
||||
/* ---------- wider screens ---------- */
|
||||
@media (min-width: 640px) {
|
||||
.picks { display: inline; }
|
||||
.duel-flags { grid-template-columns: 1fr 1fr; }
|
||||
.kv { grid-template-columns: 200px 1fr; }
|
||||
.kv dt { margin-top: 0; }
|
||||
.sname { font-size: 1.08rem; }
|
||||
.cmp-row { grid-template-columns: 170px 1fr 1fr; }
|
||||
}
|
||||
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
|
||||
Loading…
Add table
Add a link
Reference in a new issue