PresentationSectionNav

Section navigator panel for presentation mode.

Constructor

new PresentationSectionNav(navEl, listEl, toggleEl)

Parameters:
NameTypeDescription
navElHTMLElementThe root
listElHTMLElementThe list container inside the nav.
toggleElHTMLElementThe mobile toggle button.

Methods

_scrollToEl(el)

Scrolls the page so that `el` appears just below the sticky waveform.
Parameters:
NameTypeDescription
elHTMLElementElement to scroll into view.

setActiveByTime(t)

Updates the highlighted section based on playhead time.
Parameters:
NameTypeDescription
tnumberCurrent playback time in seconds.

setOnNavigate(fn)

Sets a callback invoked with the section's start time when a nav item is clicked.
Parameters:
NameTypeDescription
fnfunctionCallback receiving the section's start time in seconds.

setScrollOffset(fn)

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:
NameTypeDescription
fnfunctionReturns the pixel offset to leave above the section element.

setSections(sections)

Registers section elements from the rendered transcript and builds the nav list.
Parameters:
NameTypeDescription
sectionsArray.<{number: number, name: string, beforeSegStart: number, el: HTMLElement}>Section descriptors derived from the rendered transcript.