-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
59 lines (47 loc) · 1.46 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<script src="arquivo.js"></script>
<title>HTML_CSS_JS</title>
</head>
<body>
<header>
<div class="logo">
<img src="img/logo.png" alt="Logo">
</div>
<button id="openmenu">☰</button>
<nav id="menu">
<button id="closemenu">X</button>
<a href="#">Home</a>
<a href="#">Serviços</a>
<a href="#">Produtos</a>
<a href="#">Contactos</a>
</nav>
</header>
<aside>Relacionado</aside>
<main>Conteúdo Principal</main>
<footer><p>Nelson Muquissi © 2023-2024</p></footer>
<script>
openmenu.addEventListener('click', () => {
menu.style.display = 'flex'
menu.style.right = (menu.offsetWidth * -1) + 'px'
openmenu.style.display = 'none'
setTimeout(() => {
menu.style.opacity = '1'
menu.style.right = '0'
}, 10)
})
closemenu.addEventListener('click', () => {
menu.style.opacity = '0'
openmenu.removeAttribute('style')
menu.style.right = (menu.offsetWidth * -1) + 'px'
setTimeout(() => {
menu.removeAttribute('style')
}, 200)
})
</script>
</body>
</html>