{ for (const vis of visualisers) { schedule_resize(vis) } }} /> { if (document.hidden) { next_vis.toy?.pause() main_vis.toy?.pause() } else { main_vis.toy?.play() if (transition) { next_vis.toy?.play() } } }} /> { e.showModal() }} onclose={() => { on_close() }} onkeydown={(e) => { if (check_modifiers(e, {})) { let shader_index = transition?.next_shader_index ?? current_shader_index if (e.key === 'ArrowLeft') { transition_to_shader((shader_index - 1 + shaders.length) % shaders.length, false) } else if (e.key === 'ArrowRight') { transition_to_shader((shader_index + 1) % shaders.length, false) } else if (/^[1-9]$/.test(e.key)) { transition_to_shader(Math.min(parseInt(e.key) - 1, shaders.length - 1), false) } else { show_player_temporarily() } } }} >
{#each visualisers as vis} { vis.canvas = canvas if (vis.is_main && !vis.toy) { const toy_result = shader_toy_lite(canvas) if (!toy_result.data) { error_popup(toy_result.error) on_close() return } const toy = toy_result.data toy.set_common('') toy.set_image({ source: image_shader, iChannel0: 'A' }) toy.set_buffer_a({ source: shaders[0].shader }) toy.play() vis.toy = toy } }} > {/each} {#if !vis_epilepsy_warning_dismissed}

⚠️ Epilepsy Warning ⚠️

{ if (check_shortcut(e, ' ')) { e.preventDefault() on_close() } else if (check_shortcut(e, 'Enter')) { e.stopPropagation() // prevent player from revealing dismiss_vis_epilepsy_warning() } }} >
{/if} {#if show_player}
{ show_player = true clearTimeout(hide_player_timeout) }} onmouseleave={show_player_temporarily} >
{/if}