Index
Index1. Transition
1.1 Transition์ด๋?1.2 Transition์ ์์ฑ๋ค1.2.1 transition - delay1.2.2 transition - duration1.2.3 transition - property1.2.4 transition - timing - function1.2.5 transition1.3 transform1.3.1 transform ์ด๋?1.3.1.1 scale1.3.1.2 rotate1.3.1.3 translate1.3.1.4 skew1.3.1.5 transform-origin
1. Transition
1.1 Transition์ด๋?
์ด๋ฒ ์ฅ์์๋
transition
์ ๋ํด์ ์์๋ณด๋๋ก ํ๊ฒ ์ต๋๋ค. transition
์ด๋ CSS ์์ฑ๊ฐ์ด ๋ณํ ๋, ๊ฐ์ ๋ณํ๊ฐ ์ผ์ ์๊ฐ์ ๊ฑธ์ณ ์ผ์ด๋๋๋ก ํ๋ ๊ฒ์ ๋งํฉ๋๋ค. ์ฌ๋ฌ ์์ฑ๋ค์ ์ฐจ๊ทผ์ฐจ๊ทผ ์ดํด๋ณด๋๋ก ํ๊ณ ๊ฐ๋ฒผ์ด ์์ ๋ฅผ ํตํด transition
์ด ๋ฌด์์ธ์ง ๊ฒฝํํด ๋ณด๋๋ก ํ์ฃ .

<!DOCTYPE html> <html> <head> <title>Transition Test</title> <style> div{ width: 100px; height: 100px; background-color: red; } div:hover{ width: 300px; height: 300px; background-color: blue; } </style> </head> <body> <div>hello world</div> </body> </html>
๊ฐ๋ก, ์ธ๋ก 100px์ ๋นจ๊ฐ ๋ฐฐ๊ฒฝ์์ ๊ฐ์ง div๊ฐ ํ๋ ์์ต๋๋ค. div์ ๋ง์ฐ์ค๋ฅผ ์ฎ๊ธฐ๊ฒ ๋๋ฉด ๊ฐ๋ก, ์ธ๋ก 300px์ ํ๋ ๋ฐฐ๊ฒฝ์์ ๊ฐ์ง div๋ก ๋ณํ๊ฒ ๋๋ ๊ฑธ ํ์ธํ ์ ์์ต๋๋ค.
์ฌ๊ธฐ์ style์ ์ฝ๋ ํ ์ค๋ง ์ถ๊ฐํด๋ณผ๊น์? ์ง๊ธ์ ์ด ์ฝ๋๊ฐ ๋ฌด์์ ์๋ฏธํ๋์ง ๋ชจ๋ฅด์
๋ ๋ฉ๋๋ค.
transition: all 2s;
๊ทธ ๊ฒฐ๊ณผ,
์ฆ์ ๋ณ๊ฒฝ๋๋ฉด ์์ฑ๊ฐ๋ค์ด ์๊ฐ์ ๋๊ณ ์ฒ์ฒํ ๋ฐ๋๋ ๊ฑธ ํ์ธํ ์ ์์ต๋๋ค. ์ ๋๋ฉ์ด์
์ฒ๋ผ ๋ง์ด์ฃ . ์ด๊ฒ์ด ๋ฐ๋ก
transition
์ ๋ง๋ฒ์
๋๋ค. transition
์ ๋ํด ํจ๊ป ๋ ์์๋ณด๋๋ก ํฉ์๋ค.
1.2 Transition์ ์์ฑ๋ค
1.2.1 transition - delay
- delay๋?
delay
๊ฐ ๋ฌด์จ ๋ป์ธ๊ฐ์? ๋ง์ต๋๋ค. ํ๊ตญ์ด๋ก ๋ฒ์ญํ๋ฉด '์ง์ฐ'์ด๋ผ๋ ๋ป์ ๋๋ค. ๋ง ๊ทธ๋๋กtransition
์ด ์ผ์ด๋ ๋ ์ผ๋ง๋งํผ ๊ธฐ๋ค๋ ธ๋ค๊ฐ ์คํํ ์ง ๊ฒฐ์ ํด์ฃผ๋ ์์ฑ์ ๋๋ค.
- delay์ ๊ฐ
delay
๋transition
์ด ์ผ์ด๋๊ธฐ ์ ๊น์ง ์ผ๋ง๋ ๊ธฐ๋ค๋ฆด์ง ์ง์ ํด ์ฃผ๋ ๊ฒ์ ๋๋ค. ๊ทธ๋ ๊ธฐ ๋๋ฌธ์ ์์ฑ๊ฐ์ผ๋ก๋ ์๊ฐ์ด ๋ค์ด๊ฐ๊ฒ ๋ฉ๋๋ค. ์ด ๋จ์๋ฅผ ๋ํ๋ด๋s
๋ ๋ฐ๋ฆฌ ์ด๋ฅผ ๋ํ๋ด๋ms
๋ก ๋ํ๋ ๋๋ค. ์ง์ ํด ์ฃผ์ง ์์ ์์๋0s
์ ์๋ฏธํ๋ฉฐ ์ง์ฐ ์์ด ๋ฐ๋กtransition
์ด ์ผ์ด๋ฉ๋๋ค.
delay์ ๊ฐ์ผ๋ก ์์ ๊ฐ๋ ์ง์ ํด์ค ์ ์๋์?
์์ธ๋ก ์์๊ฐ์ผ๋ก ์ง์ ์ด ๊ฐ๋ฅํฉ๋๋ค. ์์๊ฐ์ ์ง์ ํ ๊ฒฝ์ฐ์๋ ์ง์ฐ ์์ด ๋ฐ๋ก
transition
์ด ์คํ๋๋ฉฐ ์ง์ ํด์ค ์์๊ฐ์ ์ ๋๊ฐ ์๊ฐ๋งํผ ๊ธฐ๋ค๋ ธ๋ค๊ฐ ์์ํ๊ฒ ๋ฉ๋๋ค.- delay ์์ ๋ง์ฐ์ค๋ฅผ ์ฌ๋ ธ์ ๋ ๋ฐฐ๊ฒฝ์ ๋ฐ๊ฟ์ฃผ๋ ์์ ์ ๋๋ค. ์ธ ๊ฐ์ div์ ๋ํด์ delay ๊ฐ์ ๋ค๋ฅด๊ฒ ์ง์ ํด์ฃผ์์ต๋๋ค. ์ฐจ์ด๋ฅผ ์ง์ ํ์ธํด ๋ณด๋๋ก ํฉ์๋ค.
<!DOCTYPE html> <html> <head> <title>Transition Test</title> <style> body{ display: flex; } div{ width: 100px; height: 100px; background: red; font: bold; color: white; margin-right: 10px; display: flex; justify-content: center; align-items: center; } .first{ transition-delay: 0s; } .second{ transition-delay: 1s; } .third{ transition-delay: 2s; } div:hover{ background: blue; } </style> </head> <body> <div class="first">0์ด</div> <div class="second">1์ด</div> <div class="third">2์ด</div> </body> </html>

