Spaces:
Running
Running
Мне нужно выходить из настроек чтобы они применились так не должно быть! - Follow Up Deployment
Browse files- index.html +16 -4
index.html
CHANGED
@@ -347,9 +347,6 @@
|
|
347 |
<input type="checkbox" id="soundToggle" class="mr-2">
|
348 |
<label for="soundToggle">Enable Sounds</label>
|
349 |
</div>
|
350 |
-
<button class="w-full bg-indigo-600 hover:bg-indigo-700 py-2 rounded-lg mt-4">
|
351 |
-
Save Settings
|
352 |
-
</button>
|
353 |
</div>
|
354 |
</div>
|
355 |
</div>
|
@@ -508,6 +505,14 @@
|
|
508 |
|
509 |
// Apply settings
|
510 |
function applySettings() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
511 |
// Apply font size
|
512 |
document.documentElement.style.fontSize = `${fontSizeSlider.value}px`;
|
513 |
|
@@ -540,7 +545,14 @@
|
|
540 |
settingsModal.classList.add('hidden');
|
541 |
});
|
542 |
|
543 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
544 |
|
545 |
// Close modal when clicking outside
|
546 |
settingsModal.addEventListener('click', (e) => {
|
|
|
347 |
<input type="checkbox" id="soundToggle" class="mr-2">
|
348 |
<label for="soundToggle">Enable Sounds</label>
|
349 |
</div>
|
|
|
|
|
|
|
350 |
</div>
|
351 |
</div>
|
352 |
</div>
|
|
|
505 |
|
506 |
// Apply settings
|
507 |
function applySettings() {
|
508 |
+
// Save settings first
|
509 |
+
const settings = {
|
510 |
+
theme: themeSelect.value,
|
511 |
+
fontSize: fontSizeSlider.value,
|
512 |
+
sound: soundToggle.checked
|
513 |
+
};
|
514 |
+
localStorage.setItem('aiConsoleSettings', JSON.stringify(settings));
|
515 |
+
|
516 |
// Apply font size
|
517 |
document.documentElement.style.fontSize = `${fontSizeSlider.value}px`;
|
518 |
|
|
|
545 |
settingsModal.classList.add('hidden');
|
546 |
});
|
547 |
|
548 |
+
// Apply settings immediately when changed
|
549 |
+
themeSelect.addEventListener('change', applySettings);
|
550 |
+
fontSizeSlider.addEventListener('input', applySettings);
|
551 |
+
soundToggle.addEventListener('change', () => {
|
552 |
+
const settings = JSON.parse(localStorage.getItem('aiConsoleSettings')) || {};
|
553 |
+
settings.sound = soundToggle.checked;
|
554 |
+
localStorage.setItem('aiConsoleSettings', JSON.stringify(settings));
|
555 |
+
});
|
556 |
|
557 |
// Close modal when clicking outside
|
558 |
settingsModal.addEventListener('click', (e) => {
|