728x90
λ°μν
βοΈ μ λλ©μ΄μ ν¨κ³Ό : ν΅ν΅ νλ λ°μ€ βοΈ
01. μ λλ©μ΄μ ν¨κ³Ό
μ λλ©μ΄μ
(Animation) ν¨κ³Όλ HTML μμμ μ μ©λλ CSS μ€νμΌμ λ€λ₯Έ CSS μ€νμΌλ‘ λΆλλ½κ² λ³νμν΅λλ€.
μ λλ©μ΄μ
μ μ λλ©μ΄μ
μ λνλ΄λ CSS μ€νμΌκ³Ό μ λλ©μ΄μ
μ μ°μλ μ₯λ©΄(sequence)λ₯Ό λνλ΄λ 볡μμ ν€νλ μ(@keyframes)λ€λ‘ μ΄λ£¨μ΄μ§λλ€.
___ μ°Έκ³ νκΈ° ___
`1 @keyframes : CSS μ λλ©μ΄μ
μμ ꡬκ°μ μ νκ³ κ° κ΅¬κ°λ³λ‘ μ΄λ€ μ€νμΌμ μ μ©μν¬μ§ μ ν©λλ€.
02. ν΅ν΅ νλ λ°μ€ λ§λ€κΈ°
[1] < div > λ°μ€ λ§λ€κΈ°
μμ νλλ§ λ§λ€μ΄μ£Όλ©΄ λ©λλ€.
<div class="box"></div>
[2] CSS μ€μ νκΈ°
@keyframes μ μ΄μ©νμ¬ μ λλ©μ΄μ μ μμ§μμ μ‘°μ ν©λλ€.
body {
height: 100vh;
background-image: linear-gradient(to top, #7FFFD4, #98FB98); // κ·ΈλΌλ°μ΄μ
λ°°κ²½μ λ£κΈ°
}
.box {
width: 50px; // μ μ¬κ°ν λ°μ€
height: 50px;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto; // κ°μ΄λ° μ λ ¬
}
.box::before {
content: '';
width: 50px;
height: 5px;
background: #000;
position: absolute;
top: 58px;
left: 0;
border-radius: 50%;
opacity: 0.2;
animation: shadow 0.6s linear infinite; // κ·Έλ¦Όμ ν¨κ³Ό 무νλ°λ³΅
}
@keyframes shadow {
0% {
transform: scale(1, 1)
}
50% {
transform: scale(1.2, 1)
}
100% {
transform: scale(1, 1)
}
}
.box::after {
content: '';
background: #fff;
width: 50px;
height: 50px;
position: absolute;
left: 0;
top: 0;
border-radius: 3px;
animation: load 0.6s linear infinite;
}
@keyframes load {
17% {
border-bottom-right-radius: 3px;
}
25% {
transform: translatey(9px) rotate(22.5deg);
}
50% {
transform: translatey(18px) scale(1, 0.9) rotate(45deg);
border-bottom-right-radius: 40px;
}
75% {
transform: translatey(9px) rotate(67.5deg);
}
100% {
transform: translatey(0px) rotate(90deg);
}
}
결과보기
728x90
λ°μν
'CSS > Animation' μΉ΄ν κ³ λ¦¬μ λ€λ₯Έ κΈ
CSS animation (3) | 2022.09.08 |
---|---|
SVG animation (5) | 2022.09.08 |
μ λλ©μ΄μ ν¨κ³Ό _ 무νλ 곡 (5) | 2022.09.05 |
μ λλ©μ΄μ λΉκΈλΉκΈ (5) | 2022.08.29 |
μ λλ©μ΄μ - 꼬리 νλλ κ°μμ§ λ§λ€κΈ° (4) | 2022.08.18 |
λκΈ