Generating Visual Art with Code: How LLMs Are Powering Front-End Animation
A wave of LLM-generated visual works—from a real-time 3D presentation with millions of views to hand-drawn anime shorts and 3D mini-games—has gone viral in developer communities. This article breaks down how large language models create animations through code rather than pixels, analyzes the technical stack behind a viral browser-rendered presentation, explains the shift from static infographics to dynamic narrative visuals, and offers a practical workflow for developers who want to build code-generated visual experiences, along with a sober look at the current limitations.
Recently, a batch of visual works generated by large language models has sparked heated discussion in overseas developer communities: a real-time rendered 3D presentation racked up millions of views, and other users created hand-drawn anime shorts and visually polished 3D mini-games using similar methods. What makes these works remarkable is that the underlying models cannot directly output video frames—the characters, scenes, transitions, and even background music are all implemented through front-end code written by the model.
This “visuals through code” capability didn’t appear out of nowhere. It’s the result of long-term evolution in both LLM coding abilities and browser rendering technology. This article systematically breaks down the trend across three dimensions: technical principles, implementation paths, and engineering practices.
1. How Can LLMs Create Animations Without “Drawing”?
To understand this phenomenon, you first need to distinguish two fundamentally different content generation paths:
- Pixel-level generation: Represented by video generation models, which directly output frame-by-frame images. The model learns “what the picture looks like.”
- Code-level generation: Large language models output HTML, CSS, JavaScript, and other code, and the browser’s rendering engine “translates” that code into visuals. The model learns “how to describe the picture.”
Code-level generation follows a clear pipeline:
User intent (natural language prompt)↓LLM interprets intent and generates code (HTML + CSS + JS)↓Browser parses and executes the code, rendering in real time↓Interactive dynamic visual work
The core advantage of this pipeline is that the model doesn’t need to memorize the pixels of every frame—it only needs to leverage the expressive power already built into the web standards ecosystem: CSS animations, Canvas drawing, WebGL 3D rendering, and SVG vector graphics. In other words, decades of accumulated browser graphics capabilities serve as the “exoskeleton” for LLM visual creation. The model’s job shifts from “drawing” to “programming the rendering pipeline,” which falls squarely within the code generation capabilities that large language models excel at.
2. Technical Breakdown of the Viral Presentation
Take the widely shared presentation from developer communities as an example. Its first few pages deliberately mimic the plain style of traditional slides, then the camera suddenly dives into 3D space—flat data charts gain spatial depth, and page turns become cinematic camera transitions. Yet the entire work is essentially just a ~5MB HTML file containing 13 scenes, rendered in real time in the browser.
From an engineering perspective, such works typically combine the following techniques:
- CSS 3D transforms and transitions: Properties like
transform,perspective, andtransitionallow DOM elements to translate, rotate, and scale in 3D space, creating the “camera push-in” effect. - Scroll-driven animation: Listening to scroll or page-turn events and mapping scroll progress to scene parameters creates a continuous narrative rhythm.
- Canvas / WebGL drawing: Data charts and complex graphics are drawn in real time by scripts rather than relying on static images, ensuring crispness at any resolution.
- Scene state machine: Code manages the switching logic between the 13 scenes, keeping transition timing and easing curves coordinated and consistent.
It’s worth noting the contrast with the past two years’ wave of “AI-generated PPT” tools. Most of them remain at the level of “generate copy + apply a template,” still producing traditional slides. Code-level generation breaks out of the “slide deck” conceptual framework entirely—the output is an interactive web application, closer to the custom demo animations seen at tech product launches, except the production cost drops from a professional team’s weeks of work to a single prompt plus a few rounds of iteration.
3. From Presentations to Dynamic Infographics: Upgrading the Narrative Structure
Another notable case is a work that presents the history of human civilization as a “dynamic scroll.” A traditional historical timeline is a static straight line annotated with major events by era. In this work, the entire picture continuously evolves as time progresses—content that was previously scattered across multiple pages is woven into one continuous visual narrative.
This reflects a paradigm shift in information design:
- Static infographics: Trading space for information—everything shown on one screen, with readers browsing on their own.
- Dynamic narrative visuals: Trading time for information—content is “performed” by code at a controlled rhythm, with the author controlling narrative order, dwell time, and visual focus.
For developers, the key to achieving this kind of effect is establishing a “data–time–visual” mapping model: abstract historical events into structured data, treat playback progress as the unified timeline variable, then drive state changes in each visual element through interpolation functions. This approach shares the same roots as scene management in game engines and animated transitions in data visualization.
4. How to Reproduce It: Practical Advice for Developers
If you want to try “generating visual works with code” in your own projects, here’s a workflow to follow:
- Decompose the requirement into a scene script: Have the model first output a scene list with each scene’s visual goal and transition method. Confirm the narrative structure before generating code, to avoid the loss of control that comes from one-shot generation.
- Generate in layers and iterate: Build the page skeleton and state management first, then fill in animation details scene by scene, previewing in the browser after each round of changes.
- Use constraint-oriented prompts: Explicitly specify the tech stack (pure HTML/CSS/JS or a general-purpose rendering library), performance constraints (file size, frame rate targets), and style references (cinematic camera work, hand-drawn style, etc.).
- Mind performance and size: Prefer CSS animations and
transform(which can trigger GPU acceleration); avoid large-scale reflows and repaints. Use vector graphics instead of bitmaps to control asset size. - Keep a human review step: Model-generated code needs to be validated in real browsers for compatibility and interaction details, and key rhythm points still require manual fine-tuning.
5. A Sober Look: Capability Boundaries and Realistic Expectations
While marveling at these works, it’s important to keep a few things in perspective:
- The success rate is not 100%: What communities showcase is often the best result from many attempts. Complex scene generation still requires multiple rounds of iteration and manual debugging.
- Aesthetic sense is scarce: The ability to generate “good-looking” work shows the model absorbed plenty of high-quality front-end visual practices during training, but originality of style and brand fit still depend heavily on human judgment.
- Code quality varies: Animation code from a single generation often falls short in maintainability and modularity, and needs refactoring before production use.
- Complementary to—not a replacement for—video generation models: When photorealistic lighting and physical detail are needed, video generation models are the better fit. When interactivity, real-time rendering, and controllable file size matter, code generation has a clear advantage.
Conclusion
The phenomenon of “LLMs making anime and presentations with code” is essentially a deep coupling between the programming capability of large language models and the browser’s mature graphics rendering ecosystem. It lowers the barrier to producing high-quality visual content, enabling developers without an art background to create dynamic works approaching professional quality. For enterprises, this means the content production cost of product demos, data reports, and brand storytelling could drop significantly. For developers, mastering the new skill of “orchestrating rendering pipelines with natural language” is becoming a worthwhile investment beyond prompt engineering. Code as creation—this path has only just begun to unfold.