1.2.2 transition - duration
- duration ์ด๋?
์ด๋ฒ์๋ ๋ป์ ์์๋ณผ๊น์?
duration
์ ํ๊ตญ์ด๋ก '์ง์'์ด๋ผ๋ ๋ป์ ๋๋ค.transition
์ด ์ผ์ด๋๋ ์ง์์๊ฐ์ ์ค์ ํด ์ค ์ ์์ต๋๋ค. ์์์delay
๋ง ์ฌ์ฉํ์์ ๊ฒฝ์ฐ์๋ ์ง์ฐ์๊ฐ ํ์ CSS ์์ฑ๊ฐ์ด ๊ฐ์๊ธฐ ํ ๋ณํด ์ ๋๋ฉ์ด์ ๊ณผ ๊ฐ์ ํจ๊ณผ๋ฅผ ๊ฐ์ ธ์ฌ ์ ์์์ต๋๋ค.duration
์ ์ฌ์ฉํ ํ ๋ณํ๋ฅผ ์์๋ณด๋๋ก ํฉ์๋ค.
- duration์ ๊ฐ
transition์ด ์ผ๋ง๋งํผ์ ์๊ฐ ๋์ ๋ณํ ์ง ์ง์ ํด ์ฃผ์ด์ผ ํฉ๋๋ค. ๊ทธ๋ ๊ฒ ๋๋ฌธ์
delay
์ ์ ์ฌํ๊ฒ ์๊ฐ์ ์์ฑ๊ฐ์ผ๋ก ๊ฐ์ต๋๋ค. ์ด ๋จ์๋ฅผ ๋ํ๋ด๋s
๋ ๋ฐ๋ฆฌ ์ด๋ฅผ ๋ํ๋ด๋ms
๋ก์ ๋ํ๋ ๋๋ค. ์ง์ ํด ์ฃผ์ง ์์ ์์๋0s
๋ฅผ ์๋ฏธํ๋ฉฐtransition
์ ํจ๊ณผ๊ฐ ๋ํ๋์ง ์์ต๋๋ค.
- duration ์์
๋ง์ฐฌ๊ฐ์ง๋ก ๋ง์ฐ์ค๋ฅผ ์ฌ๋ ธ์ ๋ ๋ฐฐ๊ฒฝ์ ๋ฐ๊ฟ์ฃผ๋ ์์์
๋๋ค.
duration
๊ฐ์ ๋ฐ๋ผ์ ์์ํ ํจ๊ณผ๊ฐ ๋ํ๋๋ ๊ฒ์ ํ์ธํ ์ ์์ต๋๋ค.
<!DOCTYPE html> <html> <head> <title>Transition Test</title> <style> body{ display: flex; } div{ width: 100px; height: 100px; background: red; font: bold; color: white; margin-right: 10px; display: flex; justify-content: center; align-items: center; } .first{ transition-duration: 0s; } .second{ transition-duration: 1s; } .third{ transition-duration: 2s; } div:hover{ background: blue; } </style> </head> <body> <div class="first">0์ด</div> <div class="second">1์ด</div> <div class="third">2์ด</div> </body> </html>

