Timeline on a brown branch with leaf-colored decade tags; solid featured entries; admin home in two alternating colors

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Zaldimmar 2026-09-30 16:26:38 -05:00
parent a397f3eac0
commit e5c14dffa3
5 changed files with 82 additions and 43 deletions

View file

@ -11,9 +11,10 @@
Forms, Tools, and Panel, which only exists for superadmins.
It asks for the wide admin column (adminWidth.tsx), like the
editor, so the cards run three across on a wide screen. Each
block takes a color from the palette (GROUPS), tinting its
cards and drawing its bar, so the groups read apart at a glance.
editor, so the cards run three across on a wide screen. The
blocks alternate between two palette colors (BLOCK_COLORS),
tinting their cards and drawing their bars, so neighboring groups
read apart at a glance.
The right-hand panel is deliberately inert. Nothing here
fetches, so the landing page can't be slow or half-broken on
@ -46,7 +47,7 @@ function NavCard({ item, color }) {
return (
<div
className="group relative flex flex-col border-l-4 p-5 transition-colors hover:brightness-[0.97]"
className="group relative flex flex-col border-l-4 p-5 shadow-sm transition-shadow hover:shadow-md"
style={{ borderColor: color, background: tintOf(color) }}
>
<div className="flex items-baseline gap-3">
@ -112,13 +113,12 @@ function PanelSection({ title, children }) {
/* The header's groups, in its order, each with its palette color.
Panel is drawn separately below, since only superadmins get it. */
const GROUPS = [
{ nav: DATA_NAV, color: PALETTE.teal[0] },
{ nav: PAGES_NAV, color: PALETTE.green[0] },
{ nav: FORMS_NAV, color: PALETTE.mint[2] },
{ nav: TOOLS_NAV, color: PALETTE.ink[2] },
];
const PANEL_COLOR = PALETTE.ink[1];
const BLOCK_COLORS = [PALETTE.teal[0], PALETTE.green[0]];
const GROUPS = [DATA_NAV, PAGES_NAV, FORMS_NAV, TOOLS_NAV].map((nav, index) => ({
nav,
color: BLOCK_COLORS[index % BLOCK_COLORS.length],
}));
const PANEL_COLOR = BLOCK_COLORS[GROUPS.length % BLOCK_COLORS.length];
const QUICK_ADD = [
{ to: "/admin/events/new", label: "New event" },

View file

@ -6,6 +6,7 @@ import {
type SortDirection,
} from '../../../lib/timeline.ts'
import TimelineYear from './TimelineYear.tsx'
import { leafColor, readableOn } from '../../../lib/color.ts'
type Props = {
decade: GroupedDecade
@ -31,7 +32,7 @@ export default function TimelineDecade({
aria-labelledby={`site-tl-decade-${decade.decade}`}
>
<header className="site-tl__decadeHead">
<span className="site-tl__decadeNum" aria-hidden="true">
<span className="site-tl__decadeNum" style={decadeColors(decade.decade)} aria-hidden="true">
{decadeLabel(decade.decade)}
</span>
<div>
@ -63,3 +64,11 @@ export default function TimelineDecade({
</section>
)
}
/* A decade's tag takes its leaves' color, the middle of the decade
(or this year, for the one still running), with text that reads
on it. */
function decadeColors(decade: number) {
const background = leafColor(Math.min(decade + 5, new Date().getFullYear()))
return { background, color: readableOn(background) }
}

View file

@ -18,17 +18,33 @@
--tl-accent: var(--color-link);
--tl-accent-soft: color-mix(in srgb, var(--tl-accent) 12%, transparent);
/* The rail is a branch: wood brown, the leaves on it. The one other
color outside the palette, with the autumn leaves. */
--tl-wood: #7a5236;
--tl-gutter: 5rem;
--tl-rail-x: 1.75rem;
--tl-rail-w: 2px;
--tl-rail-w: 3px;
--tl-branch: 0.75rem;
color: var(--tl-ink);
}
/* Lighter wood on a dark page. */
:root[data-theme="dark"] .site-tl {
--tl-wood: #a8805a;
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) .site-tl {
--tl-wood: #a8805a;
}
}
@media (max-width: 640px) {
.site-tl {
--tl-gutter: 3rem;
--tl-rail-x: 1rem;
--tl-branch: 0.4rem;
}
}
@ -47,13 +63,13 @@
bottom: 0;
left: var(--tl-rail-x);
width: var(--tl-rail-w);
background: var(--tl-rail);
background: var(--tl-wood);
}
.site-tl__decade--pre::before {
background: none;
border-left: var(--tl-rail-w) solid var(--tl-rail);
opacity: 0.35;
border-left: var(--tl-rail-w) solid var(--tl-wood);
opacity: 0.45;
}
/* Last decade fades out rather than stopping dead. */
@ -80,20 +96,16 @@
padding-block-start: 0.5rem;
}
/* The numeral is a tag on the rail: a dark block with white type,
centered on the line, so the rail runs into it and out again.
(It used to paint the page's color to hide the rail behind it,
which showed as a white box once sections went transparent.) */
/* The numeral is a tag off the rail, like a branch: a short slanted
stroke of the rail's wood runs up from the line to it, and the line
carries on past. Its color is the decade's leaves', set inline
(TimelineDecade.tsx). */
.site-tl__decadeNum {
position: relative;
z-index: 1;
justify-self: start;
width: fit-content;
margin-left: calc(var(--tl-rail-x) + (var(--tl-rail-w) / 2));
transform: translateX(-50%);
margin-left: calc(var(--tl-rail-x) + var(--tl-rail-w) + var(--tl-branch));
padding: 0.5rem 0.3rem;
background: var(--color-action);
color: #ffffff;
font-family: var(--font-display);
font-size: 0.9375rem;
font-weight: 700;
@ -104,9 +116,16 @@
text-orientation: sideways;
}
.site-tl__decade--pre .site-tl__decadeNum {
background: var(--color-tint);
color: var(--color-muted);
.site-tl__decadeNum::before {
content: '';
position: absolute;
top: 55%;
right: 100%;
width: calc(var(--tl-branch) + 0.2rem);
height: 3px;
background: var(--tl-wood);
transform-origin: right center;
transform: rotate(28deg);
}
.site-tl__decadeTitle {
@ -356,9 +375,6 @@ a.site-tl__entry:hover .site-tl__entryTitle {
background: var(--tl-accent);
}
.site-tl__kind--event {
}
.site-tl__kind--award {
clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}
@ -378,11 +394,14 @@ a.site-tl__entry:hover .site-tl__entryTitle {
margin-bottom: 0.5rem;
}
/* Solid, not a see-through tint: dark text on a tint on the
page's colored backdrop was hard to read. */
.site-tl__entry--featured {
grid-template-columns: minmax(0, 1fr);
padding: 1rem 1.125rem;
border-left: 2px solid var(--tl-accent);
background: var(--tl-accent-soft);
background: color-mix(in srgb, var(--tl-accent) 8%, var(--color-raised));
box-shadow: var(--shadow-sm);
}
.site-tl__entry--featured .site-tl__entryTitle {
@ -397,7 +416,7 @@ a.site-tl__entry:hover .site-tl__entryTitle {
}
a.site-tl__entry--featured:hover {
background: color-mix(in srgb, var(--tl-accent) 18%, transparent);
background: color-mix(in srgb, var(--tl-accent) 16%, var(--color-raised));
}
/* --- Empty state ----------------------------------------------- */
@ -484,8 +503,8 @@ a.site-tl__entry--featured:hover {
top: 1.25rem;
bottom: 0;
left: var(--tl-rail-x);
border-left: var(--tl-rail-w) solid var(--tl-rail);
opacity: 0.35;
border-left: var(--tl-rail-w) solid var(--tl-wood);
opacity: 0.45;
}
.site-tl__upcomingBtn {
@ -519,7 +538,7 @@ a.site-tl__entry--featured:hover {
place-items: center;
margin-left: calc(var(--tl-rail-x) - 7px + (var(--tl-rail-w) / 2));
font-size: 14px;
color: color-mix(in oklch, #00b83d 60%, #00521b);
color: #008f2f; /* the leaves' green (leafColor) */
}
.site-tl__upcomingLabel {
@ -585,7 +604,7 @@ a.site-tl__entry--featured:hover {
.site-tl__roster--featured {
padding: 0.5rem 1.125rem 1rem;
border-left: 2px solid var(--tl-accent);
background: var(--tl-accent-soft);
background: color-mix(in srgb, var(--tl-accent) 8%, var(--color-raised));
margin-top: -0.5rem;
}
@ -614,7 +633,6 @@ a.site-tl__entry--featured:hover {
.site-tl__personPhoto {
width: 1.75rem;
height: 1.75rem;
border-radius: 50%;
object-fit: cover;
background: var(--tl-accent-soft);
flex: none;