Get rid of media query nav white space

<div class="menu-wrap"> <input type="checkbox" class="toggler"/> <div class="hamburger"> <div></div> </div> <div class="menu"> <div> <div> <ul> <li> <a href="#" onclick= "closeMenu()">Home</a> </li> <li><a href="#About" onclick="closeMenu()" >About P.L.A.</a> </li> <li> <a href="#">Interviews</a> </li> <li> <a href="#">They Write by Night</a> </li> <li> <a href="#">17 Virtual Readings List</a> </li> <li> <a href="#">LGBTQ + Literary Connections</a> </li> <li> <a href="#Donate">Donate</a> </li> <li> <a href="#">Explore</a> </li> </ul> </div> </div> </div> </div>

menuOverlay.css
`/* CORE STYLES */
:root {
–primary-color: rgba(13, 110, 139, 0.75);
–overlay-color: rgba(24, 39, 51 , 0.85);
–menu-speed: 0.75s;
}

  • {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    }

body {
font-family: ‘Roboto’, sans-serif;
line-height: 1.4;
}

.container {
max-width: 960px;
margin: auto;
overflow: hidden;
padding: 0 3rem;
}

.showcase {
background: var(–primary-color);
color: #fff;
height: 100vh;
position: relative;
}

.showcase:before {
content: ‘’;
background: url(‘https://images.pexels.com/photos/533923/pexels-photo-533923.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260’) no-repeat center center/cover;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1;
}

.showcase .showcase-inner {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
text-align: center;
height: 100%;
}

.showcase h1 {
font-size: 4rem;
}

.showcase p {
font-size: 1.3rem;
}

.btn {
display: inline-block;
border: none;
background: var(–primary-color);
color: #fff;
padding: 0.75rem 1.5rem;
margin-top: 1rem;
transition: opacity 1s ease-in-out;
text-decoration: none;
}

.btn:hover {
opacity: 0.7;
}

/* MENU STYLES */
.menu-wrap {
position: fixed;
top: 0;
left: 0;
z-index: 1;
}

.menu-wrap .toggler {
position: absolute;
top: 0;
left: 0;
z-index: 2;
cursor: pointer;
width: 50px;
height: 50px;
opacity: 0;
}

.menu-wrap .hamburger {
position: absolute;
top: 0;
left: 0;
z-index: 1;
width: 60px;
height: 60px;
padding: 1rem;
background: var(–primary-color);
display: flex;
align-items: center;
justify-content: center;
}

/* Hamburger Line */
.menu-wrap .hamburger > div {
position: relative;
flex: none;
width: 100%;
height: 2px;
background: #fff;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.4s ease;
}

/* Hamburger Lines - Top & Bottom */
.menu-wrap .hamburger > div::before,
.menu-wrap .hamburger > div::after {
content: ‘’;
position: absolute;
z-index: 1;
top: -10px;
width: 100%;
height: 2px;
background: inherit;
}

/* Moves Line Down */
.menu-wrap .hamburger > div::after {
top: 10px;
}

/* Toggler Animation */
.menu-wrap .toggler:checked + .hamburger > div {
transform: rotate(135deg);
}

/* Turns Lines Into X */
.menu-wrap .toggler:checked + .hamburger > div:before,
.menu-wrap .toggler:checked + .hamburger > div:after {
top: 0;
transform: rotate(90deg);
}

/* Rotate On Hover When Checked */
.menu-wrap .toggler:checked:hover + .hamburger > div {
transform: rotate(225deg);
}

/* Show Menu */
.menu-wrap .toggler:checked ~ .menu {
visibility: visible;
}

.menu-wrap .toggler:checked ~ .menu > div {
transform: scale(1);
transition-duration: var(–menu-speed);
}

.menu-wrap .toggler:checked ~ .menu > div > div {
opacity: 1;
transition: opacity 0.4s ease 0.4s;
}

.menu-wrap .menu {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
visibility: hidden;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
}

.menu-wrap .menu > div {
background: var(–overlay-color);
border-radius: 50%;
width: 200vw;
height: 200vw;
display: flex;
flex: none;
align-items: center;
justify-content: center;
transform: scale(0);
transition: all 0.4s ease;
}

.menu-wrap .menu > div > div {
text-align: center;
max-width: 90vw;
max-height: 100vh;
opacity: 0;
transition: opacity 0.4s ease;
}

.menu-wrap .menu > div > div > ul > li {
list-style: none;
color: #fff;
font-size: 1.5rem;
padding: 1rem;
}

.menu-wrap .menu > div > div > ul > li > a {
color: inherit;
text-decoration: none;
transition: color 0.4s ease;
}`

Here is an example: How To Create an Overlay

Hi @kat,
Thanks for the info about the overlay. What I really wanted to see is how you integrated my suggestions that don’t seem to be working for you.
Thanks,
Bob

@kat Hi Kathleen,

If you pm me your email address I will sent you a We transfer folder with a Bootstrap 4 project only containing 2 pages HOME and ABOUT holding a kind of menu you are looking for. Easy to implement in any website not only Bootstrap!

It works with a hamburger menu only. Looks a bit more modern.

It’s technically not possible to upload it to the forum unfortunately!

David

I reposted mcgraphics.us/poets. Is there a PG tutorial on js or documentation on how to use it?
My html will work with Bootstrap 4 that David @AllMediaLab is sending me, right?
I don’t mind redoing this lots of different ways as I’m learning.

It’s in your mailbox! Containing a 2 page test site with a similar menu as on your example. If you want to use a normal navigation for bigger sizes you only have to make a media query for bigger screens normal menu and smaller screens the hamburger menu. Have fun!

1 Like

Hey @kat,
So odd - when I open your site directly I can see the script at the bottom. When I open the URL in Pinegrow it disappears. Anyway, the problem with the script is the class that is being searched in the document. I thought it should be .toggle, but it should be .toggler. Just replace that in the querySelector and it should work fine.
Bob

1 Like

I will! So exciting. Thank you.

Works perfectly!!!
On to David @AllMediaLab navigation.

You’re right this is really elegant. I especially like the way links transitions out on close.
Thanks so much for sharing.

1 Like