MOTION / 019

Spin

くるりと一回転
中心を支点に、一定の速さで一周します。

実際のHTML・CSSで描かれた見本です。

ラボで詳しく試す ↗

ひとつ試すなら

どこが変わるかを観察して、似た表現と見比べてみよう。

こんなときに

処理中の表示や、回転する仕組みの説明に。

仕組みと使い方

円だけでは回転が見えないため、目印のある形を使います。

回転くるくる一周spin
実装コードを見る
<div class="demo"></div>

<style>
.demo {
  width: 92px; height: 92px; border-radius: 50%; border: 15px solid currentColor; border-top-color: transparent;
  color: #30323c;
  animation: spin 1700ms linear infinite both;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .demo { animation: none; }
}
</style>