-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
100 lines (87 loc) · 1.89 KB
/
index.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
<html>
<head>
<script src="./p5.min.js"></script>
<script src="./script.js"></script>
</head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
font-family: "Lato", sans-serif;
}
.sidebar {
height: 100%;
width: 0;
position: fixed;
z-index: 2;
top: 0;
left: 0;
background-color: #cfcfcf;
overflow-x: hidden;
transition: 0.5s;
padding-top: 15px;
}
.sidebar a {
padding: 8px 8px 8px 32px;
text-decoration: none;
font-size: 18px;
color: #000000;
display: block;
transition: 0.3s;
}
.sidebar a:hover {
color: #f1f1f1;
}
.sidebar .closebtn {
position: absolute;
top: 0;
right: 25px;
font-size: 36px;
margin-left: 50px;
}
.openbtn {
font-size: 20px;
cursor: pointer;
background-color: #ffffff;
color: black;
padding: 10px 15px;
border: none;
}
.openbtn:hover {
background-color: #b4b4b4;
}
#menu {
transition: margin-left .5s;
margin-bottom: -20px;
z-index: 1;
padding: 0px;
position: absolute;
}
#main{
z-index: 0;
}
</style>
<body>
<div id="mySidebar" class="sidebar">
<a href="javascript:void(0)" class="closebtn" onclick="closeNav()">×</a>
<a href="#">About</a>
<a href="#">Services</a>
<a href="#">Clients</a>
<a href="#">Contact</a>
</div>
<div id="menu">
<button class="openbtn" onclick="openNav()">☰</button>
</div>
<div id="main">
</div>
<script>
function openNav() {
document.getElementById("mySidebar").style.width = "250px";
document.getElementById("main").style.marginLeft = "250px";
}
function closeNav() {
document.getElementById("mySidebar").style.width = "0";
document.getElementById("main").style.marginLeft= "0";
}
</script>
</body>
</html>