-
Notifications
You must be signed in to change notification settings - Fork 13
/
css-animation.html
72 lines (64 loc) · 1.66 KB
/
css-animation.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>CSS Animation</title>
<style>
/* The animation code */
@keyframes example1 {
from {
background-color: darkblue;
}
/* stejne jako 0% */
to {
background-color: lightskyblue;
}
/* stejne jako 100% */
}
@keyframes example2 {
0% {
background-color: black;
}
25% {
background-color: darkblue;
}
50% {
background-color: blue;
}
75% {
background-color: lightskyblue;
}
100% {
background-color: white;
}
}
/* The element to apply the animation to */
div.one {
width: 100px;
height: 100px;
background-color: lightskyblue; /* pocatecni a konecny stav pozadi */
animation-name: example1;
animation-duration: 3s;
}
div.two {
width: 100px;
height: 100px;
background-color: black; /* pocatecni a konecny stav pozadi */
border: 3px solid black;
animation-name: example2;
animation-duration: 3s;
animation-delay: 3s;
animation-iteration-count: 3;
/* animation-iteration-count: infinite; */ /* nekonecne opakovani */
/* animation-direction: reverse; */ /* dozadu */
/* animation-direction: alternate; */ /* stridani - dopredu-dozadu-dopredu */
}
</style>
</head>
<body>
<div class="one"></div>
<br>
<div class="two"></div>
</body>
</html>