Animation
Animation
animation : name | duration | timing-fuction | 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 | 애니메이션 실행 상태를 설정합니다. |
Transition
transition : property | duration | timing-fuction | delay
종류 | 예시 |
---|---|
transition-property | 트렌지션을 적용할 CSS 속성 대상을 설정합니다. |
transition-druation | 트렌지션 작동시간을 설정합니다. |
transition-timing-function | 트렌지션 움직임 효과를 설정합니다. |
transition-delay | 트렌지션이 시작되기 전까지 시간을 설정합니다. |
Timing-fuction
종류 | 예시 |
---|---|
linear | 일정한 간격으로 설정합니다. |
ease | 처음에는 서서히 가속하고 마지막 부분에서 급격히 감속합니다. |
ease-in | 처음에는 천천히 시작하고 마지막에 가속합니다. |
ease-out | 처음에는 최대 속도로 시작하고 마지막에 감속합니다. |
ease-in-out | 처음에는 제로 속도로 시작하고, 중간 지점에서 최고 속도로 움직이고, 마지막 부분에서 서서히 감속합니다. |
step-start | 애니메이션을 시작점에서 설정합니다. |
step-end | 애니메이션을 끝점에서 설정합니다. |
steps(int, start/end) | 애니메이션을 단계별을 설정합니다. |
cubic-bezier(n,n,n,n) | 버지니아 곡선 값을 만들어서 설정합니다. |
Animation-timing-function01Click
linear
ease
ease-in
ease-out
ease-in-out
.circle1.show {animation: move 2s 1 linear;}
.circle2.show {animation: move 2s 1 ease;}
.circle3.show {animation: move 2s 1 ease-in;}
.circle4.show {animation: move 2s 1 ease-out;}
.circle5.show {animation: move 2s 1 ease-in-out;}
@keyframes move {
0% {left: 0%;}
50% {left: calc(100% - 80px);}
100% {left: 0%;}
}
Animation-timing-function02 Click
step-start
step-end
steps(4, start)
steps(4, end)
steps(10, start)
steps(10, end)
.circle6.show {animation: move 3s 1 step-start;}
.circle7.show {animation: move 3s 1 step-end;}
.circle8.show {animation: move 3s 1 steps(4, start);}
.circle9.show {animation: move 3s 1 steps(4, end);}
.circle10.show {animation: move 3s 1 steps(10, start);}
.circle11.show {animation: move 3s 1 steps(10, end);}
See the Pen Animation Steps by webstory (@webstoryboys) on CodePen.
Animation-timing-function : Cubic-bezierClick
cubic-bezier(0,0,0,0)
cubic-bezier(1,0,0,1)
cubic-bezier(0,.6,.2,.97)
cubic-bezier(0,.6,.49,1.79)
cubic-bezier(1,-0.85,.49,1.79)
.circle12.show {animation: move 3s 10 cubic-bezier(0,0,0,0);}
.circle13.show {animation: move 3s 10 cubic-bezier(1,0,0,1);}
.circle14.show {animation: move 3s 10 cubic-bezier(0,.6,.2,.97);}
.circle15.show {animation: move 3s 10 cubic-bezier(0,.6,.49,1.79);}
.circle16.show {animation: move 3s 10 cubic-bezier(1,-0.85,.49,1.79);}
Animation-delayClick
circle17
circle18
circle18
circle20
.circle17.show {animation: move 3s 10 cubic-bezier(0,.6,.2,.97) 0.1s;}
.circle18.show {animation: move 3s 10 cubic-bezier(0,.6,.2,.97) 0.2s;}
.circle19.show {animation: move 3s 10 cubic-bezier(0,.6,.2,.97) 0.3s;}
.circle20.show {animation: move 3s 10 cubic-bezier(0,.6,.2,.97) 0.4s;}
Animation-derection normal reverse alternate alternate-reverse
circle21
.circle21.normal {animation: move2 3s 10 ease normal;}
.circle21.reverse {animation: move2 3s 10 ease reverse;}
.circle21.alternate {animation: move2 3s 10 ease alternate;}
.circle21.alternate-reverse {animation: move2 3s 10 ease alternate-reverse;}
@keyframes move2 {
0% {left: 0; top: 0;}
25% {left: calc(100% - 80px); top:0;}
50% {left: calc(100% - 80px); top: calc(100% - 80px)}
75% {left:0; top: calc(100% - 80px)}
100% {left: 0; top:0;}
}
Animation-iteration-count start
circle22
circle23
circle24
circle25
.circle22.show {animation: move 2s ease 1}
.circle23.show {animation: move 2s ease 2}
.circle24.show {animation: move 2s ease 3}
.circle25.show {animation: move 2s ease infinite}
Animation-play-state running pauesd
circle26
.sBox.s8 { height: 500px;}
.sBox.s8 > div.running {animation: move2 3s 10 ease; animation-play-state: running;}
.sBox.s8 > div.paused {animation: move2 3s 10 ease; animation-play-state: paused;}
Animation-play-state bounce rubberBand fadeInDown flip zoomInDown slideInDown
circle27
circle28
circle29
circle30
animate css
.sBox.s9 > div {display: inline-block;}
.sBox.s9 > div.bounce {animation: bounce 1s 10 ease;}
.sBox.s9 > div.rubberBand {animation: rubberBand 1s 10 ease;}
.sBox.s9 > div.fadeInDown {animation: fadeInDown 1s 10 ease;}
.sBox.s9 > div.flip {animation: flip 1s 10 ease;}
.sBox.s9 > div.zoomInDown {animation: zoomInDown 1s 10 ease;}
.sBox.s9 > div.slideInDown {animation: slideInDown 1s 10 ease;}