mirror of
https://github.com/michalcz10/USB-RAID-Array.git
synced 2025-12-10 03:22:19 +00:00
WebApp production ver
This commit is contained in:
6314
Web/js/bootstrap.bundle.js
vendored
Normal file
6314
Web/js/bootstrap.bundle.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
Web/js/bootstrap.bundle.js.map
Normal file
1
Web/js/bootstrap.bundle.js.map
Normal file
File diff suppressed because one or more lines are too long
7
Web/js/bootstrap.bundle.min.js
vendored
Normal file
7
Web/js/bootstrap.bundle.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
Web/js/bootstrap.bundle.min.js.map
Normal file
1
Web/js/bootstrap.bundle.min.js.map
Normal file
File diff suppressed because one or more lines are too long
4447
Web/js/bootstrap.esm.js
vendored
Normal file
4447
Web/js/bootstrap.esm.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
Web/js/bootstrap.esm.js.map
Normal file
1
Web/js/bootstrap.esm.js.map
Normal file
File diff suppressed because one or more lines are too long
7
Web/js/bootstrap.esm.min.js
vendored
Normal file
7
Web/js/bootstrap.esm.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
Web/js/bootstrap.esm.min.js.map
Normal file
1
Web/js/bootstrap.esm.min.js.map
Normal file
File diff suppressed because one or more lines are too long
4494
Web/js/bootstrap.js
vendored
Normal file
4494
Web/js/bootstrap.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
Web/js/bootstrap.js.map
Normal file
1
Web/js/bootstrap.js.map
Normal file
File diff suppressed because one or more lines are too long
7
Web/js/bootstrap.min.js
vendored
Normal file
7
Web/js/bootstrap.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
Web/js/bootstrap.min.js.map
Normal file
1
Web/js/bootstrap.min.js.map
Normal file
File diff suppressed because one or more lines are too long
40
Web/js/theme.js
Normal file
40
Web/js/theme.js
Normal file
@@ -0,0 +1,40 @@
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const themeToggle = document.getElementById('themeToggle');
|
||||
const html = document.documentElement;
|
||||
const themeText = document.getElementById('themeText');
|
||||
const themeIcon = themeToggle.querySelector('.bi');
|
||||
|
||||
function setTheme(theme) {
|
||||
html.setAttribute('data-bs-theme', theme);
|
||||
document.body.classList.remove('theme-light', 'theme-dark');
|
||||
document.body.classList.add('theme-' + theme);
|
||||
localStorage.setItem('theme', theme);
|
||||
|
||||
if (theme === 'dark') {
|
||||
themeText.textContent = 'Light Mode';
|
||||
themeIcon.className = 'bi bi-sun';
|
||||
themeToggle.classList.remove('btn-dark');
|
||||
themeToggle.classList.add('btn-light');
|
||||
} else {
|
||||
themeText.textContent = 'Dark Mode';
|
||||
themeIcon.className = 'bi bi-moon';
|
||||
themeToggle.classList.remove('btn-light');
|
||||
themeToggle.classList.add('btn-dark');
|
||||
}
|
||||
}
|
||||
|
||||
const savedTheme = localStorage.getItem('theme');
|
||||
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
|
||||
|
||||
if (savedTheme) {
|
||||
setTheme(savedTheme);
|
||||
} else {
|
||||
setTheme(prefersDark ? 'dark' : 'light');
|
||||
}
|
||||
|
||||
themeToggle.addEventListener('click', function() {
|
||||
const currentTheme = html.getAttribute('data-bs-theme');
|
||||
const newTheme = currentTheme === 'dark' ? 'light' : 'dark';
|
||||
setTheme(newTheme);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user