Spaces:
Running
Running
Update app.py
#6
by volivers - opened
app.py
CHANGED
|
@@ -2336,15 +2336,6 @@ SELECTION_JS = """
|
|
| 2336 |
document.body.classList.toggle('dark', dark);
|
| 2337 |
const container = document.querySelector('.gradio-container');
|
| 2338 |
if (container) container.classList.toggle('dark', dark);
|
| 2339 |
-
// Sync emoji and checkbox โ retry until element is available
|
| 2340 |
-
function syncUI() {
|
| 2341 |
-
const el = document.getElementById('theme-emoji');
|
| 2342 |
-
const cb = document.getElementById('dark-toggle-btn');
|
| 2343 |
-
if (el) el.textContent = dark ? 'โ๏ธ' : '๐';
|
| 2344 |
-
if (cb) cb.checked = dark;
|
| 2345 |
-
if (!el || !cb) requestAnimationFrame(syncUI);
|
| 2346 |
-
}
|
| 2347 |
-
syncUI();
|
| 2348 |
}
|
| 2349 |
function toggleDark() {
|
| 2350 |
const url = new URL(window.location);
|
|
@@ -2505,7 +2496,7 @@ with gr.Blocks(css_paths="style.css", title="Lolaby", theme=gr.themes.Citrus(),
|
|
| 2505 |
gr.HTML("""
|
| 2506 |
<div style="text-align:right; padding: 12px 18px 0;">
|
| 2507 |
<label class="dark-toggle-label">
|
| 2508 |
-
<span id="theme-emoji">
|
| 2509 |
<input type="checkbox" id="dark-toggle-btn" role="switch"
|
| 2510 |
onchange="window._lolaby_toggleDark && window._lolaby_toggleDark()">
|
| 2511 |
</label>
|
|
|
|
| 2336 |
document.body.classList.toggle('dark', dark);
|
| 2337 |
const container = document.querySelector('.gradio-container');
|
| 2338 |
if (container) container.classList.toggle('dark', dark);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2339 |
}
|
| 2340 |
function toggleDark() {
|
| 2341 |
const url = new URL(window.location);
|
|
|
|
| 2496 |
gr.HTML("""
|
| 2497 |
<div style="text-align:right; padding: 12px 18px 0;">
|
| 2498 |
<label class="dark-toggle-label">
|
| 2499 |
+
<span id="theme-emoji">๐</span>
|
| 2500 |
<input type="checkbox" id="dark-toggle-btn" role="switch"
|
| 2501 |
onchange="window._lolaby_toggleDark && window._lolaby_toggleDark()">
|
| 2502 |
</label>
|