|
199 | 199 | /* atom */ |
200 | 200 | .atom-stage{display:grid;place-items:center} |
201 | 201 | .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}} |
207 | 208 |
|
208 | 209 | /* ---------- generic modules ---------- */ |
209 | 210 | .module{background:var(--surface);border:var(--hair);border-radius:4px;padding:26px} |
@@ -374,11 +375,16 @@ <h1><span class="offset">ATOMIC NOTES</span></h1> |
374 | 375 | </div> |
375 | 376 | <div class="atom-stage"> |
376 | 377 | <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"/> |
382 | 388 | </svg> |
383 | 389 | </div> |
384 | 390 | </div> |
|
0 commit comments