728x90
반응형
Wave Animation
일렁이는 애니메이션
PUG
PUG를 이용하여 진행
div.circle-wrap
- for (var x =1; x <= 12; x++)
div.row
- for (var y = 1; y <= 12; y++)
div.circle
SCSS
SCSS를 이용하여 진행.
@mixin center {
display: flex;
align-items: center;
justify-content: center;
}
body {
@include center;
height: 100vh;
background-image: linear-gradient(45deg, #00DBDE 0%, #FC00FF 100%);
}
.row {
display: flex;
.circle {
width: 10px;
height: 10px;
border-radius: 50%;
margin: 5px 10px;
background: #fff;
transform-origin: top center;
animation: spin 1s linear infinite;
}
}
@keyframes spin {
0% {transform: scale(1.1) rotate(0deg)}
50% {transform: scale(0.1) rotate(180deg)}
100% {transform: scale(1.1) rotate(360deg)}
}
// .row:nth-child(1) .circle {
// animation-delay: 100ms
// }
// .row:nth-child(2) .circle {
// animation-delay: 200ms
// }
// .row:nth-child(3) .circle {
// animation-delay: 300ms
// }
// .row:nth-child(4) .circle {
// animation-delay: 400ms
// }
@for $i from 1 through 12 {
.row:nth-child(#{$i}) .circle {
animation-delay: 100ms * $i
}
}
결과
See the Pen Wave Animation by kimyihyung (@kimyihyung) on CodePen.
728x90
반응형
'CSS' 카테고리의 다른 글
Text Wave Animation (3) | 2022.09.21 |
---|---|
Mouse Hover Effect Animation (3) | 2022.09.20 |
CSS - animation (7) | 2022.09.08 |
CSS - intro (8) | 2022.09.07 |
SVG - intro (7) | 2022.09.07 |