Interactive Page to Video
This directory is the tool itself. A headless browser walks through the interactive page like a reader (scrolling, clicking, dragging – cursor is visible), recording the screen along the way, and produces a 1080p MP4 with voiceover.
Recording and compositing are automatic; you must write the script for each interactive page: understand the page, decide what to cover, what to cut, and what actions to perform on each step. This is the main effort.
lib/record.mjs– Recorder: opens the page, injects cursor and subtitles, captures frames into a video, records the page's own audio.lib/make.mjs– All-in-one for explainer mode: synthesize voiceover → drive interactions synchronized with voiceover duration → compose final video and subtitles.lib/voice.mjs+lib/tts.py– Voice cloning (IndexTTS-2).lib/subtitles.mjs– Subtitle splitting, duration estimation, silence detection (has tests, runnpm test).examples/demo/– A ready-to-run mini example (one small interactive page + its script); run it first to confirm the environment.examples/– Two more real-world examples of each type; they won't run as-is (they depend on their respective interactive page files), but show how to structure the code.
See README for environment setup. Intermediate files are written to work/, final output to out/, so run this from the directory where you want the video to appear.
Classification First
| A Explainer-Type | B Self-Voiced-Type | |
|---|---|---|
| Interactive page features | No voiceover, relies on reader reading and interacting | Has its own audio, sound effects, subtitles, auto-plays on scroll |
| Video's audio | Write a separate voiceover, clone the voice | Record the page's own audio; only add voiceover for text without audio |
| Example | examples/explainer-involution.mjs | examples/selfvoiced-jensen.mjs |
| Command | node lib/make.mjs <script>.mjs | node <script>.mjs |
To create a new episode: copy the relevant example and modify. The comments in the examples explain what each section does.
Principles
- Make a complete explainer video, not a teaser.
- Keep the pace tight: minimize silent parts. After rendering, check the list of