테스트 사이트 - 개발 중인 베타 버전입니다

Animation 동작 효과 주기

· 3년 전 · 1550 · 2
animation 모든 animation 속성을 이용한 스타일을 한 줄에 설정할 수 있음.
animation-name 애니메이션 효과의 이름을 설정함.
animation-duration 애니메이션 효과를 재생할 시간을 설정함.
animation-delay 애니메이션 효과가 나타나기까지의 지연 시간을 설정함.
animation-iteration-count 애니메이션 효과가 몇 번 반복될지를 설정함.
animation-direction 애니메이션의 진행 방향을 설정함.
animation-timing-function 애니메이션 효과의 시간당 속도를 설정함.
animation-fill-mode 애니메이션 효과가 재생 중이 아닐 때 요소의 스타일을 설정함.
animation-play-state 애니메이션 효과의 재생 상태를 설정함.

 

예시>

 

HTML

  <div class="ani1"></div>
  <div class="ani2"></div>

CSS

.ani1{width:100px; height: 100px; margin: 50px auto 0 auto; background: #39e2f2;}
        .ani1:hover{animation: ani 1s ease-in-out .5s 2 alternate;}
        @keyframes ani{
            from{transform: scale(1) translate(0);}
            to{transform: scale(1.5) translate(20%);}
        }
.ani2{width:100px; height: 100px; margin: 100px auto 0 auto; background: #cf243f;}
        .ani2:hover{animation: ani 1s linear infinite alternate;}
        @keyframes ani{
            from{transform: scale(1) translate(0);}
            to{transform: scale(1.5) translate(20%);}
        }

속성값 참고>

ease-in 기본형으로 시작이 빠르게
ease-in-out  시작과끝이 빠르게
lieaner  일정속도
ease-out 끝이 빠르게
alternate 앞에부터 뒤까지 진행하고 다시 뒤에서 앞으로 진행
normal  앞에서부터 뒤로 진행
reverse 뒤에서 앞으로 진행

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기

댓글 2개

도움됩니다 감사합니다!! 할때마다 복붙이었는뎅,,
감사합니다.

게시글 목록

번호 제목
3381
3380
3379
3378
3377
3376
3375
3374
3373
3372
3371
3370
3369
3368
3367
3366
3365
3364
3363
3362
3361
3360
3359
3358
3357
3356
3355
3354
3351
3350