-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpopup.html
108 lines (108 loc) · 2.41 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
99
100
101
102
103
104
105
106
107
108
<!DOCTYPE html>
<html>
<head>
<title>popup</title>
<style type="text/css">
body {
width: 130px;
}
body * {
box-sizing: border-box;
}
.content {
position: relative;
margin: 10px;
}
.nx-form-item {
margin-bottom: 16px;
}
.nx-form-item:after,
.nx-form-item:before {
display: table;
content: "";
}
.nx-form-item__label {
text-align: right;
vertical-align: middle;
float: left;
font-size: 14px;
color: #606266;
line-height: 40px;
padding: 0 12px 0 0;
box-sizing: border-box;
}
.nx-form-item__content {
line-height: 40px;
margin-left: 60px;
}
.nx-switch {
position: relative;
display: inline-block;
line-height: 1;
vertical-align: middle;
width: 40px;
height: 20px;
background: #409eff;
border-radius: 40px;
}
.nx-switch__input[type=checkbox] {
position: absolute;
width: 0;
height: 0;
opacity: 0;
margin: 0;
}
.nx-switch__core {
margin: 0;
display: inline-block;
position: relative;
width: 40px;
height: 20px;
border: 1px solid #dcdfe6;
outline: none;
border-radius: 10px;
box-sizing: border-box;
background: #dcdfe6;
cursor: pointer;
transition: border-color .3s,background-color .3s;
vertical-align: middle;
}
.nx-switch__core:after {
content: "";
position: absolute;
top: 1px;
left: 1px;
border-radius: 100%;
transition: all .3s;
width: 16px;
height: 16px;
background-color: #fff;
}
.nx-switch__input[type=checkbox]:checked + .nx-switch__core {
border-color: #409eff;
background-color: #409eff;
}
.nx-switch__input[type=checkbox]:checked + .nx-switch__core:after {
left: 100%;
margin-left: -17px;
}
</style>
</head>
<body>
<div class="content">
<div class="nx-form">
<div class="nx-form-item">
<label class="nx-form-item__label">catcher</label>
<div class="nx-form-item__content">
<div class="nx-switch">
<input type="checkbox" id="switch" class="nx-switch__input"/>
<label for="switch" class="nx-switch__core"></label>
</div>
</div>
</div>
</div>
</div>
<script src="./js/popup.js"></script>
</div>
</body>
</html>