various website tweaks (tiny bit of javascript for mobile users), added freee

This commit is contained in:
Trilarion
2021-10-05 20:52:09 +02:00
parent 1b493f36b5
commit b291102272
115 changed files with 98716 additions and 250894 deletions

29
docs/js/osgl.js Normal file
View File

@ -0,0 +1,29 @@
/*
* A tiny bit of JavaScript to improve the OSGL site.
*/
document.addEventListener('DOMContentLoaded', () => {
// Get all "navbar-burger" elements
const $navbarBurgers = Array.prototype.slice.call(document.querySelectorAll('.navbar-burger'), 0);
// Check if there are any navbar burgers
if ($navbarBurgers.length > 0) {
// Add a click event on each of them
$navbarBurgers.forEach( el => {
el.addEventListener('click', () => {
// Get the target from the "data-target" attribute
const target = el.dataset.target;
const $target = document.getElementById(target);
// Toggle the "is-active" class on both the "navbar-burger" and the "navbar-menu"
el.classList.toggle('is-active');
$target.classList.toggle('is-active');
});
});
}
});