-
Notifications
You must be signed in to change notification settings - Fork 0
/
popup.html
91 lines (91 loc) · 1.78 KB
/
popup.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
<!doctype html>
<html>
<head>
<title>Turn on dark mode</title>
<style>
body {
display: flex;
margin: 0;
}
.switcher {
position: relative;
width: 80px;
height: 30px;
overflow: hidden;
}
.switcher input {
appearance: none;
position: relative;
width: 80px;
height: 30px;
background-color: #1A1A1A;
outline: none;
font-family: "Oswald", sans-serif;
transition: background-color 0s 0.5s;
margin: 0;
}
.switcher input:before,
.switcher input:after {
z-index: 2;
position: absolute;
top: 50%;
transform: translateY(-50%);
color: #FFFFFF;
}
.switcher input:before {
content: "OFF";
color: #1A1A1A;
left: 15px;
}
.switcher input:after {
content: "ON";
color: #FFFFFF;
right: 15px;
}
.switcher label {
z-index: 1;
position: absolute;
top: 0px;
width: 80px;
height: 30px;
}
.switcher input:checked {
background-color: #1A1A1A;
}
.switcher input:checked + label {
background: #1A1A1A;
animation: turn-off 0.5s ease-out;
}
@keyframes turn-on {
0% {
left: 100%;
}
100% {
left: 0%;
}
}
.switcher input:not(:checked) {
background-color: #FFFFFF;
}
.switcher input:not(:checked) + label {
background-color: #FFFFFF;
animation: turn-on 0.5s ease-out;
}
@keyframes turn-off {
0% {
right: 100%;
}
100% {
right: 0%;
}
}
</style>
<script src="popup.js"></script>
</head>
<body>
<span class="switcher">
<input type="checkbox" id="switcher">
<label for="switcher"></label>
</span>
</body>
</html>