animation2code benchmark
For best compatibility, please view this dashboard in a Chrome browser.
← back to Nice spinny stuff

model output

Claude Sonnet 4.6

Nice spinny stuff

A 0.77T 0.31
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>Pink Dots Animation</title>
7<style>
8  * { margin: 0; padding: 0; box-sizing: border-box; }
9  
10  body {
11    background: white;
12    width: 1024px;
13    height: 768px;
14    overflow: hidden;
15  }
16
17  .container {
18    position: absolute;
19    left: 160px;
20    top: 160px;
21    width: 0;
22    height: 0;
23    animation: rotate 1.8s linear infinite;
24  }
25
26  @keyframes rotate {
27    from { transform: rotate(0deg); }
28    to { transform: rotate(360deg); }
29  }
30
31  .dot {
32    position: absolute;
33    border-radius: 50%;
34    background: #ffb6c1;
35    transform-origin: center center;
36  }
37
38  /* Dots placed around a circle of radius ~30px */
39  /* Large dots at one side, small trailing dots */
40  /* Using 8 dots at different angles with varying sizes */
41</style>
42</head>
43<body>
44<canvas id="c"></canvas>
45<script>
46  const canvas = document.getElementById('c');
47  canvas.width = 1024;
48  canvas.height = 768;
49  const ctx = canvas.getContext('2d');
50
51  const cx = 160, cy = 160;
52  const radius = 28;
53  const color = '#ffb6c1';
54
55  // Define dots: angle offset from "head", size
56  // Head is the large dot, trailing dots get smaller
57  const dots = [
58    { angleOffset: 0,    size: 9 },   // largest - head
59    { angleOffset: 25,   size: 7.5 }, // second large
60    { angleOffset: 48,   size: 6 },   // medium
61    { angleOffset: 68,   size: 4.5 }, // smaller
62    { angleOffset: 85,   size: 3.5 }, // small
63    { angleOffset: 100,  size: 2.8 }, // smaller
64    { angleOffset: 113,  size: 2.2 }, // tiny
65    { angleOffset: 124,  size: 1.8 }, // tinier
66    { angleOffset: 133,  size: 1.4 }, // tiniest
67  ];
68
69  let angle = 0;
70
71  function draw() {
72    ctx.clearRect(0, 0, canvas.width, canvas.height);
73
74    dots.forEach(dot => {
75      const a = (angle - dot.angleOffset) * Math.PI / 180;
76      const x = cx + radius * Math.cos(a);
77      const y = cy + radius * Math.sin(a);
78
79      ctx.beginPath();
80      ctx.arc(x, y, dot.size, 0, Math.PI * 2);
81      ctx.fillStyle = color;
82      ctx.fill();
83    });
84
85    angle += 2.5; // degrees per frame ~60fps => ~1.5s per revolution
86    requestAnimationFrame(draw);
87  }
88
89  draw();
90</script>
91</body>
92</html>