Daily/Today I Learned

22.07.22_TIL

ν˜Έλ°€μ΄ 2022. 7. 22. 09:41

πŸ“Œ μ–΄μ œ ν•œ λ―Έλ””μ–΄ μΏΌλ¦¬λŠ” μž¬λ―Έμžˆμ—ˆλ‹€. μ˜€λŠ˜μ€ μ›Ή νŽ˜μ΄μ§€μ— 동적인 효과λ₯Ό κ°€μ Έμ˜¬ 수 μžˆλŠ” μ• λ‹ˆλ©”μ΄μ…˜ νš¨κ³Όμ— λŒ€ν•΄μ„œ ν•™μŠ΅μ„ ν•œλ‹€. μ˜€λŠ˜λ„ μ–΄μ œμ™€ 같이 μž¬λ―ΈμžˆλŠ” μ‹œκ°„μ΄ λ˜μ—ˆμœΌλ©΄ μ’‹κ² λ‹€.

πŸ“— 였늘 ν•™μŠ΅ν•œ λ‚΄μš©

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.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