-
Notifications
You must be signed in to change notification settings - Fork 8
/
example.html
137 lines (116 loc) · 3.2 KB
/
example.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>UISwitch Example</title>
<link rel="stylesheet" href="css/uiswitch.css">
<style type="text/css">
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
background-color: #ffffff;
}
p {
font-size: 18px;
font-weight: 300;
}
pre, code {
font-family: Monaco, Menlo, "Courier New", Courier, monospace;
font-size: 13px;
}
pre {
text-align: left;
}
pre {
background-color: #fbfbfb;
border: 1px solid #eee;
padding: .6em;
display: inline-block;
border-radius: 3px;
}
.wrapper {
width: 90%;
margin: 0 auto;
text-align: center;
}
h1 {
font-weight: 200;
text-align: center;
margin: 2em;
}
.fields {}
.fields__item {
display: inline-block;
margin-right: 1.875em;
text-align: center;
}
h6 {
font-size: 12px;
font-weight: 500;
text-transform: uppercase;
letter-spacing: .5px;
color: #aaa;
margin: 1em;
}
.section {
margin: 2em auto;
}
.custom { background-color: #eadcbc; }
.custom::before { background-color: #f7f2e5; }
.custom::after { background: #fff3a6; }
.custom:checked {
background-color: #ffca3f; background-image: -webkit-linear-gradient(-90deg, #ffca3f 0%, #feca40 100%);
background-image: linear-gradient(-180deg,#ffca3f 0%, #feca40 100%);
}
.my-switch {
border-radius: 4px; }
.my-switch::before {
border-radius: 2px; }
.my-switch::after {
border-radius: 1px; }
.my-switch:checked {
background: hotpink; }
.my-switch:checked::after {
background-color: #333; }
</style>
</head>
<body>
<div class="wrapper">
<h1>CSS3 UISwitch Example</h1>
<section id="fields" class="fields section">
<div class="fields__item">
<input type="checkbox" class="uiswitch">
<h6>Off (unchecked)</h6>
</div>
<div class="fields__item">
<input type="checkbox" class="uiswitch" checked>
<h6>On (checked)</h6>
</div>
<div class="fields__item">
<input type="checkbox" class="uiswitch" disabled>
<h6>Disabled Off</h6>
</div>
<div class="fields__item">
<input type="checkbox" class="uiswitch" checked disabled>
<h6>Disabled On</h6>
</div>
<div class="fields__item">
<input type="checkbox" class="uiswitch custom">
<h6>Custom</h6>
</div>
<div class="fields__item">
<input type="checkbox" class="uiswitch my-switch">
<h6>Custom</h6>
</div>
</section>
<section id="usage" class="section">
<p>It's a one liner!</p>
<pre><code><input type="checkbox" class="uiswitch"></code></pre>
<p>Or just use SCSS and customize it too!</p>
<pre><code>import 'uiswitch';
$uiswitch-thumb-tint: #ffffff;
$uiswitch-on-tint: red;</code></pre>
</section>
</div>
</body>
</html>