Constructor
new PresentationSectionNav(navEl, listEl, toggleEl)
Parameters:| Name | Type | Description |
|---|
navEl | HTMLElement | The root |
listEl | HTMLElement | The list container inside the nav. |
toggleEl | HTMLElement | The mobile toggle button. |
Methods
Scrolls the page so that `el` appears just below the sticky waveform.
Parameters:| Name | Type | Description |
|---|
el | HTMLElement | Element to scroll into view. |
setActiveByTime(t)
Updates the highlighted section based on playhead time.
Parameters:| Name | Type | Description |
|---|
t | number | Current playback time in seconds. |
setOnNavigate(fn)
Sets a callback invoked with the section's start time when a nav item is clicked.
Parameters:| Name | Type | Description |
|---|
fn | function | Callback receiving the section's start time in seconds. |
Sets a function that returns the current scroll offset (in px) to leave above the section element — used to keep it visible below the sticky waveform.
Parameters:| Name | Type | Description |
|---|
fn | function | Returns the pixel offset to leave above the section element. |
setSections(sections)
Registers section elements from the rendered transcript and builds the nav list.
Parameters:| Name | Type | Description |
|---|
sections | Array.<{number: number, name: string, beforeSegStart: number, el: HTMLElement}> | Section descriptors derived from the rendered transcript. |