Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/components/header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ function Header() {
</div>
</div>
</div>

<div className={`page-overlay ${isMobileMenuOpen ? 'active' : ''}`} onClick={toggleMobileMenu}></div>
</header>

);
}

Expand Down
1 change: 1 addition & 0 deletions src/styles/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
--color-primary-01: #0a205a;
--color-primary-01-50: rgb(10 32 90 / 50%);
--color-primary-01-10: rgb(10 32 90 / 10%);
--color-primary-01-20: rgb(10 32 90 / 20%);
--color-primary-02: #f6ced5;
--color-primary-02-50: rgb(246 206 213 / 50%);
--color-primary-02-20: rgb(246 206 213 / 20%);
Expand Down
23 changes: 23 additions & 0 deletions src/styles/header.css
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,25 @@ a.subheading {
text-align: center;
}

/* Dimming Overlay */
.page-overlay {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background-color: var(--color-primary-01-20);
opacity: 0;
pointer-events: none;
z-index: 999;
}

/* Active Overlay State */

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job on the dimming overlay, but I'm encountering a small bug where if you enlarge the screen size before closing the mobile menu, the dimming overlay will remain on top of the Desktop screen.

Dimming overlay for mobile screen:

Image

Dimming overlay bug in desktop screen:

Image

.page-overlay.active {
opacity: 1;
pointer-events: auto;
}

.sr-only {
position: absolute;
width: 1px;
Expand Down Expand Up @@ -194,4 +213,8 @@ a.subheading {
.hamburger-button {
display: none !important;
}

.page-overlay {
display: none !important;
}
}