3ae96ef229
覆盖前端五端/后端/MySQL/弹性节点拓扑/Web安全/安全总纲,遵循 design/ 设计系统视觉呈现。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
18 lines
578 B
JavaScript
18 lines
578 B
JavaScript
lucide.createIcons();
|
|
(function () {
|
|
var btn = document.getElementById('themeBtn');
|
|
if (localStorage.getItem('pg-doc-theme') === 'dark') {
|
|
document.documentElement.setAttribute('data-theme', 'dark');
|
|
}
|
|
btn.addEventListener('click', function () {
|
|
var root = document.documentElement;
|
|
if (root.getAttribute('data-theme') === 'dark') {
|
|
root.removeAttribute('data-theme');
|
|
localStorage.setItem('pg-doc-theme', 'light');
|
|
} else {
|
|
root.setAttribute('data-theme', 'dark');
|
|
localStorage.setItem('pg-doc-theme', 'dark');
|
|
}
|
|
});
|
|
})();
|