-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hamburger.astro created. Navigation.astro and Search.astro tweaked
- Loading branch information
1 parent
343e46a
commit 8557394
Showing
10 changed files
with
220 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
--- | ||
import HeaderLink from './HeaderLink.astro' | ||
import Svg from '@/components/Svg/index.astro' | ||
--- | ||
|
||
<div class="hamburger-menu"> | ||
<input type="checkbox" id="menu-toggle-check" /> | ||
<label for="menu-toggle-check" class="hamburger-icon-btn"><span></span></label | ||
> | ||
<nav class="menu-content"> | ||
<div class="nav-links"> | ||
<HeaderLink href="/">Home</HeaderLink> | ||
<HeaderLink href="/blog">Blog</HeaderLink> | ||
<HeaderLink href="/about">About</HeaderLink> | ||
</div> | ||
<div class="icon-links"> | ||
<a href="https://twitter.com/astrodotbuild" target="_blank"> | ||
<span class="sr-only">Follow Me on X(previous Twitter)</span> | ||
<Svg iconName="twitter" width={32} height={32} /> | ||
</a> | ||
<a href="https://github.com/brklntmhwk" target="_blank"> | ||
<span class="sr-only">Go to the GitHub repo</span> | ||
<Svg iconName="github" width={32} height={32} /> | ||
</a> | ||
</div> | ||
</nav> | ||
</div> | ||
<style> | ||
nav.menu-content { | ||
width: 100%; | ||
height: 100%; | ||
position: fixed; | ||
top: 0; | ||
left: 100%; | ||
z-index: 80; | ||
padding-top: 3rem; | ||
margin-top: 4rem; | ||
background-color: #f4f4f4; | ||
transition: all 0.2s; | ||
} | ||
nav.menu-content > * { | ||
padding: 0.75rem 2.25rem; | ||
} | ||
.nav-links { | ||
display: grid; | ||
row-gap: 1rem; | ||
} | ||
.icon-links { | ||
display: flex; | ||
column-gap: 1rem; | ||
} | ||
.hamburger-icon-btn { | ||
/* position: fixed; | ||
top: 10px; | ||
right: 10px; */ | ||
height: 2.5rem; | ||
width: 2.5rem; | ||
cursor: pointer; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
z-index: 90; | ||
} | ||
.hamburger-icon-btn span, | ||
.hamburger-icon-btn span:before, | ||
.hamburger-icon-btn span:after { | ||
content: ''; | ||
display: block; | ||
height: 3px; | ||
width: 25px; | ||
border-radius: 3px; | ||
background-color: #000000; | ||
position: absolute; | ||
} | ||
.hamburger-icon-btn span:before { | ||
bottom: 8px; | ||
} | ||
.hamburger-icon-btn span:after { | ||
top: 8px; | ||
} | ||
#menu-toggle-check:checked ~ .hamburger-icon-btn span { | ||
background-color: transparent; | ||
} | ||
#menu-toggle-check:checked ~ .hamburger-icon-btn span::before { | ||
bottom: 0; | ||
transform: rotate(45deg); | ||
} | ||
#menu-toggle-check:checked ~ .hamburger-icon-btn span::after { | ||
top: 0; | ||
transform: rotate(-45deg); | ||
} | ||
#menu-toggle-check:checked ~ nav.menu-content { | ||
left: 0; | ||
} | ||
#menu-toggle-check { | ||
display: none; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.