Spaces:
Running
Running
Update app.py
#1
by volivers - opened
app.py
CHANGED
|
@@ -2336,6 +2336,8 @@ 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 |
}
|
| 2340 |
function toggleDark() {
|
| 2341 |
const url = new URL(window.location);
|
|
@@ -2495,7 +2497,7 @@ with gr.Blocks(css_paths="style.css", title="Lolaby", theme=gr.themes.Citrus(),
|
|
| 2495 |
gr.HTML("""
|
| 2496 |
<div style="text-align:right; padding: 12px 18px 0;">
|
| 2497 |
<label class="dark-toggle-label">
|
| 2498 |
-
<span>
|
| 2499 |
<input type="checkbox" id="dark-toggle-btn" role="switch"
|
| 2500 |
onchange="window._lolaby_toggleDark && window._lolaby_toggleDark()">
|
| 2501 |
</label>
|
|
|
|
| 2336 |
document.body.classList.toggle('dark', dark);
|
| 2337 |
const container = document.querySelector('.gradio-container');
|
| 2338 |
if (container) container.classList.toggle('dark', dark);
|
| 2339 |
+
const el = document.getElementById('theme-emoji');
|
| 2340 |
+
if (el) el.textContent = dark ? '☀️' : '🌙';
|
| 2341 |
}
|
| 2342 |
function toggleDark() {
|
| 2343 |
const url = new URL(window.location);
|
|
|
|
| 2497 |
gr.HTML("""
|
| 2498 |
<div style="text-align:right; padding: 12px 18px 0;">
|
| 2499 |
<label class="dark-toggle-label">
|
| 2500 |
+
<span id="theme-emoji">🌙</span>
|
| 2501 |
<input type="checkbox" id="dark-toggle-btn" role="switch"
|
| 2502 |
onchange="window._lolaby_toggleDark && window._lolaby_toggleDark()">
|
| 2503 |
</label>
|