Spaces:
Running
Running
Update main.js
Browse files
main.js
CHANGED
@@ -1,4 +1,23 @@
|
|
1 |
document.addEventListener('DOMContentLoaded', () => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
// --- CONFIGURATION ---
|
3 |
const config = {
|
4 |
// IMPORTANT: Paste your full and correct Cloudflare Worker URL here
|
|
|
1 |
document.addEventListener('DOMContentLoaded', () => {
|
2 |
+
// --- SETTINGS MODAL LOGIC ---
|
3 |
+
|
4 |
+
// Listen for a click on the main settings gear icon
|
5 |
+
settingsBtn.addEventListener('click', () => {
|
6 |
+
settingsModal.classList.remove('hidden');
|
7 |
+
});
|
8 |
+
|
9 |
+
// Listen for a click on the "X" button inside the modal
|
10 |
+
closeSettingsModal.addEventListener('click', () => {
|
11 |
+
settingsModal.classList.add('hidden');
|
12 |
+
});
|
13 |
+
|
14 |
+
// Bonus: Also close the modal if the user clicks on the dark background overlay
|
15 |
+
settingsModal.addEventListener('click', (event) => {
|
16 |
+
// Check if the click was on the dark background itself, not the white modal content
|
17 |
+
if (event.target === settingsModal) {
|
18 |
+
settingsModal.classList.add('hidden');
|
19 |
+
}
|
20 |
+
});
|
21 |
// --- CONFIGURATION ---
|
22 |
const config = {
|
23 |
// IMPORTANT: Paste your full and correct Cloudflare Worker URL here
|