mirror of https://github.com/Facinorous-420/dick
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
884 B
30 lines
884 B
2 years ago
|
// DOM Ready Function
|
||
|
function ready(fn) {
|
||
|
if (document.readyState != 'loading') {
|
||
|
fn();
|
||
|
} else {
|
||
|
document.addEventListener('DOMContentLoaded', fn);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// DOM Ready Called
|
||
|
ready(function () {
|
||
|
|
||
|
const buttonModal = document.getElementsByClassName('buttonModal');
|
||
|
const showModal = document.getElementById('showModal');
|
||
|
|
||
|
function fireModal() {
|
||
|
for (let index = 0; index < buttonModal.length; index++) {
|
||
|
buttonModal[index].addEventListener('click', () => {
|
||
|
if(showModal.classList.contains('flex')){
|
||
|
showModal.classList.remove('flex')
|
||
|
showModal.classList.add('hidden')
|
||
|
}else{
|
||
|
showModal.classList.remove('hidden')
|
||
|
showModal.classList.add('flex')
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
fireModal();
|
||
|
});
|