animation2code benchmark
For best compatibility, please view this dashboard in a Chrome browser.
← back to Thinking about SVG-preloaders

model output

Claude Sonnet 4.6

Thinking about SVG-preloaders

A 0.60T 0.16
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>Loading Animation</title>
7<style>
8  * {
9    margin: 0;
10    padding: 0;
11    box-sizing: border-box;
12  }
13
14  body {
15    background-color: #050505;
16    display: flex;
17    justify-content: center;
18    align-items: center;
19    min-height: 100vh;
20    overflow: hidden;
21  }
22
23  /* Subtle grid pattern like in the video */
24  body::before {
25    content: '';
26    position: fixed;
27    top: 0;
28    left: 0;
29    width: 100%;
30    height: 100%;
31    background-image: 
32      linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
33      linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
34    background-size: 20px 20px;
35    pointer-events: none;
36  }
37
38  .spinner {
39    position: relative;
40    width: 60px;
41    height: 60px;
42    animation: rotate 1.2s linear infinite;
43  }
44
45  .dot {
46    position: absolute;
47    width: 8px;
48    height: 8px;
49    border-radius: 50%;
50    top: 50%;
51    left: 50%;
52    margin-top: -4px;
53    margin-left: -4px;
54  }
55
56  @keyframes rotate {
57    from { transform: rotate(0deg); }
58    to { transform: rotate(360deg); }
59  }
60
61  @keyframes fade {
62    0%, 100% { opacity: 0.1; background-color: #0a1a3a; }
63    50% { opacity: 1; background-color: #1a7fff; }
64  }
65</style>
66</head>
67<body>
68<div class="spinner" id="spinner"></div>
69
70<script>
71  const spinner = document.getElementById('spinner');
72  const numDots = 10;
73  const radius = 28;
74
75  for (let i = 0; i < numDots; i++) {
76    const dot = document.createElement('div');
77    dot.classList.add('dot');
78
79    // Position dots in a circle
80    const angle = (i / numDots) * 2 * Math.PI - Math.PI / 2;
81    const x = Math.cos(angle) * radius;
82    const y = Math.sin(angle) * radius;
83
84    dot.style.transform = `translate(${x}px, ${y}px)`;
85
86    // Stagger the fade animation
87    const delay = (i / numDots) * 1.2;
88    dot.style.animation = `fade 1.2s ease-in-out ${delay}s infinite`;
89
90    // Size variation - dots near the "head" are slightly larger
91    const size = 6 + (i / numDots) * 3;
92    dot.style.width = size + 'px';
93    dot.style.height = size + 'px';
94    dot.style.marginTop = -(size / 2) + 'px';
95    dot.style.marginLeft = -(size / 2) + 'px';
96
97    spinner.appendChild(dot);
98  }
99</script>
100</body>
101</html>