-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
247 lines (208 loc) · 6.69 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
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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Core CSS functionality -->
<style>
.navigation {
display: flex;
flex-direction: column;
position: absolute;
top: 0;
right: 1em;
text-align: center;
}
.navigation__list {
list-style-type: none;
padding-left: unset;
position: relative;
z-index: 1;
display: none;
visibility: hidden;
opacity: 0;
filter: alpha(opacity=0);
}
.navigation__label {
position: relative;
z-index: 1;
}
.navigation__label:hover {
cursor: pointer;
}
/**
* Note, for accessibility neither of the following may be used
* display: none;
* visibility: hidden;
*/
.navigation__checkbox {
position: fixed;
opacity: 0;
filter: alpha(opacity=0); /* Old Microsoft opacity */
}
.navigation__checkbox:checked ~ .navigation__list,
.navigation__checkbox[checked] ~ .navigation__list {
display: block;
visibility: visible;
opacity: 1;
filter: alpha(opacity=1);
}
.navigation__checkbox:checked + .navigation__label::before,
.navigation__checkbox[checked] + .navigation__label::before {
content: '';
background-color: lightblue;
opacity: 0.2;
filter: alpha(opacity=20);
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
}
.navigation__checkbox:checked + .navigation__label:hover::before,
.navigation__checkbox[checked] + .navigation__label:hover::before {
cursor: not-allowed;
}
</style>
<!-- Enhancements to make presentation prettier -->
<link rel="stylesheet" href="assets/css/style.css">
<!-- Thanks be to https://realfavicongenerator.net -->
<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png" />
<link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png" />
<link rel="mask-icon" href="safari-pinned-tab.svg" color="#5bbad5" />
<link rel="manifest" href="site.webmanifest" />
<meta name="msapplication-TileColor" content="#da532c" />
<meta name="theme-color" content="#ffffff" />
<!-- Bog-standard head data -->
<meta charset="UTF-8">
<title>Pure CSS and HTML Navigation Menu</title>
</head>
<body>
<header>
<h1 class="site__title">
Pure CSS and HTML Navigation Menu
</h1>
<nav class="navigation">
<input class="hidden navigation__checkbox"
id="site__navigation__checkbox"
type="checkbox">
<label class="navigation__label"
for="site__navigation__checkbox"
title="Open or close navigation menu"
>Menu</label>
<ul class="hidden navigation__list">
<li class="navigation__item">
<a class="navigation__link"
href="/css-navigation-menu/"
title="Main index page for this site"
>Home</a>
</li>
<li class="navigation__item">
<a class="navigation__link"
href="https://github.com/web-dev-examples/css-navigation-menu/"
title="Git repository with source, and documentation, for this site"
>Source</a>
</li>
<li class="navigation__item">
<a class="navigation__link"
href="https://liberapay.com/web-dev-examples/"
title="Consider supporting this, and similar, Open Source projects"
>Sponsor</a>
</li>
<li class="navigation__sub_menu">
<input class="hidden navigation__checkbox"
id="sub_menu__navigation__checkbox"
type="checkbox">
<label class="navigation__label"
for="sub_menu__navigation__checkbox"
title="Open or close navigation sub-menu"
>Sub-menu</label>
<ul class="hidden navigation__list">
<li class="navigation__item">
<a class="navigation__link"
href="#"
title="Example sub-menu link to somewhere"
>Somewhere</a>
</li>
<li class="navigation__item">
<a class="navigation__link"
href="#"
title="Example sub-menu link to somewhere"
>Elsewhere</a>
</li>
</ul>
</li>
<li class="navigation__item">
<a class="navigation__link"
href="https://github.com/S0AndS0/"
title="GitHub profile of author/maintainer of this project"
>Author</a>
</li>
</ul>
</nav>
</header>
<main>
<article>
<h2 class="article__title">
</h2>
<p>
This site demonstrates utilizing pure CSS3 and HTML5 to build a
menu. Prefix the current URL with <code>view-source:</code> to view
the core source code that achieves this functionality.
</p>
<p>
Alternatively, the source code may be cloned via Git from
<a href="https://github.com/web-dev-examples/css-navigation-menu">
GitHub
</a>
</p>
<p>
<strong>With SSH:</strong>
</p>
<pre>
<code>git clone [email protected]/web-dev-examples/css-navigation-menu.git</code>
</pre>
<p>
<strong>With HTTPS:</strong>
</p>
<pre>
<code>git clone https://github.com/web-dev-examples/css-navigation-menu.git</code>
</pre>
<ul>
<li>
<p>
The <code>index.html</code> file contains the core functionality
and markup required to replicate these features.
</p>
</li>
<li>
<p>
The <code>assets/css/style.css</code> file defines optional
enhancements to page layout and menu presentation.
</p>
</li>
</ul>
</article>
</main>
<footer>
<section id="copyright__contianer">
<span id="copyright__symbol">
©
</span>
<span id="copyright__text">
S0AndS0
--
<a href="https://github.com/web-dev-examples/css-navigation-menu/blob/gh-pages/LICENSE">
AGPL-3.0
</a>
--
</span>
<span id="copyright__date">
2021
</span>
</section>
</footer>
</body>
</html>
<!--
vim: textwidth=79
-->