1.2.3 transition - property
- property๋?
property
๋ ํ๊ตญ์ด๋ก '์์ฑ'์ด๋ผ๋ ๋ป์ ๋๋ค. ๋ฐ๋ผ์ transition-property๋ ์ด๋ค ์์ฑ์transition
ํจ๊ณผ๋ฅผ ์ค์ง ์ค์ ํ๋ ๊ฒ์ ๋งํฉ๋๋ค.transition-property
๋ฅผ ํตํด ๋ ํ๋ คํ ์ ๋๋ฉ์ด์ ํจ๊ณผ๋ฅผ ์ค ์ ์๊ฒ ์ฃ ?
- property์ ๊ฐ
์์ฑ๊ฐ์ผ๋ก๋
all
,none
,property
,initial
,inherit
์ด ์์ต๋๋ค.all
์ ๊ธฐ๋ณธ๊ฐ์ผ๋ก ๋ชจ๋ ์์ฑ์transition
ํจ๊ณผ๊ฐ ๋ํ๋๊ฒ ํ๋ ๊ฒ์ ๋๋ค.none
์ ์์ฑ๋ค์ดtransition
ํจ๊ณผ๋ฅผ ๋ฐ์ง ๋ชปํ๋ ๊ฒ์ ๋๋ค.property
๋transition
ํจ๊ณผ๋ฅผ ์ ์ฉํ๊ณ ์ถ์ css ์์ฑ์ ์ค์ ํ๋ฉด ์ง์ ๋ ์์ฑ์transition
์ด ๋ํ๋ฉ๋๋ค. ํ๋ ์ด์์ ์์ฑ์ ์ ์ฉํ๊ณ ์ถ์ ๋๋ ์ผํ๋ก ๋์ดํฉ๋๋ค.initial
์ ์์ฑ์ ๊ธฐ๋ณธ๊ฐ์ผ๋ก ์ค์ ํด์ฃผ๋ ๊ฒ์ ๋๋ค.inherit
์ ๋ถ๋ชจ ์์์ ์์ฑ๊ฐ์ ์์๋ฐ์ต๋๋ค.
- property ์์ (๊ฐ๋จํ๊ฒ all, none, property์ ํด๋นํ๋ ์์ ๋ฅผ ์์๋ด ์๋ค.)
all์์
<!DOCTYPE html> <html> <head> <title>transition-property all์์ </title> <style> div { width: 100px; height: 100px; background-color: red; -webkit-transition-property: all; /* safari */ -webkit-transition-duration: 2s; /* safari */ transition-property: all; transition-duration: 2s; text-align: center; color: white; font-size: 20px; font-weight: bold; line-height: 100px; } div:hover { background-color: blue; width: 200px; height: 200px; line-height: 200px; } </style> </head> <body> <div>all</div> </body> </html>

