@keyframes bgChanges {
0% {
background-color: blue;
}
100% {
background-color: red;
}
}
@keyframes bgChanges {
from {
background-color: blue;
}
to {
background-color: red;
}
}
위 두개의 코드는 동일하다.
@keyframes bgChanges {
0% {
background-color: blue;
}
50% {
background-color: yellow;
}
67% {
background-color: orange;
}
100% {
background-color: red;
}
}
이렇게 중간의 상태를 지정할 수도 있다.
animation-name: bgChanges
animation-direction: normal;
animation-direction: alternate; //순방향으로 애니메이션을 시작해 역방향과 순방향으로 번갈아 애니메이션을 재생
animation-direction: reverse;
animation-direction: alternate-reverse; 역방향으로 애니메이션을 시작해 순방향과 역방향으로 번갈아 애니메이션을 재생
animation-iteration-count: infinite
animation-play-state: paused
animation-play-state: running
animation-fill-mode: none;
animation-fill-mode: forward; //애니메이션이 끝난 후의 마지막 상태가 유지, 얘를 제일 많이 쓴다.
animation-fill-mode: backward; //애니메이션이 시작되기 전의 첫 번째 상태가 적용, 애니메이션이 끝나면 원래 상태로 돌아온다.
animation-fill-mode: both; //애니메이션의 시작 전과 종료 후 모두 @keyframes에 정의된 스타일을 유지