callbacks

Focus change callback and audio playback JavaScript for the alignment card stack

Audio Config

Web Audio API manager configuration for the alignment instance.

Auto-Play Toggle JS

Named function for the A key KeyAction — toggles auto-navigate state, syncs the checkbox, and swaps bg-error/bg-success color classes.

Combined Callbacks Script

Wraps the card stack library’s JS generator with Web Audio API focus change callback from cjm-fasthtml-web-audio.


source

generate_align_callbacks_script


def generate_align_callbacks_script(
    ids:CardStackHtmlIds, # Card stack HTML IDs
    button_ids:CardStackButtonIds, # Card stack button IDs
    config:CardStackConfig, # Card stack configuration
    urls:CardStackUrls, # Card stack URL bundle
    container_id:str, # ID of the alignment container (parent of card stack)
    focus_input_id:str, # ID of hidden input for focused chunk index
    should_play_fn:str='', # Consumer-defined play guard function name (overrides default zone guard)
)->any: # Script element with all JavaScript callbacks

Generate JavaScript for alignment card stack with Web Audio API audition.