본 자료는 박규하 코치님과 Elice 플랫폼의 자료를 사용하여 정리하였습니다.
<style>
.transition {
transform: rotate(45deg);
transform: scale(2, 3);
}
</style>
rotate(45deg)
45도 회전, deg를 사용, 음수도 가능scale(2, 3)
비율(width, height), 축소는 0.5처럼 소수점 입력<style>
.transition {
transform: skew(10deg, 20deg);
transform: translate(100px, 200px);
}
</style>
skew(10deg, 20deg)
각도변경(x축, y축), 음수도 가능translate(100px, 200px)
위치변경<style>
.transition {
-webkit-transform: translate(100px, 200px);
-moz-transform: translate(100px, 200px);
-ms-transform: translate(100px, 200px);
-o-transform: translate(100px, 200px);
}
</style>
-webkit
크롬, 사파리-moz
파이어폭스-ms
익스플로러 9.0-o
오페라<style>
.transition {
transition-property: width;
transition-duration: 2s;
}
</style>
transition-property
효과를 적용하고자 하는 CSS속성transition-duration
효과가 나타나는데 걸리는 시간<style>
.transition {
transition-timing-function: linear;
transition-delay: 1s;
}
</style>
transition-timing-function
효과의 속도(linear-일정하게)transition-delay
시작하기까지의 시간<style>
.transition:hover {
width: 300px;
}
</style>
<style>
.transition {
transition : width 2s linear 1s;
}
.transition:hover {
width: 300px;
}
</style>
<style>
.animation {
animation-name: changeWidth;
animation-duration: 3s;
animation-timing-function: linear;
animation-delay: 1s;
animation-iteration-count: 6;
animation-direction: alternate;
}
@keyframes changeWidth {
from {width: 300px;}
to {width: 600px;}
}
</style>
animation-name
Animation 이름 설정animation-duration
지속시간animation-timing-function
속도animation-delay
대기시간animation-iteration-count
반복횟수animation-direction
진행방향(normal-시작부터 끝, reverse-끝부터 시작, alternate-시작에서 끝에서 시작 반복)@keyframes
는 Animation과 짝꿍(from, to 대신 %로 진행상황 별 설정 가능)@-webkit-keyframes rotation {
from {-webkit- transform: rotate(-10deg);}
to {-webkit- transform: rotate(10deg);}
}