LoginSignup
5
5

More than 5 years have passed since last update.

CSS3 アニメーション ぐるぐる

Posted at

読み込み時の演出やオブジェクトとして使えそうな?ものを作りました。

ぐるぐる1

turn2_Gif.gif

コード


<div class="box"></div>


.box{
  border: 20px solid transparent;
  border-top: 20px solid green;
  border-radius: 100%;
  width: 200px;
  height: 200px;
  box-shadow: inset 0 0 10px 1px blue;
  animation: turn 5s linear infinite;
}

@keyframes turn{
  from{
    transform: rotate(0deg);
  }
  to{
    transform: rotate(360deg);
  }
}

ぐるぐる2

turn1_Gif.gif

コード


<div class="box"></div>


.box{
  border-top: 20px solid green;
  border-radius: 100%;
  width: 200px;
  height: 200px;
  box-shadow: inset 0 0 10px 1px blue;
  animation: turn 5s linear infinite;
}

@keyframes turn{
  from{
    transform: rotate(0deg);
  }
  to{
    transform: rotate(360deg);
  }
}

ぐるぐる1と2のコードの違いはborder: 20px solid transparent;と指定しているかの違いです。

5
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
5