mirror of
https://github.com/nfonteyne/octane-website.git
synced 2026-09-03 23:24:48 +02:00
update: visual update, phone responsive, db migration
This commit is contained in:
parent
73ebd6ad49
commit
e97aa2c6c3
16 changed files with 894 additions and 244 deletions
|
|
@ -2,7 +2,9 @@ async function initNav(activePage) {
|
|||
const me = await api.get('/api/users/me');
|
||||
const nav = document.getElementById('main-nav');
|
||||
nav.innerHTML = `
|
||||
<div class="nav-links">
|
||||
<span class="brand"><span class="brand-dot">♫</span> Octane</span>
|
||||
<button type="button" class="nav-toggle" id="nav-toggle" aria-label="Menu">☰</button>
|
||||
<div class="nav-links" id="nav-links">
|
||||
<a href="/index.html" class="${activePage === 'repertoire' ? 'active' : ''}">Répertoire</a>
|
||||
<a href="/suggestions.html" class="${activePage === 'suggestions' ? 'active' : ''}">Suggestions</a>
|
||||
<a href="/setlist.html" class="${activePage === 'setlist' ? 'active' : ''}">Prochain concert</a>
|
||||
|
|
@ -13,5 +15,11 @@ async function initNav(activePage) {
|
|||
<a href="/auth/logout">Se déconnecter</a>
|
||||
</div>
|
||||
`;
|
||||
|
||||
const toggle = document.getElementById('nav-toggle');
|
||||
const links = document.getElementById('nav-links');
|
||||
toggle.addEventListener('click', () => links.classList.toggle('open'));
|
||||
links.querySelectorAll('a').forEach((a) => a.addEventListener('click', () => links.classList.remove('open')));
|
||||
|
||||
return me;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue