javascript – how to respect aside and navbar

:root{
    --fondo-color:#181818;
    --items-color:#202020;
    --border-color:#383838;
    --text-color:#e7e7e7;
}
*{
    padding: 0;
    box-sizing: border-box;
    margin: 0;
}
html{
    font-size: 62.5%;
    font-family: sans-serif;
}
body{
    width: 100%;
    height: 100vh;
    background-color: var(--fondo-color);
    position: relative;
}
nav{
    display: flex;
    align-items:center;
    width: 100%;
    padding: 10px 20px;
    background-color: var(--items-color);
    position: absolute;
    border-bottom: 1px solid var(--border-color);
}
nav img{
    margin-left: 20px;
}
nav span i{
    color: #fff;
    font-size: 2.7rem;
    cursor: pointer;
}
aside{
    background-color: var(--items-color);
    width: 260px;
    position: absolute;
    top: 0;
    left: 0;
    bottom:0;
    overflow-y: hidden;
    margin-top: 59px;
    transition: 0.5s;
}
aside:hover{
    overflow-y: auto;
}
.desplegar{
    transform: translateX(-100%);
}
aside::-webkit-scrollbar{
    width: 8px;
}
aside::-webkit-scrollbar-thumb{
    background-color: #909090;
    border-radius: 5px;
}
.container-svg{
    border-bottom: 1px solid var(--border-color);
    padding: 10px 1px;
    color: var(--text-color);
}
.container-svg div{
    display: flex;
    align-items: center;
    width: 100%;
    padding: 10px 20px;
    cursor: pointer;
}
.container-svg div:hover{
    background-color: #303030;
}
.container-svg div span{
    margin-left: 15px;
    font-size: 1.5rem;
    font-weight: 500;
}
h2{
    padding: 10px 20px;
    color: #aaaaaa;
}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
    <link rel="stylesheet" href="https://stackoverflow.com/questions/72223924/{{ url_for("static', filename="css/inite.css") }}">
    <link href="https://unpkg.com/boxicons@2.0.7/css/boxicons.min.css" rel="stylesheet">