none์์
<!DOCTYPE html> <html> <head> <title>transition-property none์์ </title> <style> div { width: 100px; height: 100px; background-color: red; -webkit-transition-property: none; /* safari */ -webkit-transition-duration: 2s; /* safari */ transition-property: none; transition-duration: 2s; text-align: center; color: white; font-size: 20px; font-weight: bold; line-height: 100px; } div:hover { background-color: blue; width: 200px; height: 200px; line-height: 200px; } </style> </head> <body> <div>all</div> </body> </html>

transition-property: all
์ผ๋๋ 2์ด ๋์ ์์ํ ๋ณํ๋ ๊ฒ์ด transition-duration: 2s
๋ฅผ ์คฌ์์๋ ๋ถ๊ตฌํ๊ณ ๊ฐ์๊ธฐ ๋ณํ๋ ๊ฒ์ ๋ณด์ค ์ ์์ต๋๋ค. transition-property: none
์ ์ฃผ๋ฉด ๋ค๋ฅธ transition
๋ค์ ๋ฌด์ํ๋ ๊ฑฐ์ฃ .property์์
<!DOCTYPE html> <html> <head> <title>transition-property property์์ </title> <style> div { width: 100px; height: 100px; background-color: red; -webkit-transition-property: width, height; /* Safari */ -webkit-transition-duration: 2s; /* Safari */ transition-property: width, height; transition-duration: 2s; } div:hover { width: 200px; height: 200px; background-color: blue; } </style> </head> <body> <div></div> </body> </html>

