Tutorial/Css

animation

by @webs 2023. 08. 01.

Animation

animation 속성은 μ—¬λŸ¬ μ• λ‹ˆλ©”μ΄μ…˜ κ΄€λ ¨ 속성을 ν•œ λ²ˆμ— μ„€μ •ν•  수 μžˆλŠ” λ‹¨μΆ•ν˜• μ†μ„±μž…λ‹ˆλ‹€. 이λ₯Ό μ‚¬μš©ν•˜λ©΄ λ°±κ·ΈλΌμš΄λ“œ μ΄λ―Έμ§€μ˜ μœ„μΉ˜, μ‚¬μ΄μ¦ˆ, λ°˜λ³΅μ—¬λΆ€, λ°©ν–₯, κ³ μ •, 색 등을 κ°„νŽΈν•˜κ²Œ 지정할 수 μžˆμŠ΅λ‹ˆλ‹€.

속성

  • animation-name : μ• λ‹ˆλ©”μ΄μ…˜ keyframe 이름을 μ„€μ •ν•©λ‹ˆλ‹€.
  • animation-duration : μ• λ‹ˆλ©”μ΄μ…˜ μ›€μ§μž„ μ‹œκ°„μ„ μ„€μ •ν•©λ‹ˆλ‹€.
  • animation-timing-function : μ• λ‹ˆλ©”μ΄μ…˜ μ›€μ§μž„ 속도λ₯Ό μ •μ˜ν•©λ‹ˆλ‹€.
  • animation-delay : μ• λ‹ˆλ©”μ΄μ…˜μ΄ λ‘œλ“œλœ ν›„ μ• λ‹ˆλ©”μ΄μ…˜μ΄ μ‹œμž‘λ  λ•Œ κΉŒμ§€μ˜ μ‹œκ°„μ„ λ‚˜νƒ€λƒ…λ‹ˆλ‹€.
  • animation-iteration-count : μ• λ‹ˆλ©”μ΄μ…˜ 반볡 횟수 μ„€μ •ν•©λ‹ˆλ‹€.
  • animation-direction : μ• λ‹ˆλ©”μ΄μ…˜ μ›€μ§μž„ λ°©ν–₯을 μ„€μ •ν•©λ‹ˆλ‹€.
  • animation-fill-mode : μ• λ‹ˆλ©”μ΄μ…˜μ΄ λλ‚œ ν›„μ˜ μƒνƒœλ₯Ό μ„€μ •ν•©λ‹ˆλ‹€.
  • animation-play-state : μ• λ‹ˆλ©”μ΄μ…˜ μ§„ν–‰μƒνƒœλ₯Ό μ„€μ •ν•©λ‹ˆλ‹€.

문법

background : image | position | size | repeat | origin | clip | attachment | color

/* @keyframes name | duration */
animation: move 3s;

/* name | duration | delay */
animation: move 3s 1s;

/* name | duration | delay | iteration-count */
animation: move 3s 1s 5;

/* name | duration | delay | iteration-count | direction*/
animation: move 3s 1s 5 reverse;