LE-Website/lethal-extended/js/defaultf700.js

34 lines
913 B
JavaScript
Raw Normal View History

2024-09-17 16:57:06 +00:00
const $ = q => document.querySelector(q);
const $$ = q => document.querySelectorAll(q);
function toggleClassClicker(i, clazz) {
document.getElementById("clicker-" + i).classList.toggle(clazz);
}
function toggleClass(i, clazz) {
document.getElementById(i).classList.toggle(clazz);
}
function showElement(i) {
toggleClassClicker(i, "hidden")
}
const toggleFAQ = id => $('#faq-' + id).parentElement.querySelector('button>span').innerHTML = $('#faq-' + id).classList.toggle('hidden')?'+':'-';
const closeAnnouncementHandler = (el) => {
el.addEventListener('click', e => {
console.log('click!');
console.log(e.target.parentElement);
e.target.parentElement.classList.toggle('hidden');
})
}
document.addEventListener('DOMContentLoaded', () => {
let els = $$('#announcement .close');
els.forEach(el => {
if(el) closeAnnouncementHandler(el);
});
});