λ³Έλ¬Έ λ°”λ‘œκ°€κΈ°
μ• λ‹ˆλ©”μ΄μ…˜

μ• λ‹ˆλ©”μ΄μ…˜ - CSS

by Youcodein 2022. 9. 8.
728x90
λ°˜μ‘ν˜•

CSS animation

animation

animation : name | duration | timing-function | delay | iteration | direction | fill-mode | play-state

μ’…λ₯˜ μ˜ˆμ‹œ
animation-name @keyframe에 μ§€μ •λœ 이름을 μ„€μ •ν•©λ‹ˆλ‹€.
animation-duration μ• λ‹ˆλ©”μ΄μ…˜μ΄ μ‹€ν–‰λ˜λŠ” μ‹œκ°„μ„ μ„€μ •ν•©λ‹ˆλ‹€.
animation-timing-function μ• λ‹ˆλ©”μ΄μ…˜ ν‚€ν”„λ ˆμž„ μ›€μ§μž„μ„ μ„€μ •ν•©λ‹ˆλ‹€.
animation-delay μ• λ‹ˆλ©”μ΄μ…˜μ΄ μ‹œμž‘λ˜κΈ° μ „κΉŒμ§€ μ‹œκ°„μ„ μ„€μ •ν•©λ‹ˆλ‹€.
animation-iteration μ• λ‹ˆλ©”μ΄μ…˜ 반볡 횟수λ₯Ό μ„€μ •ν•©λ‹ˆλ‹€.
animation-derection μ• λ‹ˆλ©”μ΄μ…˜ λ°©ν–₯을 μ„€μ •ν•©λ‹ˆλ‹€.
animation-fill-mode μ• λ‹ˆλ©”μ΄μ…˜ λλ‚˜κ³  λ‚œ λ’€ μ–΄λ–€ 값을 μ μš©ν• μ§€ μ„€μ •ν•©λ‹ˆλ‹€.
animation-play-state μ• λ‹ˆλ©”μ΄μ…˜ μ‹€ν–‰ μƒνƒœλ₯Ό μ„€μ •ν•©λ‹ˆλ‹€.

timing-function

timing-function의 μ’…λ₯˜μ™€ μ˜ˆμ‹œλ₯Ό λ‚˜νƒ€λ‚Έ ν‘œμž…λ‹ˆλ‹€.

μ’…λ₯˜ μ˜ˆμ‹œ
linear μΌμ •ν•œ κ°„κ²©μœΌλ‘œ μ„€μ •ν•©λ‹ˆλ‹€.
ease μ²˜μŒμ—λŠ” μ„œμ„œνžˆ κ°€μ†ν•˜κ³  λ§ˆμ§€λ§‰ λΆ€λΆ„μ—μ„œ κΈ‰κ²©νžˆ κ°μ†ν•©λ‹ˆλ‹€.
ease-in μ²˜μŒμ—λŠ” 천천히 μ‹œμž‘ν•˜κ³  λ§ˆμ§€λ§‰μ— κ°€μ†ν•©λ‹ˆλ‹€.
ease-out μ²˜μŒμ—λŠ” μ΅œλŒ€ μ†λ„λ‘œ μ‹œμž‘ν•˜κ³  λ§ˆμ§€λ§‰μ— κ°μ†ν•©λ‹ˆλ‹€.
ease-in-out μ²˜μŒμ—λŠ” 제둜 μ†λ„λ‘œ μ‹œμž‘ν•˜κ³ , 쀑간 μ§€μ μ—μ„œ 졜고 μ†λ„λ‘œ 움직이고, λ§ˆμ§€λ§‰ λΆ€λΆ„μ—μ„œ μ„œμ„œνžˆ κ°μ†ν•©λ‹ˆλ‹€.
step-start μ• λ‹ˆλ©”μ΄μ…˜μ„ μ‹œμž‘μ μ—μ„œ μ„€μ •ν•©λ‹ˆλ‹€.
step-end μ• λ‹ˆλ©”μ΄μ…˜μ„ λμ μ—μ„œ μ„€μ •ν•©λ‹ˆλ‹€.
steps(int, start/end) μ• λ‹ˆλ©”μ΄μ…˜μ„ 단계별을 μ„€μ •ν•©λ‹ˆλ‹€.
cubic-bezier(n,n,n,n) λ²„μ§€λ‹ˆμ•„ 곑선 값을 λ§Œλ“€μ–΄μ„œ μ„€μ •ν•©λ‹ˆλ‹€.
linear
ease
ease-in
ease-out
ease-in-out
.timing1.show {animation: move 2s 1 linear;}
.timing2.show {animation: move 2s 1 ease;}
.timing3.show {animation: move 2s 1 ease-in;}
.timing4.show {animation: move 2s 1 ease-out;}
.timing5.show {animation: move 2s 1 ease-in-out;}

