Code-Driven Interactive Demo Narratives
Static slides present conclusions; they rarely walk an audience through space and time. This article explains why treating a presentation as a runnable front-end program—scenes, camera, charts, and pacing described in code—beats template decks, how to model scenes as composable state, where generative coding help should stop, and how to ship with performance, accessibility, and maintainability in mind.
Static slides have long been good at putting conclusions on screen, not at taking readers through a stretch of space and time. Smart writing tools and templates have automated titles, bullets, and palettes well enough, yet audiences still recognize the same layout: page-by-page cards, a fixed grid, almost no spatial or temporal continuity. The gap is not another skin. It is writing the demo itself as a runnable front-end program: scenes, camera, data graphics, and audio-visual rhythm described in code, with the browser drawing in real time.
Why “code as presentation” is worth a separate discussion
Traditional files bind layout, animation, and media in a proprietary container. Sharing depends on specific software; changing one motion often means rebuilding a timeline; diffs are nearly unreadable. A single-page app organized as markup, styles, and scripts is different:
- Scenes are data, not screenshots. Copy, camera parameters, chart data, and duration live in structured config and can be reviewed as diffs.
- Transitions are state changes. The previous scene’s coordinate system, palette, and camera can interpolate into the next instead of hard-cutting to a new page.
- Size stays manageable. With procedural geometry and textures that are procedural or moderately compressed, a dozen-plus scenes can stay in the low-megabyte range and ship on ordinary static hosting.
- Interaction can be progressive. Default to autoplay, or respond to scroll, keyboard, or clicks—useful for keynote replays, internal training, and product explainers.
Stay clear-eyed: large language models are good at generating and editing code, copy, and structure. They are not dedicated video generators. Stable, reproducible characters, scenes, and pacing still belong in executable drawing code, not in hoping a model emits a finished film.
Narrative first, then the stack
Before implementation, capture three things on one page so effects do not pile up first.
- The single judgment the audience must remember. Example: “complexity comes from state, not from page count.”
- Turning points on the timeline. Aim for 8 to 15 scenes. Too few cannot carry an arc; too many hurt loading, focus management, and accessibility.
- Each scene’s spatial commitment: a flat infographic, a pseudo-3D chart, or a full perspective scene. Raising the commitment raises performance and art cost nonlinearly; use it only at key turns.
A simple information architecture works: a scene list, global theme tokens, and a player state machine. The list describes what the scene must prove, not which filter to use. Tokens unify type size, line length, contrast, and motion duration so every scene does not invent its own magic numbers.
Scene model: slides as composable state
Each scene can look like this, with generic fields unbound to any framework:
scene:id: openingduration: 8scamera: { position, target, fov }layers:- type: typographyblocks: [kicker, title, one-sentence-claim]- type: chartencoding: { x: year, y: cost, series: region }- type: environmentmood: neutral-to-warmtransition:to: nextstyle: camera-dolly + cross-fade-labelsreducedMotion: cross-fade-only
The player does four things: resolve the current scene from time or scroll, normalize progress to 0–1, hand progress to interpolators, and preload at scene boundaries. Cinematic feel comes from a continuous camera and labels, not from unmaintainable timeline screenshots.
When a flat chart enters space, keep the same encodings: position, length, angle, and color still mean data. Perspective changes how you look, not what the numbers mean. A common pattern is lifting 2D marks onto a lightly receding plane and dollying the camera slowly. Axes, legends, and units must stay readable from any shot. If spatial distortion breaks the mapping from bar height to value, drop that shot.
Writing visual narrative so it is not a reskinned template
Effective coded demos usually go through three acts, not thirteen unrelated posters.
Open with restraint. A familiar title page builds trust; type, alignment, and whitespace follow reading habits. Viewers need to believe this is serious material before they accept camera motion.
The middle gathers scattered facts into one continuous change. For a history of civilization, a system evolution, or an incident review, do not open an isolated card per era. Let layers on the same canvas appear and fade: geography expanding, a stack stratifying, a metric curve growing. Time is the primary animation parameter; page turns are discrete samples of time.
Close on the judgment. The last scene should stand still on its own: one conclusion, one citable figure, a clear next step. After autoplay, the page should rest in a screenshot-ready state, not mid-transition.
Labels outrank the camera. Per scene, keep at most one main title, one claim, and one data encoding visible. If cinematic motion drowns the text, the demo fails. Motion duration belongs in a readable 300–800 ms band; camera moves across scenes can be longer but must be skippable.
The right boundary for generative assistance
Using a coding assistant is reasonable if you split work into what models do stably:
- Draft scene configs and copy hierarchy from an outline.
- Fill repeated layer components, interpolators, and theme tokens, with short comments.
- Check contrast, reduced-motion branches, keyboard focus order, and overflow.
- Generate chart encodings from a given table—do not invent data points.
Do not let generation decide: whether key numbers are true, whether the conclusion overreaches, brand and compliance language, or character performance that needs pixel-level art direction. A safer loop is: humans write outline and data; the assistant drafts scenes; humans accept scene by scene in the browser; the assistant edits config from those notes. Lock viewport size and check both wide desktop and common laptop widths so the piece does not exist only on an ultrawide canvas.
Performance, accessibility, and delivery
Realtime demos fail most often in three places: pulling all geometry and fonts on first paint, heavy layout on the main thread every frame, and unbounded particles or shadows. In practice, preload the next scene, subset fonts, thin chart data at build time, and offer static fallbacks for decorative 3D. Use frame time, not a subjective “looks smooth,” as the bar: keep a stable interval during interaction; prefer fewer faces over obvious stutter on complex shots.
Accessibility is not an extra page. Provide a reduced-motion switch that keeps only fades and instant positioning. Put every key conclusion in real text, not unselectable bitmaps on a canvas. Autoplay should pause by default. Keyboard should step scenes. Background music or SFX must default to mute, and the story must remain complete with sound off. Color cannot be the only encoding; charts need shape or labels.
A delivery checklist can stay short: a single page that opens offline or on static hosting; scene config separated from drawing code so copy can change alone; a size budget with CI alerts; a poster frame for channels that cannot autoplay; sources and generation time noted. Object storage fits versioned static packages; a CDN helps geographic open; logs and monitoring cover first-paint failure rate and average scene completion. These are general capabilities, not tied to a proprietary deck format.
How to know it worked
Success is not effect count. Ask four questions: with mute and reduced motion, is the conclusion still there; if you swap the data table, does the scene config stay largely intact; can a colleague insert a scene by editing config instead of a timeline; three months later, can you still explain why each shot exists. If not, pull expressiveness back toward readability.
Moving from a last boring slide to continuous visual narrative recasts presentation from a layout problem into a problem of state and time. Templates still fit daily status. When material will be rewatched and a complex system needs spatial continuity, describing scenes in code, rendering in the browser, and carrying every shot with accessible text is the more maintainable path. Assistants can speed drafting and refactoring; narrative judgment, data truth, and performance budgets still need a human signature.
