forked from pepelsbey/playground
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
56 lines (55 loc) · 2.41 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
<!DOCTYPE html>
<html class="page" lang="ru">
<head>
<title>Веб-стандарты</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="styles/index.min.css">
</head>
<body class="page__body">
<header class="header">
<div class="header__logo logo">
<img class="logo__image" src="images/logo.svg" width="40" height="44" alt="">
<p class="logo__title">Веб-стандарты</p>
<p class="logo__tagline">Сообщество разработчиков</p>
</div>
<nav class="header__menu menu">
<button class="menu__button" type="button" aria-expanded="false" aria-controls="menu__list">
<svg class="menu__icon" aria-hidden="true" width="32" height="32">
<use class="menu__icon-menu" href="images/sprite.svg#menu"></use>
<use class="menu__icon-cross" href="images/sprite.svg#cross"></use>
</svg>
</button>
<ul class="menu__list" id="menu__list">
<li class="menu__item">
<a class="menu__link menu__link--current" href>Статьи</a>
</li>
<li class="menu__item">
<a class="menu__link menu__link--inactive">Подкаст</a>
</li>
<li class="menu__item">
<a class="menu__link menu__link--inactive">Календарь</a>
</li>
<li class="menu__item">
<a class="menu__link menu__link--inactive">О проекте</a>
</li>
<li class="menu__item">
<a class="menu__link menu__link--patreon" href>Поддержать</a>
</li>
</ul>
</nav>
</header>
<script>
(() => {
const menuButton = document.querySelector('.menu__button');
const menuList = document.querySelector('.menu__list');
menuButton.addEventListener('click', () => {
let expanded = menuButton.getAttribute('aria-expanded') === 'true';
menuButton.setAttribute('aria-expanded', !expanded);
menuButton.classList.toggle('menu__button--open');
menuList.classList.toggle('menu__list--open');
});
})();
</script>
</body>
</html>