File tree 5 files changed +120
-0
lines changed
5 files changed +120
-0
lines changed Original file line number Diff line number Diff line change 35
35
36
36
</ fieldset >
37
37
</ form >
38
+ < nav >
39
+ < img
40
+ src ="assets/menu.svg "
41
+ class ="menu "
42
+ id ="menu-btn "
43
+ alt ="open menu "
44
+ />
45
+ < ul class ="nav " id ="nav ">
46
+ < li class ="exit " id ="/assets/exit-btn ">
47
+ < img
48
+ src ="assets/exit.svg "
49
+ class ="menu "
50
+ id ="exit-btn "
51
+ alt ="close menu "
52
+ />
53
+ </ li >
54
+ < li class ="active "> < a href ="index.html "> Home</ a > </ li >
55
+ < li > < a href ="howmuchyarn.html "> How Much Yarn?</ a > </ li >
56
+ < li > < a href ="doctorwho.html "> Doctor Who Scarf</ a > </ li >
57
+ < li > < a href ="crafting-and-code.html "> Crafting and Code Coffee Chats and Discord </ a >
58
+ < li > < a href ="about.html "> About and Contact</ a > </ li >
59
+ < li > < a href ="index01.html "> Old Site Version 1.0</ a > </ li >
60
+ </ ul >
61
+ </ nav >
38
62
<!-- nav here -->
39
63
< section class ="hero ">
40
64
@@ -152,5 +176,6 @@ <h3 class="card__title">Developer Information</h3>
152
176
</ div >
153
177
</ main >
154
178
< script src ="/app.js "> </ script >
179
+ < script src ="/nav.js "> </ script >
155
180
</ body >
156
181
</ html >
Original file line number Diff line number Diff line change
1
+ // -- NAVIGATION --
2
+
3
+ const get = element => document . getElementById ( element ) ;
4
+
5
+ let open = get ( "menu-btn" ) ;
6
+ let nav = get ( "nav" ) ;
7
+ let exit = get ( "exit-btn" ) ;
8
+
9
+ open . addEventListener ( 'click' , ( ) => {
10
+ nav . classList . add ( 'open-nav' ) ;
11
+ } )
12
+
13
+ exit . addEventListener ( 'click' , ( ) => {
14
+ nav . classList . remove ( 'open-nav' ) ;
15
+ } )
Original file line number Diff line number Diff line change @@ -321,6 +321,73 @@ margin-bottom: 0.75rem;
321
321
margin : 1rem ;
322
322
}
323
323
324
+ /* Nav */
325
+
326
+ nav ul {
327
+ visibility : hidden;
328
+ opacity : 0 ;
329
+ position : fixed;
330
+ width : 100% ;
331
+ top : 0 ;
332
+ left : 0 ;
333
+ background : var (--clr-body-bg );
334
+ height : 100vh ;
335
+ margin-top : 5rem ;
336
+ padding-top : 5em ;
337
+ z-index : 100 ;
338
+ }
339
+
340
+ nav ul li a {
341
+ color : var (--clr-heading1 );
342
+ font-size : 1.5em ;
343
+ font-weight : bold;
344
+ padding : 1em ;
345
+ display : block;
346
+ }
347
+
348
+ .exit a {
349
+ width : 30px ;
350
+ height : 30px ;
351
+ position : absolute;
352
+ top : 0 ;
353
+ right : 0 ;
354
+ }
355
+
356
+ .open-nav {
357
+ visibility : unset;
358
+ opacity : 1 ;
359
+ transform : translateX (0 );
360
+ }
361
+
362
+ .menu {
363
+ color : var (--clr-test-lime );
364
+ fill : currentColor;
365
+ background-color : antiquewhite;
366
+ padding : 0.5rem ;
367
+ border-radius : 0.25rem ;
368
+ text-align : center;
369
+ }
370
+
371
+ ul .nav {
372
+ list-style : none;
373
+ }
374
+
375
+
376
+ ul .nav li a {
377
+ font-size : 2rem ;
378
+ padding : 0 1em ;
379
+ font-weight : normal;
380
+ }
381
+
382
+ ul .nav li : last-child a {
383
+ padding-right : 0 ;
384
+ }
385
+
386
+ ul .nav .active a {
387
+ font-weight : bold;
388
+ text-decoration : underline;
389
+ }
390
+
324
391
/* ---------------------------- */
325
392
/* --- COLOUR THEME PICKER --- */
326
393
/* ---------------------------- */
You can’t perform that action at this time.
0 commit comments