fix: update paths and add static files support for Docker
This commit is contained in:
35
app/static/js/error.js
Normal file
35
app/static/js/error.js
Normal file
@@ -0,0 +1,35 @@
|
||||
// Theme toggle functionality
|
||||
function toggleTheme() {
|
||||
const html = document.documentElement;
|
||||
const currentTheme = html.getAttribute('data-theme');
|
||||
const newTheme = currentTheme === 'light' ? 'dark' : 'light';
|
||||
|
||||
html.setAttribute('data-theme', newTheme);
|
||||
localStorage.setItem('lb_theme', newTheme);
|
||||
|
||||
// Update theme toggle button
|
||||
const themeButton = document.querySelector('.theme-toggle');
|
||||
if (themeButton) {
|
||||
themeButton.textContent = newTheme === 'light' ? '🌙' : '☀️';
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize theme on page load
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const savedTheme = localStorage.getItem('lb_theme') || 'dark';
|
||||
document.documentElement.setAttribute('data-theme', savedTheme);
|
||||
|
||||
// Update theme toggle button
|
||||
const themeButton = document.querySelector('.theme-toggle');
|
||||
if (themeButton) {
|
||||
themeButton.textContent = savedTheme === 'light' ? '🌙' : '☀️';
|
||||
}
|
||||
});
|
||||
|
||||
// Keyboard shortcut for theme toggle (Ctrl+T)
|
||||
document.addEventListener('keydown', function(e) {
|
||||
if (e.ctrlKey && e.key === 't') {
|
||||
e.preventDefault();
|
||||
toggleTheme();
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user