transition-property: width, height
๋ง ์คฌ์ผ๋ background-color
์์ฑ์ transition-duration: 2s
ํจ๊ณผ๋ฅผ ๋ฐ์ง ๋ชปํฉ๋๋ค. ๋ฐ๋ผ์ width, heigth๋ 2์ด๋์ 100px์์ 200px๋ก ์์ํ ๋ณํ์ง๋ง background-color์ ๊ธ๊ฒฉํ๊ฒ blue๋ก ๋ฐ๋๋๋ค.1.2.4 transition - timing - function
- timing-function ์ด๋?
transition-timing-function
์ผ๋กtransition
์ ์งํ ์๋๋ฅผ ์ค์ ํ ์ ์์ต๋๋ค.transition-timing-function
์ IE์ ๊ฒฝ์ฐ, ๋ฒ์ 10๋ถํฐ ์ฌ์ฉ ๊ฐ๋ฅํฉ๋๋ค.
- timing-function์ ๊ฐ
์์ฑ๊ฐ์ผ๋ก๋
ease
,linear
,ease-in
,ease-out
,ease-in-out
,step-start
,step-end
,steps(int, start|end)
,cubic-bezier(n, n, n, n)
,initial
,inherit
์ด ์์ต๋๋ค. ๋๋ถ๋ถ์ timing ํจ์๋ค์ cubic bezier์ด๋ผ๋ ๊ฒ์ ์ฌ์ฉํฉ๋๋ค. cubic bezier๊ณก์ ์ด๋ ๋ถ๋๋ฌ์ด ๊ณก์ ์ ๋ชจ๋ธ๋ง ํ๊ธฐ ์ํด ์ปดํจํฐ ๊ทธ๋ํฝ์์ ๋๋ฆฌ ์ฐ์ด๋ ๊ฒ์ผ๋ก 4๊ฐ์ ์ปจํธ๋กค ํฌ์ธํธ๋ฅผ ์ฌ์ฉํด transition์ ์์๊ณผ ๋๊น์ง์ ํจ๊ณผ๋ฅผ ์ ์ดํฉ๋๋ค. 1)ease
์ ๊ฒฝ์ฐ, ๊ธฐ๋ณธ๊ฐ์ผ๋ก transition์ด ์ฒ์ฒํ ์์๋์ด ๊ทธ ๋ค์์๋ ๋นจ๋ผ์ง๊ณ ๋ง์ง๋ง์๋ ๋ค์ ๋๋ ค์ง๋๋ค.cubic-bezier(0.25, 0.1, 0.25, 0.1)
๊ณผ ๊ฐ์ต๋๋ค. 2)linear
์ transition์ด ์ฒ์๋ถํฐ ๋๊น์ง ์ผ์ ํ ์๋๋ก ์งํ๋ฉ๋๋ค.cubic-bezier(0, 0, 1, 1)
๊ณผ ๊ฐ์ต๋๋ค. 3)ease-in
์ ์ฒ์ฒํ ์์ํ๋ ๊ฒ์ผ๋กcubic-bezier(0.42, 0, 1, 1)
๊ณผ ๊ฐ์ต๋๋ค. 4)ease-out
์ ์ฒ์ฒํ ๋๋๋ ๊ฒ์ด๊ณcubic-bezier(0, 0, 0.58, 1)
๊ณผ ๊ฐ์ต๋๋ค. 5)ease-in-out
์ ์ฒ์ฒํ ์์ํด์ ์ฒ์ฒํ ๋๋๋ ๊ฒ์ด๊ณcubic-bezier(0.42, 0, 0.58, 1)
๊ณผ ๊ฐ์ต๋๋ค. 6)step-start
์steps(1, start)
๊ณผ ๊ฐ์ผ๋ฉฐ ์์ํ๋ ์์ ์ ์คํ ์ ๋์ด์ค๋๋ค. 7)step-end
์steps(1, end)
์ ๊ฐ์ผ๋ฉฐ ๋๋๋ ์์ ์ ์คํ ์ ๋์ด์ค๋๋ค. 8)steps(int, start|end)
์int
์๋ฆฌ์ ์ ์๋ฅผ ๋ฃ๊ณstart
๋end
๋ฅผ ๋ฃ์ด์ฃผ๋ฉด ๋ฃ์ด์ค ์ ์๋งํผ ์์์ด๋ ๋๋๋ ์์ ์ ์คํ ์ ๋์ด์ค๋๋ค. 9)cubic-bezier(n, n, n, n)
๋ฅผ ์ฌ์ฉํด ๋ฒ ์ง์ด ๊ณก์ ์ ์ํ๋ ์ปจํธ๋กค ํฌ์ธํธ๋ฅผ ์ง์ ๋ฃ์ด์ค ์๋ ์์ต๋๋ค. 10)initial
์ ์์ฑ์ ๊ธฐ๋ณธ๊ฐ์ผ๋ก ์ ์ฉ๋ฉ๋๋ค. 11)inherit
์ ๋ถ๋ชจ์ ์ํฅ์ ๋ฐ์ ์ ์ฉ๋ฉ๋๋ค.
- timing-function ์์
์์ง์์ ๋ณด์ฌ์ฃผ๋ ์์ ์ด๋ฏ๋ก codepen๋งํฌ๋ฅผ ์ฒจ๋ถํ์์ต๋๋ค.
ย
1.2.5 transition
transition ์์ฑ์ ์ฌ์ฉํด ์ฌํ๊น์ง ๋ฐฐ์๋ณธ transition ์์ฑ๋ค์ ํ๋ฒ์ ์ ์ฉ์ํฌ ์ ์์ต๋๋ค.
transition
์ transition-property
transition-duration
transition-timing-function
transition-delay
๋ก ์ด๋ฃจ์ด์ ธ ์์ผ๋ฉฐ ์์ ๋ก ์ถ๊ฐ์ํจ ๊ทธ๋ฆผ์ ํด์ํด๋ณด๋ฉด width ์์ฑ์ 2์ด ๋์ ์ฒ์๋ถํฐ ๋๊น์ง ์ผ์ ํ ์๋๋ก 1์ด ์ง์ฐ์ํจ ๋ค์ transition ํจ๊ณผ๊ฐ ์ผ์ด๋๋ ๊ฒ์ ์๋ฏธํฉ๋๋ค.
์์์ transition์ ์์ฑ๋ค์ ๋ํด์ ๋ฐฐ์ ์ผ๋ ํด๋นํ๋ ์์น์ ์๋ง์ value๋ค์ ๋ฃ์ ์ ์์ ๊ฒ์
๋๋ค.
1.3 transform
ย
1.3.1 transform ์ด๋?
transform(๋ณํ)์ Object๋ฅผ ์ฌ๋ฌ ํํ๋ก ๋ณํํ ๋ ์ฌ์ฉํ๋ ์์ฑ์ผ๋ก, transition๊ณผ ํจ๊ป ์ฌ์ฉํ๋ฉด ์์ฒญ๋ ํจ๊ณผ๋ฅผ ๋ผ ์ ์๋ ์์ฑ์
๋๋ค.
transform
์ ํํ๋ฅผ ๋ณํ์ํฌ ์ ์๋ ๋ค์ํ ์์ฑ๋ค์ด ์กด์ฌํฉ๋๋ค. ๊ทธ ์ค ๊ฐ์ฅ ๋ง์ด ์ฌ์ฉํ๋ scale
, rotate
, translate
, skew
, origin
์ ์์๋ณด๊ฒ ์ต๋๋ค.ย
1.3.1.1 scale
<!DOCTYPE html> <html> <head> <title>Transition Test</title> <style> .box{ width:100px; height:100px; background:dodgerblue; transition:all 1s; } .box:hover{ transform:scale(2); } </style> </head> <body> <div class="box">hello world</div> </body> </html>

