Skip to content

Commit 6bf1bdb

Browse files
DevBehindYouclaude
andcommitted
Fix hero atom: rotate the rig as one rigid group about the true centre
The three orbits were each animated at different speeds, and the CSS rotation (transform-origin:center with no transform-box) pivoted off-centre and overrode the SVG rotate(60)/rotate(120) attributes that gave the atom its symmetry. The result was a lopsided, drifting tangle. Now a single .spin group rotates the whole assembly about the viewBox centre (transform-box:view-box), so the even three-fold symmetry is preserved through the entire spin. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 94d4170 commit 6bf1bdb

1 file changed

Lines changed: 16 additions & 10 deletions

File tree

docs/index.html

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,12 @@
199199
/* atom */
200200
.atom-stage{display:grid;place-items:center}
201201
.atom{width:min(340px,80vw);aspect-ratio:1}
202-
.orbit{transform-origin:center;animation:spin 18s linear infinite}
203-
.orbit.b{animation-duration:26s;animation-direction:reverse}
204-
.orbit.c{animation-duration:34s}
205-
@keyframes spin{to{transform:rotate(360deg)}}
206-
@media (prefers-reduced-motion:reduce){.orbit{animation:none}}
202+
/* Rotate the whole rig as one rigid body, about the true centre (150,150).
203+
transform-box:view-box makes transform-origin:center resolve to the SVG
204+
viewBox centre, so the symmetry is preserved and nothing drifts. */
205+
.atom .spin{transform-box:view-box;transform-origin:center;animation:atomspin 34s linear infinite}
206+
@keyframes atomspin{to{transform:rotate(360deg)}}
207+
@media (prefers-reduced-motion:reduce){.atom .spin{animation:none}}
207208

208209
/* ---------- generic modules ---------- */
209210
.module{background:var(--surface);border:var(--hair);border-radius:4px;padding:26px}
@@ -374,11 +375,16 @@ <h1><span class="offset">ATOMIC NOTES</span></h1>
374375
</div>
375376
<div class="atom-stage">
376377
<svg class="atom" viewBox="0 0 300 300" role="img" aria-label="Atom mark">
377-
<g class="orbit a"><ellipse cx="150" cy="150" rx="120" ry="45" fill="none" stroke="#3A2FF0" stroke-width="3"/><circle cx="270" cy="150" r="9" fill="#3A2FF0"/></g>
378-
<g class="orbit b" transform="rotate(60 150 150)"><ellipse cx="150" cy="150" rx="120" ry="45" fill="none" stroke="#15171B" stroke-width="3"/><circle cx="270" cy="150" r="9" fill="#15171B"/></g>
379-
<g class="orbit c" transform="rotate(120 150 150)"><ellipse cx="150" cy="150" rx="120" ry="45" fill="none" stroke="#3A2FF0" stroke-width="3"/><circle cx="270" cy="150" r="9" fill="#3A2FF0"/></g>
380-
<circle cx="150" cy="150" r="22" fill="#15171B"/>
381-
<circle cx="150" cy="150" r="8" fill="#F4F5F1"/>
378+
<g class="spin">
379+
<ellipse cx="150" cy="150" rx="120" ry="44" fill="none" stroke="#3A2FF0" stroke-width="4"/>
380+
<ellipse cx="150" cy="150" rx="120" ry="44" fill="none" stroke="#15171B" stroke-width="4" transform="rotate(60 150 150)"/>
381+
<ellipse cx="150" cy="150" rx="120" ry="44" fill="none" stroke="#3A2FF0" stroke-width="4" transform="rotate(120 150 150)"/>
382+
<circle cx="270" cy="150" r="10" fill="#3A2FF0"/>
383+
<circle cx="90" cy="253.9" r="10" fill="#15171B"/>
384+
<circle cx="90" cy="46.1" r="10" fill="#3A2FF0"/>
385+
</g>
386+
<circle cx="150" cy="150" r="24" fill="#15171B"/>
387+
<circle cx="150" cy="150" r="9" fill="#F4F5F1"/>
382388
</svg>
383389
</div>
384390
</div>

0 commit comments

Comments
 (0)