Boa tarde estou com dificuldades de fazer a aba a esquerda ir e voltar. Acredito que fiz todo o processo do javascript mas aqui não funcionou. Podem me ajudar?
JS
const botaoMenu = document.querySelector('.cabecalho__menu')
const menu = document.querySelector('.menu-lateral')
botaoMenu.addEventListener('click', () => {
menu.classList.toggle('menu-lateral--ativo')
})
html
<!DOCTYPE html>
<html lang="pt-br">
<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">
<title>HZC Sk8te - Home</title>
<link rel="stylesheet" href="../assets/css/reset.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&display=swap">
<link rel="stylesheet" href="../assets/css/estlo.css">
</head>
<body>
<header class="cabeçalho">
<button class="cabeçalho__menu" aria-label="Menu"><i></i></button>
<img src="../assets/img/logo.svg" alt="Logotipo da HZC" class="cabeçalho__logo">
<button class="cabeçalho__notificacao" aria-label="Notificação"><i></i></button>
</header>
<nav class="menu-lateral">
<img src="../assets/img/logo.svg" alt="logo" class="menu-lateral__logo">
<a href="#" class="menu-lateral__link menu-lateral__link--inicio menu-lateral__link--ativo">Inicio</a>
<a href="#" class="menu-lateral__link menu-lateral__link--videos">Videos</a>
<a href="#" class="menu-lateral__link menu-lateral__link--picos">Picos</a>
<a href="#" class="menu-lateral__link menu-lateral__link--integrantes">Integrantes</a>
<a href="#" class="menu-lateral__link menu-lateral__link--camisas">Camisas</a>
<a href="#" class="menu-lateral__link menu-lateral__link--pinturas">Pinturas</a>
</nav>
<script src="index.js"></script>
</body>
</html>
CSS
body {
background-color: #1d232a;
font-family: 'Open Sans', 'icones', sans-serif;
color: white;
}
.cabeçalho {display: flex;
justify-content: space-between;
align-items: stretch;
padding: 8px 16px;
background-color: #15191C;
box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.16);
}
@font-face {
font-family: 'icones';
src: url(../font/icones.ttf);
}
.cabeçalho__menu i::before {
content: "\e904";
font-size: 24px;
}
.cabeçalho__notificacao i::before {
content: "\e906";
font-size: 24px;
}
.cabeçalho__logo {
width: 40px;
}
.menu-lateral__logo{
display: flex;
align-self: center;
}
.menu-lateral{
display: flex;
flex-direction: column;
background-color: #15191C;
width: 75vw;
height: 100vh;
position: absolute;
left: -100vw;
transition: .25s;
}
.menu-lateral--ativo{
left: 0;
transition: .25s;
}
.menu-lateral__logo{
width: 118px;
align-self: center;
padding: 16px;
}
.menu-lateral__link {
height: 64px;
color: #95999c;
padding-left: 64px;
display: flex;
align-items: center;
}
.menu-lateral__link--ativo{
color: #ffffff;
padding: 0 0 0 56px;
border-left: 8px solid #ffffff;
}
.menu-lateral__link::before {
content: "\e900";
width: 24px;
height: 24px;
font-size: 24px;
position: absolute;
left: 24px;
}
.menu-lateral__link--inicio::before{
content: "\e902";
}
.menu-lateral__link--videos::before{
content: "\e90e";
}
.menu-lateral__link--picos::before{
content: "\e909";
}
.menu-lateral__link--integrantes::before{
content: "\e903";
}
.menu-lateral__link--camisas::before{
content: "\e900";
}
.menu-lateral__link--pinturas::before{
content: "\e90a";
}