βοΈ μ λλ©μ΄μ ν¨κ³Ό : ν μ€νΈ ν¨κ³Ό βοΈ
01. μ λλ©μ΄μ ν¨κ³Ό
μ λλ©μ΄μ
(Animation) ν¨κ³Όλ HTML μμμ μ μ©λλ CSS μ€νμΌμ λ€λ₯Έ CSS μ€νμΌλ‘ λΆλλ½κ² λ³νμν΅λλ€.
μ λλ©μ΄μ
μ μ λλ©μ΄μ
μ λνλ΄λ CSS μ€νμΌκ³Ό μ λλ©μ΄μ
μ μ°μλ μ₯λ©΄(sequence)λ₯Ό λνλ΄λ 볡μμ ν€νλ μ(@keyframes)λ€λ‘ μ΄λ£¨μ΄μ§λλ€.
___ μ°Έκ³ νκΈ° ___
`1 @keyframes : CSS μ λλ©μ΄μ
μμ ꡬκ°μ μ νκ³ κ° κ΅¬κ°λ³λ‘ μ΄λ€ μ€νμΌμ μ μ©μν¬μ§ μ ν©λλ€.
02. λμ λλ ν μ€νΈ ν¨κ³Ό λ§λ€κΈ°
[1] < div > λ°μ€ λ§λ€κΈ°
svg νκ·Έλ₯Ό λ§λ€μ΄ μ€λλ€.
<svg viewBox="0 0 1320 300">
<text x="50%" y="50%" dy="40px" text-anchor="middle">oranssy</text>
</svg>
[2] CSS μ€μ νκΈ°
@keyframes μ μ΄μ©νμ¬ μ λλ©μ΄μ μ μμ§μμ μ‘°μ ν©λλ€.
@font-face {
font-family: 'VitroCore';
font-weight: normal;
font-style: normal;
src: url('https://cdn.jsdelivr.net/gh/webfontworld/vitro/VitroCore.eot');
src: url('https://cdn.jsdelivr.net/gh/webfontworld/vitro/VitroCore.eot?#iefix') format('embedded-opentype'),
url('https://cdn.jsdelivr.net/gh/webfontworld/vitro/VitroCore.woff2') format('woff2'),
url('https://cdn.jsdelivr.net/gh/webfontworld/vitro/VitroCore.woff') format('woff'),
url('https://cdn.jsdelivr.net/gh/webfontworld/vitro/VitroCore.ttf') format("truetype");
font-display: swap;
}
body {
background-color: #FFFFE0;
}
svg {
font-family: 'VitroCore';
font-size: 140px;
position: absolute;
width: 100%;
height: 100%;
text-transform: uppercase;
animation: stroke 5s 1 alternate;
fill: rgba(72,138,204,1);
}
@keyframes stroke {
0% {
stroke-dashoffset: 25%;
stroke-dasharray: 0 50%;
fill: rgba(72,138,204,0);
stroke: rgba(54,95,160,1);
stroke-width: 2;
}
70% {
fill: rgba(72,138,204,0);
stroke: rgba(54,95,160,1);
}
80% {
fill: rgba(72,138,204,0);
stroke: rgba(54,95,160,1);
}
100% {
stroke-dashoffset: -25%;
stroke-dasharray: 50% 0;
fill: rgba(72,138,204,1);
stroke: rgba(54,95,160,0);
stroke-width: 0;
}
}
결과보기
'CSS > Animation' μΉ΄ν κ³ λ¦¬μ λ€λ₯Έ κΈ
κ±Έμ΄κ°μ (3) | 2022.09.08 |
---|---|
CSS animation (3) | 2022.09.08 |
SVG animation (5) | 2022.09.08 |
μ λλ©μ΄μ ν¨κ³Ό _ 무νλ 곡 (5) | 2022.09.05 |
μ λλ©μ΄μ λΉκΈλΉκΈ (5) | 2022.08.29 |
λκΈ