scale
์ ํํ์ ํฌ๊ธฐ๋ฅผ ๋ณํ ์ํฌ ๋ ์ฌ์ฉํ๋ ์์ฑ์ผ๋ก ๋ง์น ์์ ์์์์ width์ height์ ํฌ๊ธฐ๋ฅผ ๋๋ฆฐ ๊ฒ์ฒ๋ผ ๋ณํ์ด ๋์ง๋ง width์ height๋ฅผ ๋๋ ธ์ ๊ฒฝ์ฐ์ ์ค๋ฅธ์ชฝ ์๋๊ฐ ์ปค์ง๋ ๋ฐ๋ฉด์ scale
์ ์ค์ฌ์ ์ด ๊ฐ์ด๋ฐ์ด๊ธฐ ๋๋ฌธ์ ๊ฐ์ด๋ฐ๋ฅผ ์ค์ฌ์ผ๋ก ์ปค์ง๋ ํจ๊ณผ๋ฅผ ๋ํ๋
๋๋ค.
scale(1)
์์ 1 = 100%๋ฅผ ๋ปํ๋ฉฐ 1 ์ด์์ ๊ฐ์ ์
๋ ฅํด์ผ ๋ณํ์ด ์ผ์ด๋๊ฒ ๋ฉ๋๋ค. ์ฝ๋์์๋ scale(2)
๋ฅผ ์
๋ ฅํ๊ธฐ ๋๋ฌธ์ ์ง๊ธ๋ณด๋ค 2๋ฐฐ์ ํฌ๊ธฐ๋งํผ ์ปค์ง ๋ชจ์ต์ด ์ถ๋ ฅ๋ฉ๋๋ค.
scale์ ๊ฐ์๋ 2๊ฐ์ง ์ธ์๋ฅผ ๋ฐ์ ์ ์์ต๋๋ค. (x์ถ, y์ถ)์ผ๋ก ์ค์ ๊ฐ๋ฅํ๋ฉฐ ํ ๊ฐ์ ์ธ์๊ฐ๋ง ์
๋ ฅํ ๊ฒฝ์ฐ x, y๋์ผํ ์์น๋ฅผ ๋ปํฉ๋๋ค.
transition์ ํจ๊ป ์ฌ์ฉํ๊ธฐ ๋๋ฌธ์ ์์ฐ์ค๋ฌ์ด ํ๋ฉด ์ ํ ํจ๊ณผ๋ฅผ ํจ๊ป ํ์ธํ ์ ์์ต๋๋ค.ย
1.3.1.2 rotate
<!DOCTYPE html> <html> <head> <title>Transition Test</title> <style> .box{ width:100px; height:100px; background:dodgerblue; transition:all 1s; } .box:hover{ transform:rotate(360deg); } </style> </head> <body> <div class="box">hello world</div> </body> </html>

rotate
๋ ํ์ ์ ์์ผ์ฃผ๋ ๊ฐ์
๋๋ค. ๊ดํธ ์์ ๊ฐ๋๋ฅผ ์
๋ ฅํ๋ฉด ์
๋ ฅ๊ฐ๋งํผ ํ์ ์ ํ๋ฉฐ, ์ฌ์ฉ ๋จ์๋ deg(degree)๋ฅผ ์ฌ์ฉํฉ๋๋ค. 360deg ํ ๋ฐํด๋ฅผ ๋ปํ๊ธฐ์ transform:rotate(1turn)
์ผ๋ก๋ ์ฌ์ฉ์ด ๊ฐ๋ฅํฉ๋๋ค.ย
ย
1.3.1.3 translate
<!DOCTYPE html> <html> <head> <title>Transition Test</title> <style> .box{ width:100px; height:100px; background:dodgerblue; transition:all 1s; } .box:hover{ transform:translate(100px,100px); } </style> </head> <body> <div class="box">hello world</div> </body> </html>
ย

