File tree 3 files changed +115
-17
lines changed
3 files changed +115
-17
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- import { Image } from ' astro:assets' ;
3
2
import { Icon } from ' astro-icon/components' ;
3
+ import { Image } from ' astro:assets' ;
4
4
5
5
import { getFormattedAuthorsList } from ' ../../utils/post' ;
6
6
import SiteNav from ' ../SiteNav/index.astro' ;
Original file line number Diff line number Diff line change 1
1
---
2
+ import { Icon } from ' astro-icon/components' ;
2
3
import { Image } from ' astro:assets' ;
3
4
import logo from ' ../../assets/icons/logo.svg' ;
4
5
import ' ./styles.css' ;
5
6
const BLOG_URL = Astro .site ?.href ;
6
7
---
7
- <nav id =" site-nav" >
8
- <ul >
8
+
9
+ <nav id =" desktop-navigation" aria-label =" Main blog navigation" >
10
+ <ul class =" nav-links" >
9
11
<li >
10
12
<a href ={ BLOG_URL } >
11
- <Image src ={ logo } alt =" TorontoJS Logo!" height ={ 70 } width ={ 70 } id =" logo-rounded" />
12
- </a >
13
- </li >
14
- <li >
15
- <a href ={ ` ${BLOG_URL }about ` } >
16
- About
13
+ <Image src ={ logo } class =" logo-rounded" alt =" TorontoJS Logo!" height ={ 70 } width ={ 70 } />
17
14
</a >
18
15
</li >
19
16
<li >
@@ -26,5 +23,53 @@ const BLOG_URL = Astro.site?.href;
26
23
License
27
24
</a >
28
25
</li >
26
+ <li >
27
+ <a href ={ ` ${BLOG_URL }about ` } >
28
+ About
29
+ </a >
30
+ </li >
29
31
</ul >
30
32
</nav >
33
+
34
+ <div id =" mobile-navigation" >
35
+ <a id =" mobile-logo" href ={ BLOG_URL } >
36
+ <Image src ={ logo } alt =" TorontoJS Logo!" height ={ 70 } width ={ 70 } class =" logo-rounded" />
37
+ </a >
38
+ <button
39
+ id =" hamburger-button" aria-controls =" mobile-menu" aria-expanded =" false" aria-haspopup =" true"
40
+ aria-label =" Open blog navigation" popovertarget =" mobile-menu"
41
+ >
42
+ <Icon
43
+ id =" hamburger-icon" name =" mdi:hamburger-menu" title =" Hamburger Menu Icon" width ={ 70 } height ={ 70 }
44
+ />
45
+ </button >
46
+ <nav popover id =" mobile-menu" aria-label =" Main blog navigation" >
47
+ <button popovertarget =" mobile-menu" aria-controls =" mobile-menu" aria-label =" Close blog navigation" >
48
+ <Icon
49
+ id =" close-icon" name =" mdi:close" title =" Close Icon" width ={ 70 } height ={ 70 }
50
+ />
51
+ </button >
52
+ <ul class =" nav-links" >
53
+ <li >
54
+ <a href ={ BLOG_URL } >
55
+ <Image src ={ logo } alt =" TorontoJS Logo!" height ={ 70 } width ={ 70 } class =" logo-rounded" />
56
+ </a >
57
+ </li >
58
+ <li >
59
+ <a href ={ ` ${BLOG_URL }accessibility ` } >
60
+ Accessibility
61
+ </a >
62
+ </li >
63
+ <li >
64
+ <a href ={ ` ${BLOG_URL }license ` } >
65
+ License
66
+ </a >
67
+ </li >
68
+ <li >
69
+ <a href ={ ` ${BLOG_URL }about ` } >
70
+ About
71
+ </a >
72
+ </li >
73
+ </ul >
74
+ </nav >
75
+ </div >
Original file line number Diff line number Diff line change 1
- # site-nav {
2
- padding : var (--size-2 );
1
+ # desktop-navigation , # mobile-navigation {
3
2
background-color : var (--tjs-dark-bg );
4
3
font-weight : bold;
4
+ padding : var (--size-2 );
5
5
}
6
6
7
- # site- nav ul {
7
+ . nav-links {
8
8
gap : var (--size-2 );
9
9
align-items : center;
10
- padding : var (--size-3 );
10
+ list-style : none;
11
+ display : flex;
12
+ padding : var (--size-3 )
11
13
}
12
14
13
- # site-nav a { color : white; }
15
+ .nav-links a {
16
+ color : white;
17
+ }
14
18
15
- # logo-rounded {
19
+ . logo-rounded {
16
20
border-radius : var (--size-2 );
17
21
}
18
22
19
- @media (max-width : 500px ) {
20
- # site-nav ul { flex-direction : column; }
23
+ # hamburger-button {
24
+ background-color : transparent;
25
+ padding : var (--size-3 )
26
+ }
27
+
28
+ # mobile-navigation {
29
+ display : none;
30
+ }
31
+
32
+ # mobile-menu : popover-open {
33
+ width : 100% ;
34
+ height : 100% ;
35
+ text-align : center;
36
+ display : flex;
37
+ flex-direction : column;
38
+ padding : var (--size-3 )
39
+ }
40
+
41
+ # mobile-menu : popover-open ul {
42
+ display : flex;
43
+ flex-direction : column;
44
+ padding : var (--size-2 );
45
+ }
46
+
47
+ # mobile-menu : popover-open button {
48
+ background-color : transparent;
49
+ margin-left : auto;
50
+ padding : var (--size-2 );
51
+ }
52
+
53
+ # mobile-logo {
54
+ align-content : center;
55
+ padding : var (--size-3 );
56
+ }
57
+
58
+ @media (max-width : 32rem ) {
59
+ # mobile-navigation {
60
+ display : flex;
61
+ justify-content : space-between;
62
+ text-align : right;
63
+ }
64
+
65
+ # desktop-navigation {
66
+ display : none;
67
+ }
68
+ }
69
+
70
+ @media (max-width : 32rem ) {
71
+ .nav-links {
72
+ flex-direction : column;
73
+ }
21
74
}
You can’t perform that action at this time.
0 commit comments