CSS μ λλ©μ΄μ : μΌλ μ΄λ μ λλ©μ΄μ
μ€λμ CSSμ λ€μν μμ±μ μ΄μ©νμ¬ μ λλ©μ΄μ μ λ§λ€μ΄ 보λλ‘ νκ² μ΅λλ€. μ λλ©μ΄μ μ΄λ¦μ λλΌκ³ ν΄μΌ ν μ§ λͺ¨λ₯΄κ² λ€μ. μμ ν΄λ³Ό μ λλ©μ΄μ μ λ€μκ³Ό κ°μ΅λλ€.
See the Pen Untitled by mj0614k (@mj0614k) on CodePen.
1. HTML(PUG) μμ€
div.circle-wrap
-for (var x = 1; x<=12; x++)
div.row
-for (var y = 1; y<=12; y++)
div.circle
HTML μμ€λ λ°λ³΅ μμ μ νκΈ° λλ¬Έμ PUGλ₯Ό μ΄μ©νλ©΄ μμνκ² μμ ν μ μμ΅λλ€. μ μμ€λ μ΄ 12κ°μ row ν΄λμ€λ₯Ό κ°μ§ div μμ, κ°κ° 12κ°μ circle ν΄λμ€λ₯Ό κ°μ§ div λ°μ€λ₯Ό λ§λ κ²κ³Ό κ°μ΅λλ€.
2. CSS μμ€
body {
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
background-image: linear-gradient(45deg, #00dbde 0%, #fc00ff 100%);
}
.row {
display: flex;
}
.row .circle {
width: 10px;
height: 10px;
background: #fff;
border-radius: 50%;
margin: 5px 10px;
transform-origin: top center;
animation: spin 1s linear infinite;
}
@keyframes spin {
0% {
transform: scale(1.1) rotate(0deg);
}
50% {
transform: scale(0.2) 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;
}
.row:nth-child(5) .circle {
animation-delay: 500ms;
}
.row:nth-child(6) .circle {
animation-delay: 600ms;
}
.row:nth-child(7) .circle {
animation-delay: 700ms;
}
.row:nth-child(8) .circle {
animation-delay: 800ms;
}
.row:nth-child(9) .circle {
animation-delay: 900ms;
}
.row:nth-child(10) .circle {
animation-delay: 1000ms;
}
.row:nth-child(11) .circle {
animation-delay: 1100ms;
}
.row:nth-child(12) .circle {
animation-delay: 1200ms;
}
bodyμ κ·ΈλΌλ°μ΄μ μΌλ‘ λ°°κ²½μμ μ£Όκ³ , flexλ‘ μμ΄ν λ€μ κ°μ΄λ° μ λ ¬ν©λλ€. κ°κ°μ circleμ λλΉ, λμ΄κ°μ λΆμ¬νκ³ , keyframesλ₯Ό μμ±ν΄ μ€λλ€. λ§μ§λ§μΌλ‘, circle μ λλ©μ΄μ κ°κ°μ μμ°¨μ μΌλ‘ μ λλ©μ΄μ λλ μ΄λ₯Ό μ μ©ν΄ μ€λλ€.
μμ HTML, CSS μμ€λ₯Ό ν©μΉλ©΄ μ λλ©μ΄μ μ΄ μμ±λ©λλ€. κ°λ¨νμ£ ?
'CSS' μΉ΄ν κ³ λ¦¬μ λ€λ₯Έ κΈ
CSS μ λλ©μ΄μ λ§λ€κΈ° : ν΅ν΅ νλ κΈμ (1) | 2022.09.22 |
---|---|
CSS μ λλ©μ΄μ λ§λ€κΈ° : μΉ΄λ λ€μ§κΈ° (9) | 2022.09.20 |
CSS μ λλ©μ΄μ λ§λ€κΈ° : GIF μ΄λ―Έμ§ μ λλ©μ΄μ ꡬννκΈ° (9) | 2022.09.08 |
CSS μ λλ©μ΄μ λ§λ€κΈ° : μ λλ©μ΄μ κΈ°μ΄ (3) | 2022.09.08 |
CSS μ λλ©μ΄μ λ§λ€κΈ° : SVG (5) | 2022.09.08 |
λκΈ