translate
(์ฎ๊ธฐ๋ค) ๋ Object๋ฅผ x,y์ถ ์ง์ ์ผ๋ก ์ด๋์ ์์ผ์ฃผ๋ ๊ฐ์ผ๋ก (x์ถ, y์ถ)์ ๋ปํฉ๋๋ค.
๊ธฐ์ค์ ์ ๊ฐ์ด๋ฐ์ด๋ฉฐ ๊ฐ์ด ์ฆ๊ฐํ ์ x์ถ์ ์ค๋ฅธ์ชฝ์ผ๋ก y์ถ์ ์๋ ๋ฐฉํฅ์ผ๋ก ์ด๋ํฉ๋๋ค.
์์ ๊ฐ์ ์ ์ฉ ์ ๋ฐ๋ ๋ฐฉํฅ์ผ๋ก ์ด๋ํฉ๋๋ค.ย
1.3.1.4 skew
<!DOCTYPE html> <html> <head> <title>Transition Test</title> <style> .box{ width:100px; height:100px; background:dodgerblue; transition:all 1s; } .box:hover{ transform:skew(40deg); } </style> </head> <body> <div class="box">hello world</div> </body> </html>
ย

skew
(์ธ๊ณกํ๋ค) ๋ ์์๋ฅผ ๋นํ๊ธฐ ๋๋ ์ธ๊ณก์ ์ฃผ์ด ํํ๋ฅผ ๋ณํ์ํค๋ ์์ฑ์
๋๋ค.
๊ฐ์ rotate์ ๋์ผํ๊ฒ (40deg)๊ฐ๋๋ก ํ์ํ๋ฉฐ deg(dgree)๋จ์๋ฅผ ์ฌ์ฉํฉ๋๋ค.ย
1.3.1.5 transform-origin
<!DOCTYPE html> <html> <head> <title>Transition Test</title> <style> .box{ width:100px; height:100px; background:dodgerblue; transition:all 1s; transform-origin:left top; } .box:hover{ transform:rotate(360deg); } </style> </head> <body> <div class="box">hello world</div> </body> </html>
ย

transform-origin
์์ฑ์ transform๋๋ Object์ ๊ธฐ์ค์ ์ ๋ณ๊ฒฝํ ๋ ์ฌ์ฉ๋ฉ๋๋ค.
defult๊ฐ์ ๊ฐ์ด๋ฐ์ด์ง๋ง transform-origin์ ์ฌ์ฉํ์ฌ ์ผ์ชฝ ์๋ก ๊ธฐ์ค์ ์ ๋ณ๊ฒฝํ์ rotate๋๋ ์์น๊ฐ ์ผ์ชฝ ์๋ถํฐ ์์ํ๋ ๋ชจ์
์ผ๋ก ๋ณ๊ฒฝ์ด ๋ฉ๋๋ค.
left, right, top, bottom, center ๋ฌธ์๋ฅผ ์ด์ฉํด ์์น๋ฅผ ์ค์ ํ ์ ์์ง๋ง ์ซ์๊ฐ์ ์
๋ ฅํด๋ ๊ธฐ์ค์ ์ ์ค์ ํ ์ ์์ต๋๋ค. transform-origin:0, 0;
์์ ์ธ์๋ x์ถ = 0, ๋ค์ ์ธ์๋ y์ถ = 0์ผ๋ก ํ์ํฉ๋๋ค.
transition
์ ํ๋ฉด ์ ํ, transform์ ๋ณํ, ์ด ๋๊ฐ์ง๋ฅผ ์ ์ ํ ์ ํ์ฉํ๋ฉด ์ ์ ์ฝ๋์์ผ๋ก ์น์ฌ์ดํธ์์ Awesomeํ ํจ๊ณผ๋ฅผ ๋ผ ์ ์์ต๋๋ค.ย