-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathKeyframes&Animations.html
100 lines (90 loc) · 2.49 KB
/
Keyframes&Animations.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Keyframes and Animations</title>
<style>
.container {
display: flex;
background-color: peachpuff;
}
.box {
background-color: coral;
width: 100%;
height: 250px;
position: relative;
animation-name: Aman-1;
animation-duration: 8s;
animation-iteration-count: 1;
/* animation-iteration-count: infinite; */
/*This is to run animation infinite times*/
animation-fill-mode: forwards;
/*This will rest the animation where it ends*/
/* animation-fill-mode: alternate;*/
/*This will rest the animation where it started from*/
/* animation-timing-function:ease-in; */
/*This will slow down the animation in starting*/
animation-timing-function: ease-out;
/* animation-timing-function:ease-in-out; */
/*This will first slows down then fasts down*/
/* animation-delay: 3s; */
/*This will wait for 3s and then animation will start*/
/* animation-direction: reverse; */
/*This will decide the direction */
}
@keyframes Aman-1 {
from {
width: 200px;
}
to {
width: 100%;
}
}
.container-1 {
display: flex;
background-color: cornflowerblue;
}
.box-1 {
background-color: aqua;
width: 250px;
height: 250px;
position: relative;
animation-name: Aman-2;
animation-duration: 8s;
animation-iteration-count: 1;
}
@keyframes Aman-2 {
0%{
top:0px;
left:0px;
}
25%{
top: 250px;
left: 0px;
}
75%{
top: 250px;
left: 250px;
}
100%{
top: 0px;
left: 250px;
}
}
</style>
</head>
<body>
<div class="container">
<div class="box">
This is a box
</div>
</div>
<div class="container-1">
<div class="box-1">
This is another box
</div>
</div>
</body>
</html>