-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheckbox.html
121 lines (120 loc) · 2.48 KB
/
checkbox.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Pure CSS Sidebar Toggle Menu</title>
<style>
*{
box-sizing: border-box;
}
html, body {
overflow-x: hidden;
height: 100%;
}
body {
font-family: 'Varela Round', sans-serif;
background: #fff;
padding: 0;
margin: 0;
}
h1{
text-align: center;
padding-top: 30px;
}
.header {
background-color: #eb4d4b;
width: 100%;
height: 60px;
position: fixed;
z-index: 10;
}
.main {
height: 100%;
margin-top: 60px;
padding: 10px 50px;
}
#sidebarMenu {
height: 100%;
position: fixed;
left: 0;
top: 0;
width: 250px;
margin-top: 60px;
transform: translateX(-250px);
transition: transform 250ms ease-in-out;
background: #2e86de;
}
.menu{
list-style: none;
margin:0;
padding:0;
}
.menu li{
border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}
.menu li a{
color: #fff;
display: block;
padding: 20px;
text-transform: uppercase;
font-weight: bold;
text-decoration: none;
}
#openSidebarMenu:checked ~ #sidebarMenu {
transform: translateX(0);
}
input#openSidebarMenu{
display: none;
}
.sidebarIconToggle {
height: 22px;
width: 22px;
position: absolute;
z-index: 99;
top: 22px;
left: 15px;
transition: all 0.3s;
cursor: pointer;
}
.spinner {
height: 3px;
background-color: #fff;
transition: all 0.3s;
}
.spinner.middle ,
.spinner.bottom{
margin-top: 3px;
}
#openSidebarMenu:checked ~ .sidebarIconToggle > .spinner.middle {
opacity: 0;
}
#openSidebarMenu:checked ~ .sidebarIconToggle > .spinner.top {
transform: rotate(135deg);
margin-top: 8px;
}
#openSidebarMenu:checked ~ .sidebarIconToggle > .spinner.bottom {
transform: rotate(-135deg);
margin-top: -9px;
}
</style>
</head>
<body>
<div class="header"></div>
<input type="checkbox" id="openSidebarMenu">
<label for="openSidebarMenu" class="sidebarIconToggle">
<div class="spinner top"></div>
<div class="spinner middle"></div>
<div class="spinner bottom"></div>
</label>
<div id="sidebarMenu">
<ul class="menu">
<li><a href="#">Home</a></li>
<li><a href="#">About Us</a></li>
<li><a href="#">Gallery</a></li>
<li><a href="#">Products</a></li>
<li><a href="#">Contact Us</a></li>
</ul>
</div>
</body>
</html>