-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanimation.html
109 lines (95 loc) · 1.95 KB
/
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
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
101
102
103
104
105
106
107
108
109
<!DOCTYPE html>
<html lang="en">
<head>
<title>Document</title>
<style>
button {
padding: 10px 20px;
font-size: 16px;
border: none;
background-color: coral;
border-radius: 3px;
}
.right {
position: absolute;
left: 2%;
animation: moveRight 1s linear forwards;
}
.rightleft {
position: absolute;
top: 40%;
animation: moveBack 2s linear forwards;
}
.scaleout {
position: absolute;
top: 80%;
left: 10%;
transform: scale(2);
animation: scaleOut 2s linear forwards infinite;
}
.circle {
position: absolute;
top: 50%;
left: 50%;
height: 150px;
width: 150px;
/* border-radius: 50%;
border: 1px solid black; */
animation: circle 1s linear infinite;
}
.dot {
background-color: cadetblue;
height: 40px;
width: 40px;
border-radius: 50%;
}
@keyframes moveRight {
0% {
left: 2%;
}
100% {
left: 30%;
}
}
@keyframes moveBack {
0% {
left: 2%;
}
50% {
left: 30%;
}
100% {
left: 2%;
}
}
@keyframes scaleOut {
0% {
transform: scale(1);
}
50% {
transform: scale(2);
}
100% {
transform: scale(1);
}
}
@keyframes circle {
0% {
transform: rotateZ(0deg);
}
100% {
transform: rotateZ(360deg);
}
}
</style>
</head>
<body>
<h2>Animations</h2>
<button class="right">Move Right</button>
<button class="rightleft">Move Right and back</button>
<button class="scaleout">Scale out</button>
<div class="circle">
<div class="dot"></div>
</div>
</body>
</html>