-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathOnOffButton.html
More file actions
82 lines (75 loc) · 2.4 KB
/
OnOffButton.html
File metadata and controls
82 lines (75 loc) · 2.4 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
<!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">
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<style>
body{
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: #0c0c0c;
}
label{
position: relative;
width: 80px;
height: 80px;
cursor: pointer;
border-radius: 50%;
}
label .btn{ /*Checkbox is controlled by this*/
position: absolute;
top: 0;
left: 0;
display: block;
width: 100%;
height: 100%;
background: #1b1b1b;
border-radius: 50%;
box-shadow: 0 3px 4px rgba(0, 0, 0, 1),
inset 0 -2px 5px rgba(0, 0, 0, 1),
inset 0 2px 2px rgba(255,255,255,0.5),
0 0 0 2px #000,
0 0 0 5px #0c0c0c,
0 0 0 5.5px #080808;
}
/* label input[type="checkbox"]:checked ~ .btn{
box-shadow: 0 0 0 rgba(0, 0, 0, 1),
inset 0 -2px 5px rgba(0, 0, 0, 1),
inset 0 1px 1px rgba(255,255,255,0.1),
0 0 0 2px #000,
0 0 0 5px #0c0c0c,
0 0 0 5.5px #00a1ff;
} */
label input[type="checkbox"]{
-webkit-appearance: none;
}
label .fa{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
font-size: 2.5em;
color: #0c0c0c;
}
label input[type="checkbox"]:checked ~ .fa{
color: #00ffe7;
text-shadow: 0 0 15px #00a1ff,
0 0 30px #00a1ff;
}
</style>
<title>On Off Button</title>
</head>
<body>
<label>
<input type="checkbox" name="">
<span class="btn"></span>
<i class="fa fa-power-off"></i>
</label>
</body>
</html>