animation2code benchmark
For best compatibility, please view this dashboard in a Chrome browser.
← back to CSS3 loading animations

model output

Claude Sonnet 4.6

CSS3 loading animations

A 0.65T 0.24
compare with ground truth →
1<!DOCTYPE html>
2<html lang="en">
3<head>
4<meta charset="UTF-8">
5<meta name="viewport" content="width=device-width, initial-scale=1.0">
6<title>Red Dots Animation</title>
7<style>
8  * { margin: 0; padding: 0; box-sizing: border-box; }
9  body {
10    background: #0a0a0a;
11    width: 100vw;
12    height: 100vh;
13    overflow: hidden;
14  }
15  canvas {
16    display: block;
17  }
18</style>
19</head>
20<body>
21<canvas id="c"></canvas>
22<script>
23const canvas = document.getElementById('c');
24const ctx = canvas.getContext('2d');
25canvas.width = window.innerWidth;
26canvas.height = window.innerHeight;
27
28// From frames: dots appear near (512, 45) area, rotating/spinning
29// The cluster of ~3-4 red dots spins around a center point
30// Center approximately at (510, 48) in 1024x768 scale
31// Scale to current canvas
32const scaleX = canvas.width / 1024;
33const scaleY = canvas.height / 768;
34
35const cx = 512 * scaleX;
36const cy = 48 * scaleY;
37
38// 3 dots arranged in a small cluster, rotating
39const numDots = 3;
40const radius = 6 * scaleX; // orbit radius
41const dotSize = 1.5 * scaleX;
42
43let angle = 0;
44const speed = 0.08; // radians per frame at ~30fps
45
46function draw() {
47  ctx.clearRect(0, 0, canvas.width, canvas.height);
48  
49  // Dark background
50  ctx.fillStyle = '#0a0a0a';
51  ctx.fillRect(0, 0, canvas.width, canvas.height);
52  
53  // Draw rotating red dots
54  for (let i = 0; i < numDots; i++) {
55    const a = angle + (i * Math.PI * 2 / numDots);
56    const x = cx + Math.cos(a) * radius;
57    const y = cy + Math.sin(a) * radius * 0.5; // slightly elliptical
58    
59    // Glow effect
60    const grd = ctx.createRadialGradient(x, y, 0, x, y, dotSize * 3);
61    grd.addColorStop(0, 'rgba(255, 0, 0, 0.9)');
62    grd.addColorStop(0.4, 'rgba(200, 0, 0, 0.5)');
63    grd.addColorStop(1, 'rgba(100, 0, 0, 0)');
64    
65    ctx.beginPath();
66    ctx.arc(x, y, dotSize * 3, 0, Math.PI * 2);
67    ctx.fillStyle = grd;
68    ctx.fill();
69    
70    // Core dot
71    ctx.beginPath();
72    ctx.arc(x, y, dotSize, 0, Math.PI * 2);
73    ctx.fillStyle = 'rgba(255, 60, 60, 1)';
74    ctx.fill();
75  }
76  
77  angle += speed;
78  requestAnimationFrame(draw);
79}
80
81draw();
82</script>
83</body>
84</html>