mirror of
https://github.com/KubaPro010/fm-dx-webserver.git
synced 2026-07-31 09:19:16 +02:00
Add files via upload
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
// Get the modal element and the buttons to open and close it
|
||||
var modal = document.getElementById("myModal");
|
||||
var openBtn = document.getElementById("settings");
|
||||
var closeBtn = document.getElementById("closeModal");
|
||||
var closeBtnFull = document.getElementById("closeModalButton");
|
||||
|
||||
// Function to open the modal
|
||||
function openModal() {
|
||||
modal.style.display = "block";
|
||||
setTimeout(function() {
|
||||
modal.style.opacity = 1;
|
||||
}, 10);
|
||||
}
|
||||
|
||||
// Function to close the modal
|
||||
function closeModal() {
|
||||
modal.style.opacity = 0;
|
||||
setTimeout(function() {
|
||||
modal.style.display = "none";
|
||||
}, 300); // This delay should match the transition duration (0.3s).
|
||||
}
|
||||
|
||||
// Event listeners for the open and close buttons
|
||||
openBtn.addEventListener("click", openModal);
|
||||
closeBtn.addEventListener("click", closeModal);
|
||||
closeBtnFull.addEventListener("click", closeModal);
|
||||
|
||||
// Close the modal when clicking outside of it
|
||||
window.addEventListener("click", function(event) {
|
||||
if (event.target == modal) {
|
||||
closeModal();
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user