Skip to content

Commit

Permalink
Add mobile navbar
Browse files Browse the repository at this point in the history
  • Loading branch information
MathyouMB committed Jun 29, 2024
1 parent 71eb9aa commit 4aa9616
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 4 deletions.
20 changes: 20 additions & 0 deletions src/components/Sidebar/Sidebar.astro
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,23 @@ const endSections = [
</div>
</div>
</div>

<div class="Sidebar__mobile">
<div class="Sidebar__mobile__inner">
{
sections
.filter((section) => !section.disabled)
.slice(0, 4)
.map((section) => (
<a href={section.link}>
<div class={`Sidebar__item`}>
<div class="Sidebar__item__icon">
<i class={section.icon} />
</div>
<div class="Sidebar__item__title">{section.title}</div>
</div>
</a>
))
}
</div>
</div>
51 changes: 51 additions & 0 deletions src/components/Sidebar/Sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,55 @@
color: #000000;
}
}

display: block;

@media (max-width: 768px) {
display: none;

.Sidebar__item {
flex-direction: column;
}

.Sidebar__item__title {
font-size: 0.1rem;
}
}
}

.Sidebar__mobile {
display: none;
width: 100vw;
z-index: 1;
position: fixed;
background-color: #ffffff;
bottom: 0;
justify-content: center;
border-top-width: 0.1rem;
border-color: #f1f1f1;
border-style: solid;
@media (max-width: 768px) {
display: flex;
}

&__inner {
display: flex;
justify-content: space-between;
width: 50%;
min-width: 14rem;
padding: 0.5rem;
gap: 0.5rem;
}
}

@media (max-width: 768px) {
.Sidebar__item {
flex-direction: column;
justify-content: center;
gap: 0.2rem;
}
.Sidebar__item__title {
font-size: 0.6rem;
padding-left: 0rem;
}
}
4 changes: 0 additions & 4 deletions src/layouts/Content/Content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@
}

@media (max-width: 768px) {
&__sidebar {
display: none;
}

&__page {
margin-left: 0;
}
Expand Down

0 comments on commit 4aa9616

Please sign in to comment.