Spaces:
Sleeping
Sleeping
Add explicit light dark mode toggle
Browse files361 unmodified lines36236336436536636736836937026 unmodified lines397398399400401402885 unmodified lines128812891290129112921293752 unmodified lines204620472048204920502051361 unmodified linesif timer_minutes > 0 else "")return """() => {if (!localStorage.getItem('gradio-theme')) {localStorage.setItem('gradio-theme', 'dark');}window.startTimer = function(minutes) {if (!minutes || minutes <= 0) return;if (window._timerInterval) clearInterval(window._timerInterval);26 unmodified linesfooter svg { display: inline !important; }.gradio-container { max-width: 100% !important; }/* Setup page β centred card */.setup-card { max-width: 700px; margin: 40px auto !important; }885 unmodified lineswith gr.Row():gr.HTML("") # spacerlogout_btn = gr.Button("π Logout", visible=False, elem_id="logout-btn", size="sm")# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ# PAGE 0 β Login (visible only if no .env key)752 unmodified lineshint_log_state = gr.State([])confirmation_pending_state = gr.State(False)with gr.Row(elem_classes=["header-row"]):gr.Markdown(f"### π Legacy Code Challenge{name_suffix}",361 unmodified lines36236336436536636736836937037137237337437537637737837938038138238338438538638726 unmodified lines414415416417418419420421422423424425426427428429430431432433434435436437438439440885 unmodified lines1326132713281329133013311332133313341335752 unmodified lines2088208920902091209220932094209520962097361 unmodified linesif timer_minutes > 0 else "")return """() => {const refreshThemeToggleLabel = () => {const isDark = (localStorage.getItem('gradio-theme') || 'dark') === 'dark';document.querySelectorAll('[data-theme-toggle-label]').forEach((el) => {el.textContent = isDark ? 'βοΈ Light mode' : 'π Dark mode';});};window.toggleTheme = function() {const current = localStorage.getItem('gradio-theme') || 'dark';localStorage.setItem('gradio-theme', current === 'dark' ? 'light' : 'dark');window.location.reload();};if (!localStorage.getItem('gradio-theme')) {localStorage.setItem('gradio-theme', 'dark');window.location.reload();return;}refreshThemeToggleLabel();window.startTimer = function(minutes) {if (!minutes || minutes <= 0) return;if (window._timerInterval) clearInterval(window._timerInterval);26 unmodified linesfooter svg { display: inline !important; }.gradio-container { max-width: 100% !important; }/* Theme toggle */.theme-toggle-shell {display: flex;justify-content: flex-end;margin-bottom: 12px;}.theme-toggle-btn {border: 1px solid #94a3b8;border-radius: 999px;padding: 8px 14px;background: #ffffff;color: #0f172a;cursor: pointer;font-weight: 600;}body.dark .theme-toggle-btn {background: #0f172a;color: #e2e8f0;border-color: #334155;}/* Setup page β centred card */.setup-card { max-width: 700px; margin: 40px auto !important; }885 unmodified lineswith gr.Row():gr.HTML("") # spacerlogout_btn = gr.Button("π Logout", visible=False, elem_id="logout-btn", size="sm")gr.HTML("<div class='theme-toggle-shell'><button class='theme-toggle-btn' onclick='window.toggleTheme()' type='button' data-theme-toggle-label>π Dark mode</button></div>")# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ# PAGE 0 β Login (visible only if no .env key)752 unmodified lineshint_log_state = gr.State([])confirmation_pending_state = gr.State(False)gr.HTML("<div class='theme-toggle-shell'><button class='theme-toggle-btn' onclick='window.toggleTheme()' type='button' data-theme-toggle-label>π Dark mode</button></div>")with gr.Row(elem_classes=["header-row"]):gr.Markdown(f"### π Legacy Code Challenge{name_suffix}",
student_interface.py+46