Olá!
Quando abro a página o menu aparece logo, em vez de aparecer só quando eu clica-se.
Alguém consegue ajudar? :)
<!DOCTYPE html>
<html lang="PT">
<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 | Home </title>
<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/reset.css">
<link rel="stylesheet" href="assets/css/style.css">
</head>
<body>
<header class="cabecalho">
<button class="cabecalho_menu"><i></i></button>
<img src="assets/img/logo.svg" alt="Logotipo da HZC" class="cabecalho_img">
<button class="cabecalho_notificacao"> <i></i></button>
</header>
<nav class="menu-lateral menu-lateral--ativo">
<img src="assets/img/logo.svg" alt="logotipo" 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-camisa"> Camisa </a>
<a href="#" class="menu-lateral_link menu-lateral_link-pinturas"> Pinturas </a>
</nav>
<main class="principal">
<h2 class="titulo-principal"> Início </h2>
<article class="cartao">
<img src="assets/img/banner-mobile_1.png" alt="banner do cartão" class="cartão__imagem">
<div class="cartao__conteudo">
<p class="cartao__destaque"> Vídeo em destaque</p>
<h3 class="cartao__titulo"> HZC - Título </h3>
<p class="cartao__perfil"> Bruno Lopez </p>
<p class="cartao__info cartao__info--tempo"> 33 minutos </p>
<p class="cartao__info cartao__info--visualizacao"> 33 visualizações </p>
<button class="cartao__botao cartao__botao-- play cartao__botao--destaque"> Assitir agora </button>
</div>
</article>
</main>
<script src="index.js"></script>
</body>
@font-face {
font-family: 'icones';
src: url(../font/icones.ttf);
}
body {
background-color: #1D232A;
font-family: 'Open Sans', 'icones', sans-serif;
color: white;
}
.cabecalho {
display: flex;
justify-content: space-between;
align-items: center;
background-color: #15191C;
padding: 8px 16px;
box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.16);
}
.cabecalho_menu i::before {
content: "\e904";
font-size: 24px;
}
.cabecalho_notificacao::before {
content: "\e906";
font-size: 24px;
}
.cabecalho_img {
width: 40px;
}
.menu-lateral {
position: absolute;
left:-200vw;
display: flex;
flex-direction: column;
background-color: #15191C;
width: 75vw;
height: 100vh;
transition: 1s;
}
.menu-lateral--ativo {
left: 0;
transition: 1s;
}
.menu-lateral_logo {
width: 118px;
align-self: center;
padding-left: 16px;
}
.menu-lateral_link {
height: 60px;
color: #96999C;
padding-left: 64px;
display: flex;
align-items: center;
}
.menu_lateral_link--ativo {
color: white;
padding-left: 56px;
border-left: 8px solid white;
}
.menu-lateral_link::before {
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-camisa::before {
content: "\e900";
}
.menu-lateral_link-pinturas::before {
content: "\e90a";
}
const botaoMenu = document.querySelector('.cabecalho_menu')
const menuLateral = document.querySelector('.menu-lateral')
botaoMenu.addEventListener('click', () => {
menuLateral.classList.toggle('menu-lateral--ativo')
})