일자 : 24-2 11주차 (1)
@keyframes으로 HTML 태그의 시간별 모양 변화 만들기
@keyframes name{
시간 비율 {스타일; 스타일}
시간 비율 {스타일; 스타일}
} @keyframes textColorAnimation {
0% { color : blue; } /* 시작 시. 0% 대신 from 사용 가능 */
30% { color : green; } /* 30% 경과 시까지 */
100% { color : red; } /* 끝까지. 100% 대신 to 사용 가능 */
}애니메이션 스타일 시트 작성
span {
animation-name : textColorAnimation; /* 애니메이션 코드 이름 */
animation-duration : 5s; /* 애니메이션 1회 시간은 5초 */
animation-iteration-count : infinite; /* 무한 반복 */
}@keyframes <키 프레임명>{
0%{/*CSS 코드 */}
n%{/*CSS 코드 */}
100%{/*CSS 코드 */}
}
@keyframes bgchange{
0%{background-color:red;}
100%{background-color:green;}
}
@keyframes bgchange{
from{background-color:red;}
to{background-color:green;}
}
@keyframes bgchange{
0%{background-color:red;}
25%{background-color:green;}
50%{background-color:blue;}
100%{background-color:yellow;}
}
animation-name:<키 프레임명>;
animation-delay:<지연 시간>;

div{
width:100px;
height:100px;
background-color:red;
animation-name:bgchange;
animation-duration:5s;
animation-fill-mode:forwards;
}
animation-iteration-count:<횟수>;
animation-iteration-count:infinite;
animation-direction:<속성값>;
: HTML 태그에 적용된 CSS3 프로퍼티 값의 변화를 서서히 진행시켜 애니메이션 효과 생성
span{
transition : font-size 5s;
}
span:hover{
font-size : 500%;
}
: to change property values smoothly, over a given duration.
div {
transition-property: width;
transition-duration: 2s;
transition-timing-function: linear;
transition-delay: 1s;
}
div {
transition: width 2s linear 1s;
}
transition-property:<속성값>;
transition-property: background-color;transition-property: background-color, color, width;transition-property: all;transition-duration:<시간>;
transition-property: background-color, color, width;
transition-duration: 1s, 500ms, 2s;
transition-delay:<시간>;
transition-property:<속성값>;