</head>
<body>
    <nav>
        <span id="open-close"><i class="bx bx-menu"></i></span>
            <img src="https://stackoverflow.com/questions/72223924/{{ url_for("static', filename="/images/zorro3.png") }}" alt="" width="45" height="40" class="d-inline-block align-text-center" style="margin-left:10px">
   
    </nav>
    <aside id="aside">
        <div class="container-svg">
            <div>
                <svg viewBox="0 0 24 24" preserveAspectRatio="xMidYMid meet" fill="#909090" focusable="false" class="style-scope yt-icon" style="pointer-events: none; display: block; width: 25px; height: 25px;"><g class="style-scope yt-icon"><path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8" class="style-scope yt-icon"></path></g></svg>
                <span>Inicio</span>
            </div>
            <div>
                <svg viewBox="0 0 24 24" preserveAspectRatio="xMidYMid meet" fill="#909090" focusable="false" class="style-scope yt-icon" style="pointer-events: none; display: block; width: 25px; height:25px;"><g class="style-scope yt-icon"><path d="M11.23 13.08c-.29-.21-.48-.51-.54-.86-.06-.35.02-.71.23-.99.21-.29.51-.48.86-.54.35-.06.7.02.99.23.29.21.48.51.54.86.06.35-.02.71-.23.99a1.327 1.327 0 01-1.08.56c-.28 0-.55-.08-.77-.25zM22 12c0 5.52-4.48 10-10 10S2 17.52 2 12 6.48 2 12 2s10 4.48 10 10zm-3.97-6.03L9.8 9.8l-3.83 8.23 8.23-3.83 3.83-8.23z" class="style-scope yt-icon"></path></g></svg>
                <span>Explorar</span>
            </div>
            <div>
                <svg viewBox="0 0 24 24" preserveAspectRatio="xMidYMid meet" focusable="false" fill="#909090"  class="style-scope yt-icon" style="pointer-events: none; display: inline-block; width:25px; height:25px;"><g class="style-scope yt-icon"><path d="M18.7 8.7H5.3V7h13.4v1.7zm-1.7-5H7v1.6h10V3.7zm3.3 8.3v6.7c0 1-.7 1.6-1.6 1.6H5.3c-1 0-1.6-.7-1.6-1.6V12c0-1 .7-1.7 1.6-1.7h13.4c1 0 1.6.8 1.6 1.7zm-5 3.3l-5-2.7V18l5-2.7z" class="style-scope yt-icon"></path></g></svg>
                <span>Suscripciones</span>
            </div>
        </div>
        <div class="container-svg">
            <div>
                <svg viewBox="0 0 24 24" preserveAspectRatio="xMidYMid meet" focusable="false" fill="#909090" class="style-scope yt-icon" style="pointer-events: none; display: inline-block; width: 25px; height: 25px;"><g class="style-scope yt-icon"><path fill="none" d="M0 0h24v24H0z" class="style-scope yt-icon"></path><path d="M4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8 12.5v-9l6 4.5-6 4.5z" class="style-scope yt-icon"></path></g></svg>
                <span>Biblioteca</span>
            </div>
            <div>
                <svg viewBox="0 0 24 24" preserveAspectRatio="xMidYMid meet" focusable="false" fill="#909090" class="style-scope yt-icon" style="pointer-events: none; display: inline-block; width: 25px; height: 25px;"><g class="style-scope yt-icon"><path d="M11.9 3.75c-4.55 0-8.23 3.7-8.23 8.25H.92l3.57 3.57.04.13 3.7-3.7H5.5c0-3.54 2.87-6.42 6.42-6.42 3.54 0 6.4 2.88 6.4 6.42s-2.86 6.42-6.4 6.42c-1.78 0-3.38-.73-4.54-1.9l-1.3 1.3c1.5 1.5 3.55 2.43 5.83 2.43 4.58 0 8.28-3.7 8.28-8.25 0-4.56-3.7-8.25-8.26-8.25zM11 8.33v4.6l3.92 2.3.66-1.1-3.2-1.9v-3.9H11z" class="style-scope yt-icon"></path></g></svg>
                <span>Historial</span>
            </div>
            <div>
                <svg viewBox="0 0 24 24" preserveAspectRatio="xMidYMid meet" focusable="false" fill="#909090"  class="style-scope yt-icon" style="pointer-events: none; display: inline-block; width:25px; height:25px;"><g class="style-scope yt-icon"><path d="M18.4 5.6v12.8H5.6V5.6h12.8zm0-1.8H5.6a1.8 1.8 0 0 0-1.8 1.8v12.8a1.8 1.8 0 0 0 1.8 1.9h12.8a1.8 1.8 0 0 0 1.9-1.9V5.6a1.8 1.8 0 0 0-1.9-1.8z" class="style-scope yt-icon"></path><path d="M10.2 9v6.5l5-3.2-5-3.2z" class="style-scope yt-icon"></path></g></svg>
                <span>Mis videos</span>
            </div>
            <div>
                <svg viewBox="0 0 24 24" preserveAspectRatio="xMidYMid meet" focusable="false" fill="#909090" class="style-scope yt-icon" style="pointer-events: none; display: inline-block; width: 25px; height:25px;"><g class="style-scope yt-icon"><path d="M12 3.67c-4.58 0-8.33 3.75-8.33 8.33s3.75 8.33 8.33 8.33 8.33-3.75 8.33-8.33S16.58 3.67 12 3.67zm3.5 11.83l-4.33-2.67v-5h1.25v4.34l3.75 2.25-.67 1.08z" class="style-scope yt-icon"></path></g></svg>
                <span>Ver mas tarde</span>
            </div>
            <div>
                <svg viewBox="0 0 24 24" preserveAspectRatio="xMidYMid meet" focusable="false" fill="#909090"  class="style-scope yt-icon" style="pointer-events: none; width:25px; height:25px;"><g class="style-scope yt-icon"><circle cx="6" cy="18" r="2" fill="none" class="style-scope yt-icon"></circle><circle cx="6" cy="6" r="2" fill="none" class="style-scope yt-icon"></circle><path d="M9.64 7.64c.23-.5.36-1.05.36-1.64 0-2.21-1.79-4-4-4S2 3.79 2 6s1.79 4 4 4c.59 0 1.14-.13 1.64-.36L10 12l-2.36 2.36C7.14 14.13 6.59 14 6 14c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4c0-.59-.13-1.14-.36-1.64L12 14l7 7h3v-1L9.64 7.64zM6 8c-1.1 0-2-.89-2-2s.9-2 2-2 2 .89 2 2-.9 2-2 2zm0 12c-1.1 0-2-.89-2-2s.9-2 2-2 2 .89 2 2-.9 2-2 2zm6-7.5c-.28 0-.5-.22-.5-.5s.22-.5.5-.5.5.22.5.5-.22.5-.5.5zM19 3l-6 6 2 2 7-7V3z" class="style-scope yt-icon"></path></g></svg>
                <span>Tus clips</span>
            </div>
            <div>
                <svg viewBox="0 0 24 24" preserveAspectRatio="xMidYMid meet" focusable="false" fill="#909090" class="style-scope yt-icon" style="pointer-events: none; display: inline-block; width:25px; height:25px;"><g class="style-scope yt-icon"><path d="M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z" class="style-scope yt-icon"></path></g></svg>
                <span>Mostrar mas</span>
            </div>
        </div>
        <div class="container-svg">
            <h2>MÁS DE YOUTUBE</h2>
            <div>
                <svg viewBox="0 0 24 24" preserveAspectRatio="xMidYMid meet" focusable="false" fill="#909090" class="style-scope yt-icon" style="pointer-events: none; display: block; width:25px; height:25px;"><g class="style-scope yt-icon"><path fill-rule="nonzero" d="M21.78 8s-.2-1.37-.8-1.97c-.75-.8-1.6-.8-2-.85C16.2 4.98 12 5 12 5s-4.18-.02-6.97.18c-.4.05-1.24.05-2 .85-.6.6-.8 1.97-.8 1.97s-.2 1.63-.23 3.23v1.7c.03 1.6.23 3.2.23 3.2s.2 1.4.8 2c.76.8 1.75.76 2.2.85 1.57.15 6.6.18 6.77.18 0 0 4.2 0 7-.2.38-.04 1.23-.04 2-.84.6-.6.8-1.98.8-1.98s.2-1.6.2-3.22v-1.7c-.02-1.6-.22-3.22-.22-3.22zm-11.8 7V9.16l5.35 3.03L9.97 15z" class="style-scope yt-icon"></path></g></svg>
                <span>YouTube Premium</span>
            </div>
            <div>
                <svg viewBox="0 0 24 24" preserveAspectRatio="xMidYMid meet" focusable="false"  fill="#909090"  class="style-scope yt-icon" style="pointer-events: none; display: block; width:25px; height:25px;"><g fill-rule="evenodd" class="style-scope yt-icon"><path d="M22,13V8l-5-3l-5,3l0,0L7,5L2,8v5l10,6L22,13z M9,11H7v2H6v-2H4v-1h2V8h1v2h2V11z M15,13 c-0.55,0-1-0.45-1-1s0.45-1,1-1s1,0.45,1,1S15.55,13,15,13z M18,11c-0.55,0-1-0.45-1-1s0.45-1,1-1s1,0.45,1,1S18.55,11,18,11z" class="style-scope yt-icon"></path></g></svg>
                <span>Videojuegos</span>
            </div>
            <div>
                <svg viewBox="0 0 24 24" preserveAspectRatio="xMidYMid meet" focusable="false" fill="#909090"  class="style-scope yt-icon" style="pointer-events: none; display: block; width:25px; height:25px;"><g class="style-scope yt-icon"><path d="M16.94 6.91l-1.41 1.45c.9.94 1.46 2.22 1.46 3.64s-.56 2.71-1.46 3.64l1.41 1.45c1.27-1.31 2.05-3.11 2.05-5.09s-.78-3.79-2.05-5.09zM19.77 4l-1.41 1.45C19.98 7.13 21 9.44 21 12.01c0 2.57-1.01 4.88-2.64 6.54l1.4 1.45c2.01-2.04 3.24-4.87 3.24-7.99 0-3.13-1.23-5.96-3.23-8.01zM7.06 6.91c-1.27 1.3-2.05 3.1-2.05 5.09s.78 3.79 2.05 5.09l1.41-1.45c-.9-.94-1.46-2.22-1.46-3.64s.56-2.71 1.46-3.64L7.06 6.91zM5.64 5.45L4.24 4C2.23 6.04 1 8.87 1 11.99c0 3.13 1.23 5.96 3.23 8.01l1.41-1.45C4.02 16.87 3 14.56 3 11.99s1.01-4.88 2.64-6.54z" class="style-scope yt-icon"></path><circle cx="12" cy="12" r="3" class="style-scope yt-icon"></circle></g></svg>
                <span>Directo</span>
            </div>
            <div>
                <svg viewBox="0 0 24 24" preserveAspectRatio="xMidYMid meet" fill="#909090" focusable="false" class="style-scope yt-icon" style="pointer-events: none; display: block; width:25px; height:25px;"><g class="style-scope yt-icon"><path d="M9 21c0 .5.4 1 1 1h4c.6 0 1-.5 1-1v-1H9v1zm3-19C8.1 2 5 5.1 5 9c0 2.4 1.2 4.5 3 5.7V17c0 .5.4 1 1 1h6c.6 0 1-.5 1-1v-2.3c1.8-1.3 3-3.4 3-5.7 0-3.9-3.1-7-7-7z" class="style-scope yt-icon"></path></g></svg>
                <span>Aprendizaje</span>
            </div>
            <div>
                <svg viewBox="0 0 24 24" preserveAspectRatio="xMidYMid meet" fill="#909090"  focusable="false" class="style-scope yt-icon" style="pointer-events: none; display: block; width: 25px; height: 25px;"><g class="style-scope yt-icon"><path d="M6.85 7.76V6.18H1v2.88c0 2.35 1.9 4.26 4.26 4.26h1.59v-1.59H5.4a2.81 2.81 0 01-2.81-2.8V7.75h4.26zM17.15 7.76V6.18H23v2.88c0 2.35-1.9 4.26-4.26 4.26h-1.59v-1.59h1.45a2.81 2.81 0 002.81-2.8V7.75h-4.26z" class="style-scope yt-icon"></path><path d="M12 17.29a6.87 6.87 0 01-6.87-6.87V3h13.74v7.42c0 3.8-3.07 6.87-6.87 6.87z" class="style-scope yt-icon"></path><path d="M12 17.29V3h6.87v7.42c0 3.8-3.07 6.87-6.87 6.87zM12 17.29l4.13 2.38H7.88L12 17.3zM16.13 19.67H7.88v2.38h8.25v-2.38z" class="style-scope yt-icon"></path></g></svg>
                <span>Deportes</span>
            </div>
        </div>
    </aside>
    <div class="container-fluid">
        <p style="padding:20px;color:white; ">
        Dr.A.P.J Abdul Kalam was known as one the most  famous personality in the India.  His full name was Avul Pakir Jainulabdeen Abdul Kalam. His whole life journey comes in between  15 october 1931 – 27 july 2015 . .In this time he was worked as aerospace scientist .  Rameswaram ,Tamil Nadu was his birthplace. As well as he was completed his education in physics and aerospace engineering from Tamilnadu state itself. He was provide service to the nation as being  11th president of India from 2002 to 2007.  He almost spend  4 decades of service as being scientist and science administrator , majorly he was active participants at the Defence Research and Development Organisation (DRDO) and in  most famous organization of India i.e  and Indian Space Research Organization (ISRO).  Due to his active participation in those  organization  and had part of India’s military missile development  he was known as Missile Man of India. He played very important role in nuclear test which is taken by India for Pokharan -2 nuclear test in the year 1998.<br> He was well known personality in all reputed fields like education, aerospace, military, public service and into the writing. He died on 27 July 2015, aged 83</p>
    </div>
</body>
 <script>
    const $openClose = document.getElementById("open-close"),
        $aside = document.getElementById("aside");

    $openClose.addEventListener("click",()=>{
        $aside.classList.toggle("desplegar")
        })
</script>
</html>

Leave a Comment