# Evaluating LLM Frontend Skills: What I Learned from Recreating a Web Particle Animation

    How do you really benchmark an LLM's frontend coding ability? This article walks through a hands-on experiment recreating a scroll-driven particle galaxy animation with multiple mainstream models, covering task design, prompt strategy, failure patterns, iteration techniques, and the core implementation details of particle sampling, scroll mapping with easing, and mouse interaction.

    Why It’s Worth Benchmarking LLM Frontend Skills Properly

    As large language models evolve rapidly in code generation, every vendor’s flagship model shows visibly improved programming capabilities. But there’s often a real gap between “impressive official demos” and “actually useful for my tasks.” As developers, rather than relying on marketing pages, it’s better to design a discriminating hands-on benchmark yourself.

    That’s exactly the experiment I ran recently: I picked a web animation task with high implementation difficulty and quantifiable visual results, and had multiple mainstream LLMs compete on it. This type of task has several natural advantages:

    • Visual results: Whether the animation looks right is immediately obvious—no complex acceptance criteria needed;
    • Long technical chain: It involves page analysis, code extraction, particle systems, scroll interactions, mouse events, and more, so it comprehensively tests model capability;
    • Can’t be memorized: The target effect comes from a dynamic page, so the model can’t simply regurgitate existing code—it has to genuinely understand the requirements.

    Below is a complete reconstruction of the experiment’s design, process, and conclusions.

    Task Design: Pick a “Hard Enough” Challenge

    Target Effect Description

    I chose a common “particle galaxy” animation, the kind popular on tech-focused landing pages. Its core features include:

    1. Particle clustering and scattering: A large number of tiny particles spread across the screen like a starfield;
    2. Scroll-driven morphing: As the page scrolls, particles gradually converge from a scattered state and eventually form a specific shape (such as a logo or text);
    3. Mouse interaction: When the mouse approaches or moves, particles respond with disturbance, follow, or repulsion effects;
    4. Multi-stage transitions: As scrolling passes different sections, particles switch between multiple target shapes with smooth interpolation in between.

    This task is “hard” because it simultaneously tests: abstract understanding of animation requirements, mathematical modeling of particle systems (target point sampling, easing functions, interpolation logic), and engineering handling of browser scroll and mouse events.

    Prompt Writing: Specify the Goal, Not the Method

    I deliberately kept my prompt minimal, with only three key pieces of information:

    • The target page has a particle animation that scatters and converges on scroll—when converged, it forms a specific shape; when scattered, it looks like stars; and it responds to the mouse;
    • The goal is to reproduce the effect as faithfully as possible;
    • The deliverable is a standalone page that can be opened and demonstrated directly.

    As for the implementation approach—whether to write it from understanding alone, or to fetch and analyze the page source—I placed no restrictions. This matters: leaving freedom in the method reveals differences between models in “tool calling” and autonomous decision-making.

    Interestingly, across several rounds of testing, nearly every model chose to first call built-in or local browser capabilities to fetch the target page’s source code, then analyze the code to replicate the effect. That decision is reasonable in itself, but it exposed a problem: the target page’s scripts are typically minified, obfuscated, and loaded in chunks, so reverse engineering offers poor return on effort. Some models burned many steps on this path with limited results, and would have been better served by a “look at the screenshot + understand the effect + implement from scratch” approach.

    Head-to-Head Comparison: Typical Differences Along the Way

    Common Gaps in the First Round

    Most models’ first-version results showed clear gaps from the target effect, mainly in:

    • Inaccurate shape reproduction: The target shape formed by converged particles differed significantly from the original, indicating rough handling of “how to sample target points from a shape”—for example, treating text outlines as particle targets without uniform point sampling;
    • Wrong animation pacing: The mapping between scroll and particle state was too linear and lacked easing, making the motion feel stiff;
    • Missing or distorted interaction: Mouse disturbance was either not implemented, or the force and radius didn’t match expectations.

    Root Causes of Failure

    Summarizing, first-version failures typically stemmed from three causes:

    1. Insufficient information gathering: The model’s understanding of the target effect came only from a text description or a single static screenshot, with no awareness of intermediate states;
    2. Greedy one-shot strategy: Trying to generate complete code in one pass, instead of building a skeleton first (particle system + scroll mapping) and then layering in details;
    3. No self-verification loop: After generating code, the model didn’t proactively open the page to compare results, so obvious deviations went uncorrected.

    Iterative Correction Is the Real Differentiator

    What truly separates models isn’t the first version—it’s the ability to iterate based on feedback. Strong performers, given feedback like “the shape is wrong, the motion is too stiff,” can accurately locate the problematic module (say, the target point sampling logic or the easing function) and make targeted fixes rather than sweeping rewrites. Weaker performers tend to introduce regressions during iteration: fix one thing, break two others.

    One practical prompt technique: when giving feedback, clearly state “which screen, what state, what’s expected, what actually happens.” Translating a vague “it doesn’t look right” into an actionable fix instruction makes a big difference.

    Core Implementation Techniques: How to Build This Kind of Animation

    From an engineering perspective, here are the key modules for replicating this type of particle animation—useful whether you’re implementing it yourself or evaluating a model’s output:

    Target Point Sampling

    Draw the target shape (such as text or a logo) onto an offscreen canvas, scan pixels on a grid, and uniformly sample non-transparent regions to get the set of particle target coordinates:

    1. function samplePoints(text, gap = 6) {
    2. const off = document.createElement('canvas');
    3. off.width = 800; off.height = 300;
    4. const ctx = off.getContext('2d');
    5. ctx.font = 'bold 200px sans-serif';
    6. ctx.fillText(text, 50, 220);
    7. const data = ctx.getImageData(0, 0, 800, 300).data;
    8. const pts = [];
    9. for (let y = 0; y < 300; y += gap) {
    10. for (let x = 0; x < 800; x += gap) {
    11. if (data[(y * 800 + x) * 4 + 3] > 128) {
    12. pts.push({ x: x + (Math.random() - 0.5) * 2,
    13. y: y + (Math.random() - 0.5) * 2 });
    14. }
    15. }
    16. }
    17. return pts;
    18. }

    Scroll Mapping and Easing

    Normalize scroll progress to [0, 1], then map it to the particles’ “scattered–converged” state through an easing function:

    1. const progress = Math.min(1, Math.max(0,
    2. (scrollY - start) / (end - start)));
    3. const t = easeInOutCubic(progress);
    4. particle.x = lerp(scatterX, targetX, t);
    5. particle.y = lerp(scatterY, targetY, t);

    Mouse Interaction

    For each particle, compute the distance to the mouse, apply a repulsion force within an interaction radius, and give particles inertia so they return to their target positions. This produces a natural “disturb–rebound” feel.

    Takeaways and Recommendations

    This experiment taught me three main lessons:

    1. Benchmark tasks should be visual, multi-step, and non-memorizable—only then do they expose a model’s true capability;
    2. Prompts should define the goal, not the method, and specific, concrete feedback drives iteration far better than expecting a one-shot perfect result;
    3. Don’t blindly trust the “tool calling” route: when facing minified, obfuscated production code, implementing from scratch based on an understanding of the effect is often more efficient.

    For teams using AI coding tools in production, I recommend building a small internal evaluation set: pick 3–5 discriminating real-world tasks, fix the prompts and acceptance criteria, and rerun the set every time a model version is updated. This answers the question “is this model actually good for my business?” far better than chasing leaderboard numbers.