MOTION / 024
Figure eight
8の字をたどる
左右の輪を巡り、8の字の軌跡を描きます。
実際のHTML・CSSで描かれた見本です。
ひとつ試すなら
どこが変わるかを観察して、似た表現と見比べてみよう。
こんなときに
移動経路の違いや、反復する流れを示すとき。
仕組みと使い方
この見本は複数の位置を結んで軌道を近似しています。
対応状況は使用する機能と端末により異なります。公式資料も参照してください。
表現名には通称や説明のための名称を含みます。デモと掲載コードはこの図鑑のオリジナルです。作者について
実装コードを見る
<div class="demo"></div>
<style>
.demo {
width: 85px; height: 85px; border-radius: 50%;
color: #30323c;
background: #30323c;
animation: figure-eight 3000ms linear infinite both;
}
@keyframes figure-eight {
0% { transform: translate(0,0) scale(.55); }
13% { transform: translate(42px,-28px) scale(.55); }
25% { transform: translate(62px,0) scale(.55); }
38% { transform: translate(42px,28px) scale(.55); }
50% { transform: translate(0,0) scale(.55); }
63% { transform: translate(-42px,-28px) scale(.55); }
75% { transform: translate(-62px,0) scale(.55); }
88% { transform: translate(-42px,28px) scale(.55); }
100% { transform: translate(0,0) scale(.55); }
}
@media (prefers-reduced-motion: reduce) {
.demo { animation: none; }
}
</style>