← back to Thinking about SVG-preloaderscompare with ground truth →
model output
Gemini 3 Flash Preview
Thinking about SVG-preloaders
A 0.74T 0.30
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>Circular Loading Animation</title>
7 <style>
8 body {
9 margin: 0;
10 display: flex;
11 justify-content: center;
12 align-items: center;
13 height: 100vh;
14 background-color: #050505;
15 /* Subtle grid pattern matching the video background */
16 background-image:
17 linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
18 linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
19 background-size: 18px 18px;
20 overflow: hidden;
21 }
22
23 .loader-container {
24 position: relative;
25 width: 100px;
26 height: 100px;
27 display: flex;
28 justify-content: center;
29 align-items: center;
30 /* Timing matches the ~1.5s revolution observed in the video */
31 animation: spin 1.5s linear infinite;
32 }
33
34 .dot {
35 position: absolute;
36 width: 8.5px;
37 height: 8.5px;
38 border-radius: 50%;
39 /* Smoothing the edges for a slightly soft look like the video */
40 box-shadow: 0 0 1px rgba(0,0,0,0.5);
41 }
42
43 @keyframes spin {
44 from { transform: rotate(0deg); }
45 to { transform: rotate(360deg); }
46 }
47 </style>
48</head>
49<body>
50
51 <div class="loader-container" id="loader"></div>
52
53 <script>
54 const loader = document.getElementById('loader');
55 const totalDots = 12;
56 const radius = 32; // Distance from center
57
58 /**
59 * Colors derived from the video frames:
60 * Starts at bright yellow and transitions through lime, green, teal, and blue
61 * before fading into the background.
62 */
63 const colors = [
64 '#f1c40f', // Bright Yellow (Head)
65 '#d4e157', // Lime
66 '#aed581', // Light Green
67 '#66bb6a', // Green
68 '#26a69a', // Teal
69 '#009688', // Dark Teal
70 '#00796b', // Deep Teal
71 '#004d40', // Very Dark Teal
72 '#1a1a1a', // Fade start
73 '#111111',
74 '#0a0a0a',
75 '#050505' // Tail end (Transparent/Black)
76 ];
77
78 for (let i = 0; i < totalDots; i++) {
79 const dot = document.createElement('div');
80 dot.className = 'dot';
81
82 // Positioning the dots in a circle.
83 // Negative i * 30 ensures dot 0 is the "head" and subsequent dots trail behind in clockwise rotation.
84 const angle = (i * 30);
85 const radians = (angle - 90) * (Math.PI / 180); // Start at 12 o'clock
86
87 const x = Math.cos(radians) * radius;
88 const y = Math.sin(radians) * radius;
89
90 // Apply calculated position
91 dot.style.left = `calc(50% + ${x}px - 4.25px)`;
92 dot.style.top = `calc(50% + ${y}px - 4.25px)`;
93
94 // Set color from the palette
95 dot.style.backgroundColor = colors[i];
96
97 // Replicate the "comet" trail effect:
98 // Leading dots are full size and opaque, trailing dots shrink and fade.
99 const fadeFactor = i / (totalDots - 1);
100 dot.style.opacity = Math.max(0, 1 - fadeFactor * 1.1);
101 dot.style.transform = `scale(${1 - fadeFactor * 0.4})`;
102
103 // Add a subtle glow to the leading dots
104 if (i < 5) {
105 dot.style.boxShadow = `0 0 6px ${colors[i]}66`;
106 }
107
108 loader.appendChild(dot);
109 }
110 </script>
111</body>
112</html>