-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathside-menu-template.html
executable file
·213 lines (196 loc) · 5.22 KB
/
side-menu-template.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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- <link rel="stylesheet" href="style.css"> -->
<style>
body {
font-family:Tahoma, Geneva, sans-serif;
/* font-family:Arial,Helvetica, sans-serif; */
}
p,ul{
line-height: 1.5em;
}
#myBtn {
display: none; /* Hidden by default */
position: fixed; /* Fixed/sticky position */
bottom: 10px; /* Place the button at the bottom of the page */
right: 10px; /* Place the button 30px from the right */
z-index: 99; /* Make sure it does not overlap */
border: none; /* Remove borders */
outline: none; /* Remove outline */
background-color:rgba(255, 0, 0, 0.7); /* Set a background color */
color: white; /* Text color */
cursor: pointer; /* Add a mouse pointer on hover */
padding: 15px; /* Some padding */
border-radius: 10px; /* Rounded corners */
font-size: 18px; /* Increase font size */
}
#myBtn:hover {
background-color: #555; /* Add a dark-grey background on hover */
}
#submenu {
font-size: 1em;
color: black; /* light green #e6ffcc; */
}
#ham{
margin-right:5px;
}
.sidenav {
height: 100%;
width: 0;
position: fixed;
z-index: 1;
top: 0;
left: 0;
background-color:#0099ff; /* green #4CAF50; */
overflow-x: hidden;
transition: 0.1s;
padding-top: 8px;
}
.sidenav a {
padding: 8px 8px 8px 32px;
text-decoration: none;
font-size: 1em;
color: #ffffff;
display: block;
transition: 0.1s;
}
.sidenav span{
padding: 8px 8px 8px 32px;
font-size: 1.2em;
color: #000;
background-color:#33adff;
margin-bottom:8px;
display: block;
}
.sidenav a:hover {
color: #f1f1f1;
}
.sidenav .closebtn {
cursor:pointer;
position: absolute;
top: 0;
right: 0;
font-size: 24px;
margin:0;
padding:8px;
}
#main {
transition: margin-left .1s;
padding: 14px;
}
.active{
background-color:#ff4d4d;
}
#submenu:hover {
background-color: #fff; /* Add a background on hover */
}
#menu:hover {
background-color: #000; /* Add a background on hover */
}
/* Create two equal columns that floats next to each other */
.column1 {
float: left;
width: 55%;
}
.column2 {
float: left;
width: 45%;
}
/* Clear floats after the columns */
.row:after {
content: "";
display: table;
clear: both;
}
/* Media response */
@media screen and (min-width: 850px) {
#main{ margin-left:250px;}
#ham{ display: none;}
#close{ display: none;}
#title{font-size:2.2em}
}
@media screen and (max-width: 850px) {
#main{margin-left:0}
.column1{width:100%}
.column2{width:100%}
#title{font-size:1.4em}
}
@media screen and (min-width: 1200px) {
#main{padding-left:45px;padding-right:45px;}
}
</style>
</head>
<body>
<!-- ##### NAVIGATION ##### -->
<div id="mySidenav" class="sidenav">
<span><b>Feng Shui </b>& Geomancy</span>
<a id="close" ahref="javascript:void(0)" class="closebtn" onclick="closeNav()">×</a>
<a href="#" class="active">INTRO</a>
<a href="#" id="menu">THEORY</a>
<a id="submenu" href="#">- Qi & Taoism</a>
<a id="submenu" href="#">- Yin & Yang</a>
<a id="submenu" href="#">- 5 Elements</a>
<a id="submenu" href="#">- 8 Directions</a>
<a href="#" id="menu">PRACTICE</a>
<a id="submenu" href="#">- Siting/Landscape</a>
<a id="submenu" href="#">- interior</a>
<a id="submenu" href="#">- Spaces/Portents</a>
<a id="submenu" href="#">- Horoscope</a>
<a href="#" id="menu">Thoughts</a>
<a id="submenu" href="#">- Advanced</a>
<a id="submenu" href="#">- Personal Practice</a>
<a id="submenu" href="#">- Reading List</a>
<a href="#">@contact</a>
</div>
<div id="main">
<!-- ###### TOP ^ UP BUTTON ###### -->
<button onclick="topFunction()" id="myBtn" title="Go to top">Top</button>
<span id="ham" style="font-size:2em;cursor:pointer" onclick="openNav()">☰</span><span id="title";><b>Feng Shui </b>& Geomancy</span>
<!-- ##### Content Sections ##### -->
<!-- /main content wrapper -->
</div>
<!-- ##### SCRIPTS ##### -->
<script>
function openNav() {
document.getElementById("mySidenav").style.width = "250px";
document.getElementById("main").style.marginLeft = "250px";
}
function closeNav() {
document.getElementById("mySidenav").style.width = "0";
document.getElementById("main").style.marginLeft= "0";
}
</script>
<script>
function myFunction(x) {
if (x.matches) { // If media query matches
document.getElementById("mySidenav").style.width = "0";
} else {
document.getElementById("mySidenav").style.width = "250px";
}
}
var x = window.matchMedia("(max-width: 850px)")
myFunction(x) // Call listener function at run time
x.addListener(myFunction) // Attach listener function on state changes
</script>
<script>
//Get the button
var mybutton = document.getElementById("myBtn");
// When the user scrolls down 20px from the top of the document, show the button
window.onscroll = function() {scrollFunction()};
function scrollFunction() {
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
mybutton.style.display = "block";
} else {
mybutton.style.display = "none";
}
}
// When the user clicks on the button, scroll to the top of the document
function topFunction() {
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;
}
</script>
</body>
</html>