<nav class="navbar">
        <p class="brand">logo</p>
        <div class="toggle-btn">
            <span></span>
            <span></span>
            <span></span>
        </div>
    </nav>

    <ul class="nav-list">
        <li class="link">home</li>
        <li class="link">project</li>
        <li class="link">about</li>
    </ul>

    <header class="page-container">
        <span class="overlay"></span>
        <section class="page home active">
            <p class="title">home</p>
        </section>
        <section class="page project">
            <p class="title">project</p>
        </section>
        <section class="page about">
            <p class="title">about</p>
        </section>
    </header>
@import url('https://fonts.googleapis.com/css2?family=Dosis:wght@200;300;400;500;600;700;800&display=swap');

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

body{
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
    overflow: hidden;
    position: relative;
    background: #212121;
    font-family: 'dosis';
}

.navbar{
    width: 100%;
    height: 60px;
    position: fixed;
    top: 0;
    left: 0;
    padding: 0 10vw;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 9;
}

.brand{
    font-weight: 500;
    color: #FFF;
    text-transform: capitalize;
    font-size: 25px;
    letter-spacing: 2px;
}

.toggle-btn{
    position: relative;
    width: 50px;
    height: 50px;
    cursor: pointer;
}

.toggle-btn span{
    position: absolute;
    top: 25%;
    left: 0;
    transform: translateY(-50%);
    width: 100%;
    height: 3px;
    background: #FFF;
    transition: 1s;
}

.toggle-btn span:nth-child(2){
    top: 50%;
    width: 70%;
}

.toggle-btn span:nth-child(3){
    top: 75%;
    width: 40%;
}

.toggle-btn.active span:nth-child(2){
    display: none;
}

.toggle-btn.active span:nth-child(1){
    transform: rotate(45deg);
    top: 50%
}

.toggle-btn.active span:nth-child(3){
    transform: rotate(-45deg);
    top: 50%;
    width: 100%;
}

.page-container{
    position: relative;
    width: 100%;
    height: 100%;
    -webkit-box-reflect: below 20px linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.4));
    transition: 1s;
    left: 0;
}

.overlay{
    position: fixed;
    bottom: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: #212121;
    z-index: 3;
}

.page{
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
}

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

.page.home{
    background-image: url(https://github.com/kunaal438/3d-navbar-2/blob/master/home.jpeg?raw=true);
    background-size: cover;
}

.page.project{
    background-image: url(https://github.com/kunaal438/3d-navbar-2/blob/master/project.png?raw=true);
    background-size: cover;
}

.page.about{
    background-image: url(https://github.com/kunaal438/3d-navbar-2/blob/master/about.png?raw=true);
    background-size: cover;
}

.page .title{
    font-size: 100px;
    color: #FFF;
    text-transform: uppercase;
    -webkit-text-stroke: 2px #000;
    font-weight: 700;
}

.page-container.active{
    left: -10%;
    transform: rotateY(45deg) scale(0.5);
}

.nav-list{
    position: absolute;
    top: 50%;
    right: 10vw;
    transform: translateY(-50%);
    transition: 1s;
    opacity: 0;
}

.link{
    position: relative;
    color: #fff;
    text-transform: capitalize;
    font-size: 20px;
    padding: 10px;
    transition: .5s;
    letter-spacing: 2px;
    list-style: none;
    cursor: pointer;
    font-weight: 700;
}

.link:hover{
    opacity: 0.8;
    color: rgb(255, 98, 98);
    transform: translateX(-20px);
}

.nav-list.show{
    opacity: 1;
}

@keyframes slide{
    100%{
        left: 100%;
    }
}

@media (max-width: 996px){
  body::after{
    content: 'See in 0.5x scale';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 99999;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
  }
}
const container = document.querySelector('.page-container');
const pages = [...document.querySelectorAll('.page')];
const toggleBtn = document.querySelector('.toggle-btn');
const ul = document.querySelector('.nav-list');
const overlay = document.querySelector('.overlay');
const links = [...document.querySelectorAll('.link')];

let currentPageIndex = 0;

toggleBtn.addEventListener('click', () => {
    toggleBtn.classList.toggle('active');
    container.classList.toggle('active');
    ul.classList.toggle('show');
})

const changePage = (i) => {
    overlay.style.animation = `slide 1s linear 1`;
    setTimeout(() => {
        pages[currentPageIndex].classList.remove('active');
        pages[i].classList.add('active');
        currentPageIndex = i;
    }, 500);
    setTimeout(() => {
        overlay.style.animation = null;
    }, 1000);
}

links.forEach((item, i) => {
    item.addEventListener('click', () => {
        changePage(i);
    })
})

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.