Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/starpod/DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ The stage lists the episode's hosts (configured order, then guest hosts) and gue
One portrait everywhere a person appears (`people.css`, `PersonFace.astro`): a circle in a 2px ring of their voice (Voice 0 or Voice 1 when they speak as one, Line Strong otherwise), 2px clear of the photo, with the hairline over it. While their line is live (wherever they appear, the transcript's speaker card included) the ring brightens to the accent with a soft halo, by opacity alone; under reduced motion a small "Speaking" label shows instead. The line under a name says something, the first that applies (`personFact`): "First time on the show", "3rd appearance · first on Ep 112", "Host · 106 episodes"; away from an episode, role and tally. Compact rows are 32px portraits with the name at 14/18 600.

### Episode bar
A 56px bar below the stage that sticks once it reaches the top, taking the top bar's blurred glass while stuck. Section links are muted 650 pills; the current section is tracked by the browser (`scroll-target-group`) and marked by one Accent Wash pill anchored to that link, which glides between links on the spring. Once the stage's meta has scrolled away, a scroll trigger grows the episode's ink play disc and title in from the left, the disc, number and name arriving in that order. While this episode is the one loaded, the disc's ring fills with `--live-progress` from the media clock bound on that ring alone (`data-props-for="media-clock"`), in the accent while playing and Muted while paused (`--live-paused`), pushing the links over; scrolling back reverses it. A 2px Line Strong rule along the lower edge fills with reading progress. When the links overflow, their edges fade only on the side with more.
A 56px bar below the stage that sticks once it reaches the top, taking the top bar's blurred glass while stuck. Section links are muted 650 pills; the current section (the last one whose top has reached the bar) is marked by `aria-current` and one Accent Wash pill anchored to that link, which glides between links on the spring. Once the stage's meta has scrolled away, a scroll trigger grows the episode's ink play disc and title in from the left, the disc, number and name arriving in that order. While this episode is the one loaded, the disc's ring fills with `--live-progress` from the media clock bound on that ring alone (`data-props-for="media-clock"`), in the accent while playing and Muted while paused (`--live-paused`), pushing the links over; scrolling back reverses it. A 2px Line Strong rule along the lower edge fills with reading progress. When the links overflow, their edges fade only on the side with more.

### Transcript turns
Each paragraph that opens with a timestamp is a turn: a 7rem gutter (5.5rem for feed transcripts, which carry no speakers) holds the seek chip and the speaker's name in their voice's face. A long turn's head is sticky while the turn is on screen, trailing a fading rule down the rest of the turn once stuck. The turn being heard takes the Accent Wash with an accent chip. A "Now" ink pill sticks to whichever screen edge the live turn is past, only once all of it is off screen, and points to it. Long transcripts come in groups of 20 turns that skip rendering off screen, which keeps them at the display's frame rate while playing; an unrendered group holds the first group's measured height, and a section link that glides past groups re-aims once they have rendered. Hovering a name (or focusing a chip) shows the person on a Float card above it, or below it when the name is stuck under the bar.
Expand Down
35 changes: 10 additions & 25 deletions packages/starpod/src/components/episode/SectionBar.astro
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ const { label, sections } = Astro.props;
)
}
<nav aria-label={label} class="ep-nav relative min-w-0 flex-1 overflow-x-auto overscroll-x-contain" data-ep-nav>
<ol class="flex w-max scroll-target-group gap-0.5 py-1">
<ol class="flex w-max gap-0.5 py-1">
{
sections.map((section) => (
<li>
<a
class="relative z-1 block rounded-full px-[0.85rem] py-[0.45rem] text-md font-demibold whitespace-nowrap text-muted no-underline transition-[color] duration-300 ease-out hover:text-ink target-current:text-accent-ink target-current:anchor-name-[--ep-here] pointer-coarse:flex pointer-coarse:min-h-11 pointer-coarse:items-center"
class="relative z-1 block rounded-full px-[0.85rem] py-[0.45rem] text-md font-demibold whitespace-nowrap text-muted no-underline transition-[color] duration-300 ease-out hover:text-ink aria-current:text-accent-ink aria-current:anchor-name-[--ep-here] pointer-coarse:flex pointer-coarse:min-h-11 pointer-coarse:items-center"
href={`#${section.id}`}>{section.label}</a>
</li>
))
Expand All @@ -49,10 +49,10 @@ const { label, sections } = Astro.props;

let tracking: AbortController | undefined;

// CSS shows where you are (`:target-current`); this mirrors it into
// `aria-current` once scrolling settles, keeps the current link in view
// when the links overflow, and stands in for `scroll-target-group` in
// browsers without it.
// Marks the current section's link with `aria-current` (the indicator
// anchors to it) and keeps that link in view when the links overflow.
// Not `scroll-target-group`: under load Chromium stopped updating
// `:target-current`, leaving the mark on a section scrolled away from.
function track() {
tracking?.abort();
const nav = document.querySelector<HTMLElement>('[data-ep-nav]');
Expand Down Expand Up @@ -203,25 +203,10 @@ const { label, sections } = Astro.props;
requestAnimationFrame(tick);
}

if (CSS.supports('scroll-target-group', 'auto')) {
const sync = () =>
show(links.find((link) => link.matches(':target-current')));
sync();
// :target-current catches up with a scroll two frames after it ends
// (read at once, a jump, as with reduced motion, left aria-current one
// section behind the indicator).
addEventListener(
'scrollend',
() => requestAnimationFrame(() => requestAnimationFrame(sync)),
{ signal }
);
return;
}

// Without it: the last section whose top has reached the line a link
// lands it on, just under the bar (its scroll margin plus the page's
// scroll padding), rechecked whenever a section crosses that line. (A
// looser line marked the section after a short one that a link had
// The current section is the last one whose top has reached the line a
// link lands it on, just under the bar (its scroll margin plus the
// page's scroll padding), rechecked whenever a section crosses that line.
// (A looser line marked the section after a short one that a link had
// just landed on.)
const targets = links.map((link) =>
document.getElementById(decodeURIComponent(link.hash.slice(1)))
Expand Down
2 changes: 1 addition & 1 deletion packages/starpod/src/components/media/engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ async function loadSource(
return;
}
if (HlsClass?.isSupported()) {
hls = new HlsClass({ startPosition: startAt });
hls = new HlsClass({ startPosition: startAt, capLevelToPlayerSize: true });
hls.on(HlsClass.Events.ERROR, (_event, data) => data.fatal && recover(source));
hls.loadSource(episode.video.src);
hls.attachMedia(video);
Expand Down
12 changes: 2 additions & 10 deletions packages/starpod/src/styles/episode.css
Original file line number Diff line number Diff line change
Expand Up @@ -333,16 +333,8 @@
}
}

/* You are here: the browser tracks the current section (scroll-target-group)
and the link for it (target-current:) becomes the anchor. One indicator
glides between links on that anchor; nothing is measured. */
@supports not (scroll-target-group: auto) {
.ep-nav a[aria-current] {
anchor-name: --ep-here;
color: var(--accent-ink);
}
}

/* You are here: the current link (aria-current:) is the anchor, and one
indicator glides between links on it. */
.ep-nav-here {
position: absolute;
position-anchor: --ep-here;
Expand Down
6 changes: 0 additions & 6 deletions packages/starpod/src/styles/utilities.css
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,6 @@
animation-range: --value([*]);
}

@utility scroll-target-group {
scroll-target-group: auto;
}

@custom-variant target-current (&:target-current);

/* ---------- View transitions ----------
The ::view-transition-* rules hang off the root and stay CSS. */
@utility vt-name-* {
Expand Down
Loading