Skip to content

Commit

Permalink
Update styles
Browse files Browse the repository at this point in the history
  • Loading branch information
derekmbrown committed Feb 2, 2025
1 parent 120bb63 commit 29e1bb5
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 46 deletions.
37 changes: 11 additions & 26 deletions src/components/Nav.astro
Original file line number Diff line number Diff line change
@@ -1,29 +1,14 @@
---
import Navbar from './ui/Navbar'
import NavAstro from './Navbar.astro'
const { PageName } = Astro.props
import Emoji from 'astro-emoji'
---

<Navbar client:load>
<NavAstro slot="navbar"/>
</Navbar>

<script define:vars={{ PageName }} is:inline>

switch (PageName) {
case 'Home':
case 'Note':
case 'Notes':
document.getElementById('notes').classList.add('active')
break;
case 'Tag':
case 'Tags':
document.getElementById('tags').classList.add('active')
break;
case 'About':
document.getElementById('about').classList.add('active')
break;
}

</script>
<nav class="flex flex-col mt-12 mb-10 text-[#F2F5F7]">
<div class="flex font-['Merriweather'] text-4xl font-black mb-3">
<a href="/">Derek Brown <Emoji symbol="👨🏻‍💻" label="person" /></a>
</div>
<div class="font-['Merriweather'] text-xl flex items-center gap-4">
<span class="navItem" id="notes"><a href="/">Notes</a></span>
<span class="navItem" id="tags"><a href="/tags">Tags</a></span>
<span class="navItem" id="about"><a href="/about">About</a></span>
</div>
</nav>
37 changes: 26 additions & 11 deletions src/components/Navbar.astro
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
---
import Emoji from 'astro-emoji'
import Nav from './ui/Nav'
import NavAstro from './Nav.astro'
const { PageName } = Astro.props
---

<nav class="flex flex-col mt-12 mb-10 text-[#F2F5F7]">
<div class="flex font-['Merriweather'] text-4xl font-black mb-3">
<a href="/">Derek Brown <Emoji symbol="👨🏻‍💻" label="person" /></a>
</div>
<div class="font-['Merriweather'] text-xl flex items-center gap-4">
<span class="navItem" id="notes"><a href="/">Notes</a></span>
<span class="navItem" id="tags"><a href="/tags">Tags</a></span>
<span class="navItem" id="about"><a href="/about">About</a></span>
</div>
</nav>
<Nav>
<NavAstro slot="nav"/>
</Nav>

<script define:vars={{ PageName }} is:inline>

switch (PageName) {
case 'Home':
case 'Note':
case 'Notes':
document.getElementById('notes').classList.add('active')
break;
case 'Tag':
case 'Tags':
document.getElementById('tags').classList.add('active')
break;
case 'About':
document.getElementById('about').classList.add('active')
break;
}

</script>
7 changes: 7 additions & 0 deletions src/components/ui/Nav.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default function Nav(props) {
return (
<div>
{props.nav}
</div>
)
}
7 changes: 0 additions & 7 deletions src/components/ui/Navbar.jsx

This file was deleted.

4 changes: 2 additions & 2 deletions src/layouts/Main.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
import Head from './Head.astro'
import Nav from '../components/Nav.astro'
import Navbar from '../components/Navbar.astro'
import Footer from '../components/Footer.astro'
const { PageName, TabTitle, MetaTitle, MetaDescription, MetaTag, MetaUrl } = Astro.props
Expand All @@ -10,7 +10,7 @@ const { PageName, TabTitle, MetaTitle, MetaDescription, MetaTag, MetaUrl } = Ast
<Head {TabTitle} {MetaTitle} {MetaDescription} {MetaTag} {MetaUrl} />
<body>
<div class="flex flex-col container mx-auto max-w-2xl h-screen px-7">
<Nav {PageName} />
<Navbar {PageName} />
<div class="flex-grow">
<slot />
</div>
Expand Down

0 comments on commit 29e1bb5

Please sign in to comment.