File tree Expand file tree Collapse file tree 4 files changed +77
-9
lines changed Expand file tree Collapse file tree 4 files changed +77
-9
lines changed Original file line number Diff line number Diff line change 1
1
---
2
2
import HeaderLink from ' ./HeaderLink.astro' ;
3
+ import LinkToHome from ' ./LinkToHome.astro' ;
4
+
5
+ const { fillBg } = Astro .props ;
3
6
---
4
7
5
- <div class =" flex flex-row items-center" >
6
- <a href =" /" class =" flex items-center" >
7
- <div class =" i-bi-0-square text-yellow-500 text-xl" ></div >
8
- <div class =" i-bi-1-square-fill text-yellow-400 text-xl mr-1" ></div >
9
- <h1 class =" text-lg font-medium" >Bizarre Binary</h1 >
10
- </a >
11
- <div class =" mx-3" ></div >
8
+ <div
9
+ class:list ={ [
10
+ ' py-3' ,
11
+ ' flex' ,
12
+ ' flex-row' ,
13
+ ' items-center' ,
14
+ ' lg:ml--48' ,
15
+ ' xl:ml--60' ,
16
+ { ' bg-white' : fillBg },
17
+ ]}
18
+ >
19
+ <div class =" w-48 xl:w-60" >
20
+ <LinkToHome />
21
+ </div >
22
+ <div class =" mx-3 lg:hidden" ></div >
12
23
<nav >
13
24
<section class =" " >
14
25
<ul class =" unset flex gap-4 [&>li]:p-0" >
Original file line number Diff line number Diff line change
1
+ ---
2
+ ---
3
+
4
+ <a href =" /" class =" flex items-center" >
5
+ <div class =" i-bi-0-square text-yellow-500 text-xl" ></div >
6
+ <div class =" i-bi-1-square-fill text-yellow-400 text-xl mr-1" ></div >
7
+ <h1 class =" text-lg font-medium" >Bizarre Binary</h1 >
8
+ </a >
Original file line number Diff line number Diff line change
1
+ ---
2
+ import LinkToHome from ' ./LinkToHome.astro' ;
3
+ const path = Astro .url .pathname .replace (/ \/ $ / , ' ' );
4
+
5
+ const allToys = await Astro .glob (' ../../pages/toys/*.mdx' );
6
+
7
+ const pathMatchesUrl = (url : string ) => {
8
+ let sanitized = url ;
9
+
10
+ if (url .endsWith (' /' )) {
11
+ sanitized = url .slice (0 , - 1 );
12
+ }
13
+ return path .startsWith (sanitized );
14
+ };
15
+ ---
16
+
17
+ <!-- -z-10 is important to be not blocking interactivity on the main components as this components expands to full screen -->
18
+ <aside class =" fixed top-0 left-0 h-full w-full flex lt-lg:hidden -z-10" >
19
+ <div class =" flex-1 flex" >
20
+ <div class =" grow" ></div >
21
+ <!-- main -->
22
+ <div class =" w-48 xl:w-60 text-gray-500" >
23
+ <!-- "invisible" to act as a place holder while the real one is coming from ./Header.astro -->
24
+ <header class =" py-2.5 sticky top-0 w-full invisible" >
25
+ <LinkToHome />
26
+ </header >
27
+ <!-- safe list class="text-gray-800" -->
28
+ <div class =" px-3" >
29
+ <h2 class =" mt-10 my-2 font-bold text-gray-500" >Toys</h2 >
30
+ <ul class =" text-sm" >
31
+ {
32
+ allToys .map ((toy ) => (
33
+ <li class = " truncate" >
34
+ <a href = { toy .url } class = { toy .url && pathMatchesUrl (toy .url ) ? ' text-gray-800' : ' ' } >
35
+ { toy .frontmatter .title }
36
+ </a >
37
+ </li >
38
+ ))
39
+ }
40
+ </ul >
41
+ </div >
42
+ </div >
43
+ </div >
44
+ <!-- place holder to represent the actual content-->
45
+ <div class =" w-prose" ></div >
46
+ <div class =" flex-1" ></div >
47
+ </aside >
Original file line number Diff line number Diff line change 1
1
---
2
2
import Header from ' ../components/app/Header.astro' ;
3
+ import SideNavs from ' ../components/app/SideNavs.astro' ;
3
4
import GATag from ' ../components/app/GATag.astro' ;
4
5
import PWA from ' ../components/app/PWA.astro' ;
5
6
import GlobalStyle from ' ../components/app/GlobalStyle.astro' ;
@@ -32,9 +33,10 @@ const description = titleFromProps ? `${defaultTitle} - ${title}` : title;
32
33
<PWA />
33
34
</head >
34
35
<body class =" m-auto max-w-prose px-2 md:px-0 flex flex-col [min-height:100svh]" >
35
- <header class =" py-3 sticky z-20 top-0 bg-white " >
36
- <Header />
36
+ <header class =" sticky z-20 top-0" >
37
+ <Header fillBg = { true } />
37
38
</header >
39
+ <SideNavs />
38
40
<main >
39
41
<slot />
40
42
</main >
You can’t perform that action at this time.
0 commit comments