-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCircle in CSS_Animation_Transition_circle_Spinner.html
96 lines (67 loc) · 1.95 KB
/
Circle in CSS_Animation_Transition_circle_Spinner.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
<!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>Circle</title>
<style>
.container {
/* To apply align-items, height should be applied to the container. I was never aware of it. */
border: 2px solid pink;
height: 700px;
display: flex;
justify-content: center;
align-items: center;
}
.circle {
border: 30px solid rgb(140, 0, 255);
border-top: 30px solid rgb(234, 0, 255);
height: 300px;
width: 300px;
border-radius: 300px;
animation-name: spin;
animation-duration: 1.3s;
animation-iteration-count: infinite;
animation-timing-function: ease-in-out;
/* Transitions */
transition-property: all;
transition-duration: 1s;
}
.circle:hover {
height: 400px;
width: 400px;
border: 40px solid rgb(234, 0, 255);
border-top: 40px solid rgb(140, 0, 255);
animation-name: spin-rev;
animation-duration: 1.3s;
animation-iteration-count: infinite;
animation-timing-function: ease-in-out;
transition-property: all;
transition-duration: 1s;
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
@keyframes spin-rev {
0% {
transform: rotate(360deg);
}
100% {
transform: rotate(0deg);
}
}
</style>
</head>
<body>
<div class="container">
<div class="circle">
</div>
</div>
</body>
</html>