π μ΄μ ν λ―Έλμ΄ μΏΌλ¦¬λ μ¬λ―Έμμλ€. μ€λμ μΉ νμ΄μ§μ λμ μΈ ν¨κ³Όλ₯Ό κ°μ Έμ¬ μ μλ μ λλ©μ΄μ ν¨κ³Όμ λν΄μ νμ΅μ νλ€. μ€λλ μ΄μ μ κ°μ΄ μ¬λ―Έμλ μκ°μ΄ λμμΌλ©΄ μ’κ² λ€.
π μ€λ νμ΅ν λ΄μ©
CSS μ λλ©μ΄μ
- @keyframes
- CSSλ‘ ν€νλ μ λΈλ‘μ λ§λ λ€
@keyframes μ λλ©μ΄μ
μ΄λ¦{
0% { /* fromμΌλ‘ μμ±κ°λ₯ */
CSSμμ±: μμ±κ°;
transform: rotate(0deg)
}
50% {
CSSμμ±: μμ±κ°;
transform: rotate(180deg)
}
100% { /* toμΌλ‘ μμ±κ°λ₯ */
CSSμμ±: μμ±κ°;
transform: rotate(360deg)
}
}
/* μμ μμ μμ 0λ, 50νλ‘ μμ μμ 180λ, μλ£μμ μμ 360λ νμ μν΄*/
μ λλ©μ΄μ μμ±
- animation: λμ΄μ°κΈ°λ‘ μμ± λμ΄ κ°λ₯
- animation-name: μ λλ©μ΄μ μ μ€κ° μνλ₯Ό μ§μ νλ μ΄λ¦.
#logo{
animation: lotate;
animation-name: lotate;
/* λ λ€ μ¬μ©κ°λ₯ */
}
- animation-duration: ν μΈμ΄ν¬λ₯΄μ΄ μ λλ©μ΄μ μ΄ μ¬μλ μκ° μ§μ
#logo{
animation: lotate 3s;
/* =================== */
animation-name: lotate;
animation-duration: 3s;
}
- animation-delay: μ λλ©μ΄μ μ μμμ μ§μ°μν¬ μκ° μ§μ
#logo{
animation-name: lotate;
animation-duration: 3s;
animation-delay: 3s;
}
- animation-direction: μ λλ©μ΄μ
μ¬μ λ°©ν₯μ μ§μ
- normal: κΈ°λ³Έκ° (μ¬μ μ’ λ£ ν λ€μ μ¬μ)
- reverse: μλ°©ν₯ μ¬μ
- alternate: μλ°ν₯λΆν° μλ°©ν₯μ λ²κ°μκ°λ©° μ¬μ
- alternate-reverse: μλ°©ν₯λΆν° μλ°ν₯μ λ²κ°μκ°λ©° μ¬μ
#logo{
animation-name: lotate;
animation-duration: 3s;
animation-direction: arternate;
}
- animation-iteration-count: μ λλ©μ΄μ μ΄ λͺ λ² λ°λ³΅λ μ§ μ§μ
#logo{
animation-name: lotate;
animation-duration: 3s;
animation-iteration-count: 3;
/* μ λλ©μ΄μ
3ν λ°λ³΅ */
}
- animation-play-state: μ λλ©μ΄μ μ μ¬μ μν(μΌμμ μ§, μ¬μμ)
#logo{
animation-name: lotate;
animation-duration: 3s;
animation-play-state: pause;
}
- animation-timing-function: μ€κ° μνλ€μ μ νμ μ΄λ€ μκ°κ°κ²©μΌλ‘ μ§νν μ§ μ§μ
- linear: μΌμ ν κ°κ²©
- ease: κΈ°λ³Έκ°
- ease-in
- ease-out
- ease-in-out
- animation-fill-mode: μ λλ©μ΄μ
μ μ¬μ μ νμ μν μ§μ
- none: κΈ°λ³Έκ°
- forwards: λ§μ§λ§ ν€νλ μ μ€νμΌ μ μ§
- backwards: 첫 λ²μ§Έ ν€νλ μ μ€νμΌ μ μ§
- both: μ¬μ μ - 첫 λ²μ§Έ ν€νλ μ μ€νμΌ, μ¬μ ν - λ§μ§λ§ ν€νλ μ μ€νμΌ μ μ§
Canvas
- λ€μν κ·Έλν½ μμλ₯Ό λ§λ€κΈ° μν΄μ μ¬μ©νλ€.
- λ¨μν λν 그리기, λ°μ΄ν° μκ°ν, μ λλ©μ΄μ , μΉ κ²μ λ±μ μ¬μ©νμ¬ λ€μν μ½ν μΈ λ₯Ό λ§λ€μ΄ λΌ μ μλ€.
<canvas id="canvas">
μΊλ²μ€λ₯Ό μ§μνμ§ μλ λΈλΌμ°μ μμλ μΊλ²μ€ λμ νκ·Έ μ¬μ΄ λ΄μ© νμ
</canvas>
- μΊλ²μ€ ν¬κΈ° μ§μ (κΈ°λ³Έν¬κΈ° 300px * 150px)
<canvas id="canvas" width="500" height="500"></canvas>
<canvas id="canvas" width="50vw" height="40vh"></canvas>
μΊλ²μ€λ‘ μ¬κ°ν 그리기
- μμ
- ctx.fillStyle = 'blue'
- ctx.fillRect = (10, 10, 100, 50)
- μ
- ctx.lineWitdth = 5;
ctx.strokeStyle = "black"; - ctx.strokeRect(10, 10, 100, 50)
- ctx.lineWitdth = 5;
- μ§μ°κΈ°
- ctx.clearRect(20, 20, 80, 30)
π μΆκ°λ‘ 곡λΆν λ΄μ©
[udemy] React μλ²½ κ°μ΄λ κ°μ 보기 (λ§€μΌ μ‘°κΈμ© μ΄λΌλ κΎΈμ€ν λ£κΈ°)
Studyμκ³Ό ν¨κ» μ§νμ€μΈ νλ‘μ νΈ κ΅¬ν
- λ‘κ·ΈμΈ νΌ κ΅¬ν
π μ€μν λ΄μ©
- CSS μ λλ©μ΄μ μ¬μ©λ²
- μΊλ²μ€ μ¬μ©λ²
'Daily > Today I Learned' μΉ΄ν κ³ λ¦¬μ λ€λ₯Έ κΈ
22.07.26_TIL (0) | 2022.07.26 |
---|---|
22.07.25_TIL (0) | 2022.07.25 |
22.07.21_TIL (0) | 2022.07.21 |
22.07.19_TIL (0) | 2022.07.19 |
22.07.18_TIL (0) | 2022.07.18 |