본문 바로가기
내마음대로만들어보자/CSS

CSS Animation - dot

by 소농민! 2021. 12. 12.
728x90
<div class="loading">
  <div class="circle1"></div>
  <div class="circle2"></div>
</div>

<div class="loading2">
  <div class="circle1"></div>
  <div class="circle2"></div>
</div>

<div class="loading3">
  <div class="circle1"></div>
  <div class="circle2"></div>
</div>
body{
  height: 100vh;
  background: linear-gradient(135deg,#00A8C5,#D9E021);
}
.loading {
  width: 20px; height: 100px;
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  animation: loading ease-in-out 1s 100;
  //loading은 keyframes 이름을 정하는것
}
.loading .circle1 {
  width: 20px; height: 20px;
  background: #fff;
  border-radius: 50%;
}
.loading .circle2 {
  width: 20px; height: 20px;
  background: #fff;
  border-radius: 50%;
  margin-top: 60px;
}
.loading2 {
  width: 20px; height: 100px;
  position: absolute;
  left: 20%; top: 50%;
  //position을 사용한 가운데 오게 하는 방법 
  transform: translate(-50%, -50%);
  //transform: translate는 x좌표, y좌표로 이동을 나타낸다. 
  animation: loading ease-in-out 1s 100;
}
.loading2 .circle1 {
  width: 20px; height: 20px;
  background: #fff;
  border-radius: 50%;
}
.loading2 .circle2 {
  width: 20px; height: 20px;
  background: #fff;
  border-radius: 50%;
  margin-top: 60px;
}

.loading3 {
  width: 20px; height: 100px;
  position: absolute;
  left: 80%; top: 50%;
  transform: translate(-50%, -50%);
  animation: loading ease-in-out 1s 100;
}
.loading3 .circle1 {
  width: 20px; height: 20px;
  background: #fff;
  border-radius: 50%;
}
.loading3 .circle2 {
  width: 20px; height: 20px;
  background: #fff;
  border-radius: 50%;
  margin-top: 60px;
}

@keyframes loading {
  0%   {transform: rotate(0deg);}
  100% {transform: rotate(360deg);}
}

 

 

'내마음대로만들어보자 > CSS' 카테고리의 다른 글

CSS Animation - Wave  (0) 2021.12.13
CSS Animation - cube  (0) 2021.12.12
CSS Animation -tail  (0) 2021.12.12
Hover Effect 참고자료3  (0) 2021.12.12
display-flex  (0) 2021.08.08