Animation du taiji tournant
Un motif yin-yang dessiné et animé uniquement à partir de formes CSS.
Après activation de JavaScript, ce cas peut être modifié, exécuté et enregistré. Code source fixe ci-dessous :
<!doctype html>
<html lang="fr" dir="ltr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Animation du taiji tournant</title>
<style>
* { box-sizing: border-box; }
body { min-height: 100vh; margin: 0; display: grid; place-items: center; overflow: hidden; color: #1b1b19; font-family: "STKaiti", "KaiTi", serif; background: #e8e3d7; }
body::before { content: ""; position: fixed; inset: -20%; background: repeating-radial-gradient(circle at center, transparent 0 55px, rgba(50,46,39,.035) 56px 57px); }
main { position: relative; z-index: 1; width: min(700px, calc(100% - 40px)); text-align: center; }
.title { margin-bottom: 30px; }
.title span { color: #a44231; font: 800 11px/1 "Courier New", monospace; letter-spacing: .28em; }
h1 { margin: 10px 0 0; font-size: clamp(38px, 8vw, 68px); font-weight: 500; letter-spacing: .15em; }
.stage { position: relative; width: min(340px, 74vw); aspect-ratio: 1; margin: auto; display: grid; place-items: center; }
.rings, .rings::before, .rings::after { position: absolute; border: 1px solid rgba(38,35,30,.16); border-radius: 50%; }
.rings { inset: 0; animation: breathe 4s ease-in-out infinite; }
.rings::before { content: ""; inset: 22px; }
.rings::after { content: ""; inset: 44px; }
.taiji { width: 58%; aspect-ratio: 1; border: 1px solid #1b1b19; border-radius: 50%; background: radial-gradient(circle at 50% 25%, #171715 0 7%, #f7f5ed 7.5% 25%, transparent 25.5%), radial-gradient(circle at 50% 75%, #f7f5ed 0 7%, #171715 7.5% 25%, transparent 25.5%), linear-gradient(90deg, #f7f5ed 50%, #171715 50%); box-shadow: 0 14px 35px rgba(33,29,22,.18); animation: turn 9s linear infinite; }
.stage:hover .taiji { animation-play-state: paused; }
.caption { max-width: 440px; margin: 28px auto 0; color: #746d61; font-size: 15px; line-height: 1.8; }
.seal { position: absolute; right: 4%; bottom: 12%; display: grid; width: 50px; height: 50px; place-items: center; border: 2px solid #a44231; color: #a44231; font-size: 17px; line-height: 1; transform: rotate(5deg); }
@keyframes turn { to { transform: rotate(1turn); } }
@keyframes breathe { 50% { transform: scale(.96); opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .taiji, .rings { animation-play-state: paused; } }
</style>
</head>
<body>
<main>
<header class="title"><span>BALANCE IN MOTION</span><h1>Mouvement et immobilité se nourrissent l’un l’autre</h1></header>
<div class="stage" aria-label="Tai-chi en rotation lente"><div class="rings"></div><div class="taiji"></div></div>
<p class="caption">La rotation ne consiste pas à quitter le centre, mais à retrouver l’équilibre dans le changement. Survolez le symbole du taiji avec la souris pour le mettre temporairement en pause.</p>
<div class="seal" aria-hidden="true">et</div>
</main>
</body>
</html>