1596321360
@keyframes name {
0% { ... }
n% { ... }
100% { ... }
}
<!doctype html>
<html lang="ko">
<head>
<meta charset="utf-8">
<title>CSS</title>
<style>
@keyframes big {
from {
width: 0px;
height: 0px;
}
to {
width: 150px;
height: 150px;
}
}
div#jb {
margin: 30px auto;
background-color: orange;
animation-name: big;
animation-duration: 4s;
animation-timing-function: linear;
animation-delay: 0s;
animation-iteration-count: 1;
animation-direction: normal;
animation-fill-mode: forwards;
animation-play-state: running;
}
</style>
</head>
<body>
<div id="jb"></div>
</body>
</html>
#css
1596321360
@keyframes name {
0% { ... }
n% { ... }
100% { ... }
}
<!doctype html>
<html lang="ko">
<head>
<meta charset="utf-8">
<title>CSS</title>
<style>
@keyframes big {
from {
width: 0px;
height: 0px;
}
to {
width: 150px;
height: 150px;
}
}
div#jb {
margin: 30px auto;
background-color: orange;
animation-name: big;
animation-duration: 4s;
animation-timing-function: linear;
animation-delay: 0s;
animation-iteration-count: 1;
animation-direction: normal;
animation-fill-mode: forwards;
animation-play-state: running;
}
</style>
</head>
<body>
<div id="jb"></div>
</body>
</html>
#css
1596321000
animation-direction: normal | reverse | alternate | alternate-reverse | initial | inherit
<!doctype html>
<html lang="ko">
<head>
<meta charset="utf-8">
<title>CSS</title>
<style>
@keyframes big {
from {
width: 0px;
height: 0px;
}
to {
width: 150px;
height: 150px;
}
}
div#jb {
margin: 30px auto;
background-color: orange;
animation-name: big;
animation-duration: 2s;
animation-timing-function: linear;
animation-delay: 0s;
animation-direction: normal;
}
</style>
</head>
<body>
<div id="jb"></div>
</body>
</html>
비디오 플레이어
00:00
00:05
#css
1596328740
animation-duration: time | initial | inherit
3초에 걸쳐 박스가 커지는 예제입니다.
<!doctype html>
<html lang="ko">
<head>
<meta charset="utf-8">
<title>CSS</title>
<style>
@keyframes big {
from {
width: 0px;
height: 0px;
}
to {
width: 150px;
height: 150px;
}
}
div#jb {
margin: 30px auto;
background-color: orange;
animation-name: big;
animation-duration: 3000ms;
}
</style>
</head>
<body>
<div id="jb"></div>
</body>
</html>
#css
1596313740
다음은 CSS로 만든 간단한 애니메이션입니다. 작은 박스가 커졌다 작아집니다.
코드는 다음과 같습니다.
<!doctype html>
<html lang="ko">
<head>
<meta charset="utf-8">
<title>CSS</title>
<style>
@keyframes big {
from {
width: 20px;
height: 20px;
}
to {
width: 200px;
height: 200px;
}
}
div#jb {
margin: 30px auto;
width: 20px;
height: 20px;
background-color: orange;
animation-name: big;
animation-duration: 2s;
animation-timing-function: linear;
animation-delay: 2s;
animation-iteration-count: 4;
animation-direction: alternate;
animation-fill-mode: none;
animation-play-state: running;
}
</style>
</head>
<body>
<div id="jb"></div>
</body>
</html>
#css
1613984554
Flutter 는 정말 고급스러운 애니메이션을 어렵지 않은 API 로 사용할 수 있게 해줍니다. 이번 시간에는 AnimatedSwitcher 를 사용해서 화투 카드를 뒤집는 애니메이션을 제작해보도록 하겠습니다.
#flutter #mobile-apps #programming