본문 바로가기
코딩/과제

과제 CSS에 애니메이션 적용하기

by Song1234 2024. 4. 12.
@keyframes moving{
    from {
        padding-top: 100%;
        transform: rotate(720deg);
        
    }
    to {
        padding-top: 0%;
        transform: rotate(0deg);
    }
}
@keyframes rolling {
    from {
        left: 70px; /* 초기 위치: 부모 요소의 왼쪽 끝 */
        transform: rotate(0deg);
    }
    to {
        left: calc(100% - 120px); /* 최종 위치: 부모 요소의 너비에서 요소의 너비를 뺀 값만큼 이동 */
        transform: rotate(2880deg);
    }
}

#icon1 {
    animation: rolling 5s linear infinite alternate; 
    animation-delay: 4s;
}
#icon2 {
    animation: rolling 6s linear infinite alternate; 
    animation-delay: 4s;
}
#icon3 {
    animation: rolling 7s linear infinite alternate; 
    animation-delay: 4s;
}
#icon4 {
    animation: rolling 8s linear infinite alternate; 
    animation-delay: 4s;
}
* {
    margin: 0;
    padding: 0;
    animation-name: moving;
    animation-duration: 3s;
    animation-iteration-count: 1;
    animation-direction: alternate;
}

 

 

 

 

 

 

 

 

http://hyeon9502.dothome.co.kr/

 

송윤섭의 홈페이지

 

hyeon9502.dothome.co.kr

 

 

스마트폰 모드에서는 작동하지 않게 함.

 

'코딩 > 과제' 카테고리의 다른 글

CSS 과제 닷홈 CSS적용시키기  (0) 2024.04.11
CSS 과제2  (0) 2024.04.09
CSS 과제1  (0) 2024.04.09
과제 html  (0) 2024.04.05
과제 sql 파이썬을 이용한 프로그램  (2) 2024.04.01