32 lines
1.3 KiB
PHP
Executable File
32 lines
1.3 KiB
PHP
Executable File
</main>
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
|
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
|
<script src="https://cdn.jsdelivr.net/npm/summernote@0.8.18/dist/summernote-lite.min.js"></script>
|
|
<script>
|
|
(function() {
|
|
const html = document.documentElement;
|
|
const toggleBtn = document.getElementById('theme-toggle');
|
|
const icon = toggleBtn.querySelector('i');
|
|
|
|
function updateIcon(theme) {
|
|
icon.className = theme === 'dark' ? 'bi bi-sun-fill' : 'bi bi-moon-fill';
|
|
}
|
|
|
|
updateIcon(html.getAttribute('data-bs-theme'));
|
|
|
|
toggleBtn.addEventListener('click', function() {
|
|
const currentTheme = html.getAttribute('data-bs-theme');
|
|
const newTheme = currentTheme === 'dark' ? 'light' : 'dark';
|
|
html.setAttribute('data-bs-theme', newTheme);
|
|
document.cookie = 'theme=' + newTheme + ';path=/;max-age=31536000';
|
|
updateIcon(newTheme);
|
|
});
|
|
})();
|
|
</script>
|
|
<?php if (isset($extraScripts)): ?>
|
|
<?= $extraScripts ?>
|
|
<?php endif; ?>
|
|
</body>
|
|
</html>
|