xonecas.io
8356
Wx

www-xonecas-io / commit 961bb3c

/projects slider spans the table, over a bar per month of active projects (1028)

Co-Authored-By: Claude Opus 5.5

Sean Caetano Martin2026-11-08 961bb3c495a03a06085fae14ca4f572f370c4e3a parent 1cfbf06

5 files changed

internal/site/assets/site.css+11−6
@@ -103,11 +103,16 @@
103103 .code .nt { color: #ffd166; }
104104 }
105105
106-/* Two-thumb range: two range inputs stacked on one track, and only their thumbs take the pointer. */
107-.range { position: relative; height: 1rem; }
108-.range::before { content: ""; position: absolute; inset: 7px 0; background: var(--color-line); }
109-.range input { position: absolute; inset: 0; width: 100%; margin: 0; appearance: none; background: none; pointer-events: none; }
110-.range input::-webkit-slider-thumb { appearance: none; pointer-events: auto; width: 1rem; height: 1rem; border-radius: 2px; background: var(--color-accent); cursor: pointer; }
111-.range input::-moz-range-thumb { pointer-events: auto; width: 1rem; height: 1rem; border: 0; border-radius: 2px; background: var(--color-accent); cursor: pointer; }
106+/* Two-thumb range: two range inputs stacked on a track under a bar per month, and only their thumbs take the pointer.
107+ The bars are inset by half a thumb so each lines up with the thumb position of its month. */
108+.range { position: relative; height: 4rem; }
109+.range::before { content: ""; position: absolute; inset: auto 0 calc(.625rem - 1.5px); height: 3px; background: var(--color-ink); }
110+#bars { position: absolute; inset: 0 .625rem 1.5rem; display: flex; align-items: flex-end; }
111+#bars i { flex: 1; min-height: 2px; background: var(--color-line); }
112+#bars i.on { background: var(--color-accent); }
113+@media (width >= 40rem) { #bars { gap: 1px; } }
114+.range input { position: absolute; inset: auto 0 0; height: 1.25rem; width: 100%; margin: 0; appearance: none; background: none; pointer-events: none; }
115+.range input::-webkit-slider-thumb { appearance: none; pointer-events: auto; width: 1.25rem; height: 1.25rem; border: 1.5px solid var(--color-ink); border-radius: 2px; background: var(--color-accent); cursor: grab; }
116+.range input::-moz-range-thumb { pointer-events: auto; width: 1.25rem; height: 1.25rem; box-sizing: border-box; border: 1.5px solid var(--color-ink); border-radius: 2px; background: var(--color-accent); cursor: grab; }
112117 .range input:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--color-ink); outline-offset: 2px; }
113118 .range input:focus-visible::-moz-range-thumb { outline: 2px solid var(--color-ink); outline-offset: 2px; }
internal/site/static/projects.js+5−1
@@ -1,6 +1,6 @@
11 // Filters, sorts and searches the /projects list, and keeps the view in the URL.
22 // Tags from different pairs must all match; tags of the same pair match either.
3-// The date range keeps a project with any commit in a month between its two thumbs.
3+// The date range keeps a project with any commit in a month between its two thumbs, over a bar per month of active projects.
44 const form = document.getElementById("filters"), list = document.getElementById("rows");
55 const search = document.querySelector("input[name=q]"), rows = [...list.children];
66 const sorts = {
@@ -11,6 +11,9 @@ const sorts = {
1111 const ym = (y, m) => `${y}-${String(m).padStart(2, "0")}`, months = [];
1212 const lo = rows.map(r => r.dataset.first).sort()[0], hi = rows.map(r => r.dataset.last).sort().at(-1).slice(0, 7);
1313 for (let y = +lo.slice(0, 4), m = +lo.slice(5, 7); ym(y, m) <= hi; m === 12 ? (y++, m = 1) : m++) months.push(ym(y, m));
14+const active = months.map(m => rows.filter(r => r.dataset.months.includes(m)).length), peak = Math.max(...active);
15+const bars = months.map((m, i) => Object.assign(document.createElement("i"), { title: `${m}: ${active[i]} active`, style: `height:${active[i] / peak * 100}%` }));
16+document.getElementById("bars").append(...bars);
1417
1518 function apply() {
1619 const pairs = [...form.querySelectorAll("fieldset")].slice(0, -1)
@@ -19,6 +22,7 @@ function apply() {
1922 const a = Math.min(form.from.value, form.to.value), b = Math.max(form.from.value, form.to.value);
2023 const from = months[a], to = months[b];
2124 document.getElementById("span").textContent = `${from} – ${to}`;
25+ bars.forEach((e, i) => e.classList.toggle("on", i >= a && i <= b));
2226 let shown = 0;
2327 for (const r of rows.sort(sorts[sort])) {
2428 const tags = r.dataset.tags.split(" ");
internal/site/templates/projects.html+2−3
@@ -10,9 +10,8 @@
1010 <fieldset class="flex items-center gap-3 sm:ml-auto"><span class="text-soft">Sort</span>
1111 {{range list "recent" "oldest" "commits"}}<label class="cursor-pointer font-semibold has-checked:underline underline-offset-4 decoration-2"><input type="radio" name="sort" value="{{.}}" class="sr-only" {{if eq . "recent"}}checked{{end}}>{{.}}</label>{{end}}
1212 </fieldset>
13- <div class="w-full flex items-center gap-3"><span class="text-soft">Active</span>
14- <div class="range flex-1 max-w-md"><input type="range" name="from" min="0" value="0" aria-label="From month"><input type="range" name="to" min="0" aria-label="To month"></div>
15- <output id="span" class="font-mono text-xs"></output>
13+ <div class="w-full"><div class="flex items-baseline justify-between mb-1"><span class="text-soft">Active projects by month</span><output id="span" class="font-mono text-xs font-semibold"></output></div>
14+ <div class="range"><div id="bars"></div><input type="range" name="from" min="0" value="0" aria-label="From month"><input type="range" name="to" min="0" aria-label="To month"></div>
1615 </div>
1716 </form>
1817 <ol id="rows">
tickets/1028-let-s-make-the-slider-more-prominent-and-cool.md+9−3
@@ -2,13 +2,13 @@
22 id: 1028
33 title: let's make the slider more prominent and cool. As wide as the table below it.
44 type: feature
5-status: doing
5+status: review
66 priority: p2
77 created: 2026-11-08T04:27:51Z
8-updated: 2026-11-08T04:37:47Z
8+updated: 2026-11-08T04:45:52Z
99 source: devnote
1010 area: site
11-moves: 2026-11-08T04:37:47Z inbox doing drag
11+moves: 2026-11-08T04:37:47Z inbox doing drag; 2026-11-08T04:45:52Z doing review agent
1212 ---
1313
1414 ## Context
@@ -20,3 +20,9 @@ Filed from `http://192.168.122.10:8080/projects/`, on `div.range.flex-1.max-w-md
2020 - 2026-11-08 04:28Z (agent): Triage: type feature (it was bug), priority p2, area site. Fixed the typo 'bellow' -> 'below'.
2121
2222 The slider is the 'Active' row on /projects from 1020: today it is capped at max-w-md (448px) and sits after an 'Active' label, with the range printed to its right. The table below spans the full content width (up to 1440px minus padding). Related: 1020.
23+
24+- 2026-11-08 04:45Z (agent): Done: the Active slider on /projects now spans the full width of the table (1376px of 1376px at 1440, and 358px at 390). Above the track is one bar per month, 191 of them from 2011-01 to 2026-11. Each bar is as tall as the number of projects with commits that month, and the bars between the thumbs turn accent. The thumbs are bigger (1.25rem, ink border) and sit on a 3px ink track. The bars are inset by half a thumb so each lines up under its month's thumb position. H …
25+
26+ Files: templates/projects.html, assets/site.css (.range, #bars), static/projects.js (+4 lines).
27+
28+ Checked in agent-browser at 1440 light and dark and at 390: narrowing to 2016-01 – 2021-01 lights 61 bars, shows 11 projects, sets ?from=2016-01&to=2021-01, and leaves no horizontal scroll at 390. go vet and go test pass. Not checked: Firefox (the -moz thumb rules were updated the same way, but I didn't test in that browser) and keyboard dragging beyond focus.
tickets/attachments/1028/slider, narrowed to 2016-01 – 2021-01 (dark).png+0−0
Binary file, not shown.