How Large Language Models Build Interactive Presentations with Code

    Large language models can generate code for interactive presentations built around scenes, state, and time rather than static slides. This article explains how to plan the narrative, separate content from rendering, coordinate animation, and validate performance and accessibility—while keeping generated code maintainable and visual claims grounded.

    1. From Slide Layouts to Scene Orchestration

    Traditional presentations use slides as the unit of editing: place headings, charts, and images on each page, then assign entrance or exit effects. Code-driven presentations can instead use scenes, state, and time as their editing units. An object does not have to disappear when the presentation advances. It can remain on screen and take on a new narrative role as the camera moves, data changes, or the audience interacts.

    Consider a presentation about the future of artificial intelligence. It might open with a simple trend chart. As the explanation progresses, a selection frame highlights one point on the chart, expands to surround the entire chart, and finally becomes the boundary of the next scene. What makes this transition work is not the number of effects. It is the frame’s recognizable shape throughout the transformation, which tells the audience where to direct their attention. The program updates the object’s scale, position, and visible area, while the visual experience suggests that one concept is being progressively enlarged.

    This also explains why visual presentation does not necessarily require an image generation model. A large language model can generate code that describes geometric shapes, layouts, animation curves, camera paths, and interaction rules. The browser then renders the visuals at runtime. The model’s useful role is not to guarantee that every frame looks good, but to turn some visual ideas into executable, adjustable, repeatable rules. For photorealistic materials or complex character performances, a code-only approach may not be the most economical choice.

    2. Write the Narrative Before Generating the Visuals

    “Make the most impressive presentation possible” can be useful for exploring styles, but it does not define a project with clear acceptance criteria. If the model decides the topic, visuals, interactions, and implementation in a single pass, two problems often emerge: the opening scenes are elaborate but later scenes lack a consistent visual language, or the presentation runs without making clear what each animation explains.

    A more reliable approach is to create a scene card for each segment, specifying four things:

    • What the audience should take away. Give each scene one central point, such as “improvements in capability do not imply an equivalent increase in societal impact.”
    • Which visual explains or supports that point. Two illustrative curves representing technical progress and adoption can communicate their differences more clearly than abstract lighting effects.
    • What the audience or presenter can control. If an assumption is adjustable, identify which curve it changes and which conditions remain fixed.
    • How the scene begins and ends. Specify which objects carry over from the previous scene, how the next scene continues, and whether an unfinished animation can be skipped.

    When discussing future trends, explicitly distinguish observed facts, scenario assumptions, and conceptual illustrations. A growth curve without supporting data can illustrate a feedback relationship, but it should not carry seemingly precise years or growth rates that encourage the audience to treat it as a forecast. Including this requirement in the script is more effective than adding a disclaimer at the end: it directly shapes chart scales, labels, and explanatory language.

    3. Separate Content, State, and Rendering

    A common maintenance problem in code-driven presentations is mixing headings, event handling, and animation parameters in the same block of logic. Changing a sentence can disrupt the layout; adding a back button can leave an earlier scene’s animation running. A more practical architecture separates the presentation into three relatively independent layers.

    Content: What the Presentation Says

    Store chapter order, text, data, units, and scenario descriptions separately. When data needs updating, change its definition rather than searching for a coordinate inside the curve-drawing code. Maintain chart annotations and alternative text alongside the data so that the visual does not change while its explanation remains outdated.

    State: Where the Presentation Is Now

    Track the current scene, playback progress, and selected parameters centrally. Keyboard input, buttons, and touch controls should all use the same state logic to switch scenes rather than modifying the display independently.

    Decide early whether returning to a scene restores its previous state or restarts it. Likewise, determine whether pressing “next” twice quickly skips a scene or waits for the current transition to finish. Without explicit rules, the displayed scene and progress indicator can fall out of sync during a live presentation.

    Rendering: How the Presentation Appears

    Use semantic web elements for body text, links, and buttons where possible. Vector rendering is suitable for two-dimensional graphics that need individual labels, scaling, and interaction. A drawing canvas can handle dense particles, continuous drawing, or three-dimensional camera movement.

    Choose a rendering method based on clarity, interaction, and performance—not on which option looks most impressive. Even when a chart is drawn on a canvas, its summary, key values, and focusable controls can be provided outside that canvas.

    Scene lifecycle management is equally important. Start a scene’s animations when it is entered. On exit, cancel unfinished tasks, remove temporary event handlers, and stop audio that is no longer needed. Otherwise, jumping from a middle chapter back to the beginning can expose problems that uninterrupted playback hides: timers from the previous scene continue writing state, background audio overlaps, or hidden scenes keep rendering.

    4. Coordinate Animations and Transitions with a Shared Time Base

    If a camera sequence relies on several independent delays, speeding up the opening may leave captions appearing on the old schedule. Motion that advances by a fixed amount per frame can also slow down when a device cannot render fast enough.

    A more reliable approach calculates animation progress from elapsed time within the scene, then derives position, opacity, captions, and other properties from that shared progress. Sections that support scrubbing should also be able to reconstruct the display directly at any progress value, without first playing every intermediate frame.

    Transitions should have a clear purpose. When explaining how the same object relates across different scales, preserve its outline or position as a visual reference. When introducing an unrelated point, a direct cut is often clearer than a forced transformation.

    To assess whether an animation is necessary, first inspect its static keyframes. If the presentation stops at the beginning and end, can a viewer explain what changed and why? If not, revise the information structure before adding more movement.

    Audio is an optional presentation layer, not the only channel for conveying information. Code can synthesize simple notification sounds or background rhythms, but browsers may require a user interaction before allowing playback. Provide explicit controls to enable and mute sound, and convey essential information through captions or visuals as well. The presentation should remain usable even when the venue has no connected speakers.

    5. Design Fallbacks and Acceptance Tests for Real Playback Conditions

    Smooth playback on a development machine does not guarantee smooth playback on a conference-room projector or mobile device. Focus testing on the most complex scenes and the most likely disruptive actions, rather than only playing the presentation from start to finish.

    Along with frame timing, check input responsiveness and whether memory usage keeps growing during long sessions or repeated scene changes. When stuttering occurs, first determine whether the cause is rendering load, frequent layout calculations, or resources left running after a scene exits. Then decide whether to reduce particle counts, lower rendering resolution, or simplify three-dimensional shadows. At every fallback level, body text, legends, and navigation must remain clear and usable.

    Accessibility and fault tolerance can share a single set of acceptance criteria:

    1. Predictable navigation. Users should be able to enter the presentation, jump between chapters, and exit using only a keyboard. Focus must remain visible and must not move to a hidden control after a scene change.
    2. Reduced motion. Respect the system’s reduced-motion preference and provide a version with less camera movement, rotation, and zoom. Reduce motion, not information.
    3. Reliable random access. Test opening a middle chapter directly after a refresh, going back during an animation, switching rapidly between scenes, and returning after temporarily leaving the page.
    4. Independently usable content. Provide static handouts or a print layout for the main chapters. If the venue’s network may be unreliable, prepare a version that runs locally. Because static handouts cannot preserve interactive state, choose representative outcomes and explain them.

    6. Give the Model Verifiable Tasks, Not the Entire Production

    A practical collaboration sequence starts with a narrative outline and sketches of key visuals. Next, implement a small group of adjacent scenes to verify that the visual language and transitions work. Then stabilize navigation, the timeline, and scene cleanup before expanding the remaining chapters and adding sound or visual refinements.

    Compared with asking the model to generate the entire project at once, this sequence reveals costly problems earlier. The main risk is often not an impossible particle effect, but a dozen scenes that already depend on the same difficult-to-change state logic.

    When reviewing generated code, prioritize the parts that affect delivery:

    • Does each scene have separate entry and exit logic?
    • Are there unnecessary requests for external resources?
    • Are data sources kept separate from illustrative parameters?
    • Could changing a shared transition break other chapters?

    The easier it becomes to generate visual prototypes, the more important these review standards become. Otherwise, time saved during production may be lost during integration and troubleshooting at the venue.

    Code-driven presentations will not replace ordinary slides. Static pages are often simpler when the content is primarily a linear report, many people need to edit it frequently, or broad file compatibility matters.

    The strongest use case is when the process of change is itself the point: the audience needs to see how an assumption changes an outcome, how an object remains connected across scales, or how several conditions jointly drive a system’s evolution. In those cases, animation and interaction are not decorative extras. They are part of the explanation.