@keyframes move {
0% {left: 0%;}
50% {left: 100%;}
100% {left: 0%;}
}
step-start
step-end
steps(4, start)
steps(4, end)
steps(10, start)
steps(10, start)
.timing6.show {animation: move 4s 1 step-start;}
.timing7.show {animation: move 4s 1 step-end;}
.timing8.show {animation: move 4s 1 steps(4, start);}
.timing9.show {animation: move 4s 1 steps(4, end);}
.timing10.show {animation: move 4s 1 steps(10, start);}
.timing11.show {animation: move 4s 1 steps(10, end);}
timing12
timing13
timing14
timing15
timing16
.timing12.show {animation: move 3s 2 cubic-bezier(0,.71,0,1);}
.timing13.show {animation: move 3s 2 cubic-bezier(0,.71,1,-0.28);}
.timing14.show {animation: move 3s 2 cubic-bezier(1,-0.52,1,-0.28);}
.timing15.show {animation: move 3s 2 cubic-bezier(1,.02,0,1.01);}
.timing16.show {animation: move 3s 2 cubic-bezier(.33,2.04,1,2.05);}
timing17
timing18
timing19
timing20
.timing17.show {animation: move 3s 0.1s 2 ease;}
.timing18.show {animation: move 3s 0.2s 2 ease;}
.timing19.show {animation: move 3s 0.3s 2 ease;}
.timing20.show {animation: move 3s 0.4s 2 ease;}

animation-iteration-count

timing21
timing22
timing23
timing24
.timing21.show {animation: move 1s 1 ease;}
.timing22.show {animation: move 1s 2 ease;}
.timing23.show {animation: move 1s 3 ease;}
.timing24.show {animation: move 1s infinite ease;}

animation-direction

timing25
.timing25.normal {animation: move2 4s 5 ease normal;}
.timing26.reverse {animation: move2 4s 5 ease reverse;}
.timing27.alternate {animation: move2 4s 5 ease alternate;}
.timing28.alternate-reverse {animation: move2 4s 5 ease alternate-reverse;}

animation-direction

timing26
timing27
timing28
timing29
.timing26.show {animation: move3 3s 1 ease; animation-fill-mode: none;}
.timing27.show {animation: move3 3s 1 ease; animation-fill-mode: forwards;}
.timing28.show {animation: move3 3s 1 ease; animation-fill-mode: backwards;}
.timing29.show {animation: move3 3s 1 ease; animation-fill-mode: both;}
@keyframes move3 {
0% {left: 0%;}
100% {left: calc(100% - 120px);}
}

animation-direction

timing31
.timing30.running {animation: move2 4s 100 ease; animation-play-state: running;}
.timing30.paused {animation: move2 4s 100 ease; animation-play-state: paused;}
728x90
λ°˜μ‘ν˜•

'μ• λ‹ˆλ©”μ΄μ…˜' μΉ΄ν…Œκ³ λ¦¬μ˜ λ‹€λ₯Έ κΈ€

CSSμ• λ‹ˆλ©”μ΄μ…˜ μ˜ˆμ‹œ  (1) 2022.09.08
SVG μ• λ‹ˆλ©”μ΄μ…˜ μ˜ˆμ‹œ  (2) 2022.09.08
μ• λ‹ˆλ©”μ΄μ…˜ - SVG  (5) 2022.09.07

λŒ“κΈ€