<button id="menuBtn" class="menu-trigger">Menu</button>
<div id="fullNav" class="full-overlay">
<button id="closeBtn" class="close-trigger">×</button>
<nav class="overlay-content">
<a href="#">Home</a>
<a href="#">Work</a>
<a href="#">About</a>
<a href="#">Contact</a>
</nav>
</div>.menu-trigger {
font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
padding: 10px 20px;
background: #111827;
color: white;
border: none;
border-radius: 8px;
cursor: pointer;
font-size: 1rem;
}
.full-overlay {
font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
height: 100%;
width: 0;
position: fixed;
z-index: 100;
top: 0;
left: 0;
background-color: #111827;
overflow-x: hidden;
transition: width 0.4s cubic-bezier(0.77, 0, 0.175, 1);
}
.full-overlay.open {
width: 100%;
}
.overlay-content {
position: relative;
top: 25%;
width: 100%;
text-align: center;
display: flex;
flex-direction: column;
gap: 20px;
}
.overlay-content a {
text-decoration: none;
font-size: 2.5rem;
color: #9ca3af;
transition: color 0.3s;
font-weight: 700;
}
.overlay-content a:hover {
color: #fff;
}
.close-trigger {
position: absolute;
top: 20px;
right: 45px;
font-size: 3rem;
background: none;
border: none;
color: white;
cursor: pointer;
}const menuBtn = document.getElementById("menuBtn");
const closeBtn = document.getElementById("closeBtn");
const nav = document.getElementById("fullNav");
menuBtn.addEventListener("click", () => {
nav.classList.add("open");
});
closeBtn.addEventListener("click", () => {
nav.classList.remove("open");
});Nothing to show yetType HTML, CSS or JavaScript and your page appears here.
Click any element to find its code Esc
Check this code before you run it
It came from a shared link. It runs with fewer permissions, so it cannot open pop-ups, submit forms or start downloads.
0.00s / 0.00s
Nothing has animated yet. Hover, click or type in the preview and each CSS animation, transition or
element.animate() call shows up here as it plays.