forked from GeekNerds/Hacktoberfest-2022
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathColourful_Checkbox_Loading.html
More file actions
100 lines (99 loc) · 1.78 KB
/
Colourful_Checkbox_Loading.html
File metadata and controls
100 lines (99 loc) · 1.78 KB
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" dir="ltr">
<head>
<meta charset="utf-8">
<title>Colourful Checkbox Loading</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<input type="checkbox" id="check">
<label for="check">
<div class="check-icon"></div>
</label>
<style>
@import url('https://fonts.googleapis.com/css?family=Poppins:400,500,600,700&display=swap');
*{
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Poppins', sans-serif;
}
html,body{
display: grid;
height: 100%;
place-items: center;
background: #000;
}
label{
position: relative;
height: 125px;
width: 125px;
display: inline-block;
border: 2px solid rgba(255,255,255,0.2);
border-radius: 50%;
border-left-color: #5cb85c;
animation: rotate 1.2s linear infinite;
}
@keyframes rotate {
50%{
border-left-color: #9b59b6;
}
75%{
border-left-color: #e67e22;
}
100%{
transform: rotate(360deg);
}
}
label .check-icon{
display: none;
}
label .check-icon:after{
position: absolute;
content: "";
top: 50%;
left: 28px;
transform: scaleX(-1) rotate(135deg);
height: 56px;
width: 28px;
border-top: 4px solid #5cb85c;
border-right: 4px solid #5cb85c;
transform-origin: left top;
animation: check-icon 0.8s ease;
}
@keyframes check-icon {
0%{
height: 0;
width: 0;
opacity: 1;
}
20%{
height: 0;
width: 28px;
opacity: 1;
}
40%{
height: 56px;
width: 28px;
opacity: 1;
}
100%{
height: 56px;
width: 28px;
opacity: 1;
}
}
input{
display: none;
}
input:checked ~ label .check-icon{
display: block;
}
input:checked ~ label{
animation: none;
border-color: #5cb85c;
transition: border 0.5s ease-out;
}
</style>
</body>
</html>