-
Notifications
You must be signed in to change notification settings - Fork 8
/
popup.html
98 lines (97 loc) · 2.46 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
92
93
94
95
96
97
98
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>高亮设置</title>
<style type="text/css">
body {
width: 117px;
height: 100px;
background: #f4f1f1;
}
.text {
display: none;
}
.on {
color:#333;
}
.off {
color:#eee;
}
.circle {
position: absolute;
display: inline-block;
}
#radio {
display: none;
}
#radio ~label {
background-color: #aeaaaa;
}
#radio ~label .circle {
left: 0;
transition: all 0.3s;
--webkit-transition: all 0.3s;
}
#radio ~label .on {
display: none;
}
#radio ~ label .off {
display: inline-block;
padding-left: 30px;
}
#radio:checked ~ label {
background: #65f065;
}
#radio:checked ~label .circle {
left: 34px;
}
#radio:checked ~label .on {
display: inline-block;
padding-left: 11px;
}
#radio:checked ~ label .off {
display: none;
}
label {
display: inline-block;
position: relative;
height: 26px;
width: 60px;
border-top-left-radius: 15px 50%;
border-bottom-left-radius: 15px 50%;
border-top-right-radius: 15px 50%;
border-bottom-right-radius: 15px 50%;
}
label .circle {
display: inline-block;
height: 22px;
width: 22px;
border-radius: 50%;
border: 2px solid #d5d2d2;
background-color: #eee;
}
label .text {
line-height: 27px;
font-family: sans-serif;
}
.btn-desc {
font-size: 110%;
}
.btn-extra {
color: grey;
}
</style>
</head>
<body>
<span class="btn-desc">高亮开关</span>
<input type="checkbox" id="radio" name="switch">
<label for="radio" class="radio">
<span class="circle"></span>
<span class="text on">ON</span>
<span class="text off">OFF</span>
</label>
<p id="desc-extra" class="btn-extra">该开关只影响双击时是否高亮,右键和快捷键不受影响</p>
</body>
<script type="text/javascript" src='popup.js'></script>
</html>