loopable / web /src /customer-grid /GalleryTimelineViews.css
fsanyoto's picture
Deploy AIOS web (React glide grid + FastAPI slice)
ce4ad7b verified
Raw History Blame Contribute Delete
5.7 kB
/* ⭐⭐ W50-T01 (R1) — a bounded column, so the window inside it can scroll.
The bar is OUTSIDE the scroller on purpose: with it inside, `scrollTop` would carry the bar's
height as an offset and every spacer measurement would start life wrong by that much. Out
here, `scrollTop === 0` is exactly the top of the first card, and the maths needs no fudge. */
.cg-gallery,
.cg-timeline {
display: flex;
flex-direction: column;
box-sizing: border-box;
height: 100%;
min-height: 0;
padding: var(--cg-mode-pad, 16px);
}
.cg-gallery-bar,
.cg-timeline-bar {
display: flex;
flex: 0 0 auto;
align-items: center;
gap: 8px;
min-height: 32px;
margin-bottom: 12px;
color: var(--lp-muted);
font-size: var(--lp-fs-2xs);
}
.cg-gallery-label,
.cg-timeline-label {
display: inline-flex;
align-items: center;
gap: 6px;
color: var(--lp-ink);
font-weight: 600;
}
.cg-gallery-count,
.cg-timeline-count {
font-variant-numeric: tabular-nums;
}
.cg-timeline-missing {
margin-left: auto;
color: var(--lp-yellow-deep);
background: var(--lp-yellow-tint);
border-radius: var(--lp-r-pill);
padding: 3px 8px;
font-variant-numeric: tabular-nums;
}
/* ⛔ ROW GAP IS ZERO, AND THAT IS THE WINDOW'S CONTRACT. Every card carries its own trailing
gap as a margin instead, so one card row occupies exactly `card height + gap` and a spacer
occupies exactly what it says. A grid `row-gap` would add a band above and below each spacer
too, and the drift it introduces grows with every scroll: the last card ends up unreachable.
The column count and both measurements come from the component as custom properties. */
.cg-gallery-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(var(--cg-gallery-card-min, 224px), 1fr));
column-gap: var(--cg-gallery-gap, 10px);
row-gap: 0;
align-content: start;
}
.cg-gallery-card,
.cg-timeline-card {
border: 0;
background: transparent;
color: inherit;
font: inherit;
text-align: left;
cursor: pointer;
}
.cg-gallery-card {
display: grid;
grid-template-columns: 36px minmax(0, 1fr);
gap: 10px;
align-items: start;
box-sizing: border-box;
height: var(--cg-gallery-card-h, 116px);
margin-bottom: var(--cg-gallery-gap, 10px);
overflow: hidden;
padding: 12px;
border: 1px solid var(--lp-line);
background: var(--lp-surface);
color: var(--lp-ink);
border-radius: var(--lp-r-md);
transition: transform 150ms ease-out, border-color 150ms ease-out, background 150ms ease-out;
}
.cg-gallery-mark {
display: grid;
place-items: center;
width: 36px;
height: 36px;
border-radius: var(--lp-r-sm);
color: var(--lp-blue-deep);
background: var(--lp-blue-tint);
}
.cg-gallery-copy,
.cg-timeline-card {
display: grid;
gap: 7px;
min-width: 0;
}
.cg-gallery-copy > strong,
.cg-timeline-card > strong {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: var(--lp-fs-sm);
font-weight: 600;
}
.cg-gallery-detail,
.cg-timeline-detail {
display: flex;
justify-content: space-between;
gap: 12px;
color: var(--lp-muted);
font-size: var(--lp-fs-3xs);
}
.cg-gallery-detail b,
.cg-timeline-detail b {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: var(--lp-ink);
font-weight: 500;
font-variant-numeric: tabular-nums;
}
/* ⚠ FLAT, and no gap. The month headings used to nest their events inside a section of their
own, which put two different gaps between an item and the one above it depending on where a
month started. One flat list of two known heights makes an item's offset a prefix sum, which
is what lets the spacers be exact at row 3,000 as well as at row 3. */
.cg-timeline-list {
display: grid;
gap: 0;
align-content: start;
}
.cg-timeline-month-head {
display: flex;
box-sizing: border-box;
align-items: flex-end;
height: var(--cg-tl-month-h, 34px);
margin: 0;
padding-bottom: 8px;
color: var(--lp-muted);
font-size: var(--lp-fs-2xs);
font-weight: 600;
}
.cg-timeline-event {
display: grid;
grid-template-columns: 72px minmax(0, 1fr);
gap: 12px;
box-sizing: border-box;
align-items: start;
height: var(--cg-tl-event-h, 142px);
}
.cg-timeline-date {
position: relative;
padding-top: 12px;
color: var(--lp-muted);
font-size: var(--lp-fs-3xs);
text-align: right;
}
.cg-timeline-date::after {
position: absolute;
top: 14px;
right: -18px;
width: 8px;
height: 8px;
border-radius: var(--lp-r-pill);
background: var(--lp-yellow-deep);
content: "";
}
.cg-timeline-card {
position: relative;
box-sizing: border-box;
align-content: start;
height: var(--cg-tl-card-h, 132px);
overflow: hidden;
padding: 11px 12px;
border: 1px solid var(--lp-line);
background: var(--lp-surface);
color: var(--lp-ink);
border-radius: var(--lp-r-md);
transition: transform 150ms ease-out, border-color 150ms ease-out, background 150ms ease-out;
}
.cg-timeline-card::before {
position: absolute;
top: -9px;
bottom: -9px;
left: -17px;
width: 1px;
background: var(--lp-line);
content: "";
}
.cg-gallery-card:focus-visible,
.cg-timeline-card:focus-visible {
outline: 2px solid var(--lp-blue-deep);
outline-offset: 2px;
}
@media (hover: hover) and (pointer: fine) {
.cg-gallery-card:hover,
.cg-timeline-card:hover {
border-color: var(--lp-blue-deep);
background: var(--lp-surface-2);
transform: translateY(-1px);
}
}
@media (prefers-reduced-motion: reduce) {
.cg-gallery-card,
.cg-timeline-card {
transition: none;
}
}
@media (max-width: 620px) {
.cg-timeline-event {
grid-template-columns: 58px minmax(0, 1fr);
gap: 10px;
}
}