This commit is contained in:
2026-05-07 17:16:58 +02:00
parent b525980db9
commit fac8a6e412
10 changed files with 808 additions and 7108 deletions

View File

@@ -1,5 +1,5 @@
// App.js
import { $, watch, h, when } from "./sigpro.js";
import { $, watch, h, when } from "sigpro";
import {
Navbar,
Drawer,
@@ -22,19 +22,19 @@ import {
Fieldset,
Input,
Button
} from "./sigpro-ui.js";
import './sigpro-ui.css';
} from "sigpro-ui";
import 'sigpro-ui/css';
import { Desktop } from "./tabs/Desktop.js";
export const isDark = $(false, "theme-mode");
export const App = () => {
// Tema oscuro/claro
const isDark = $(localStorage.getItem("theme") === "dark"
|| (!localStorage.getItem("theme") && window.matchMedia("(prefers-color-scheme: dark)").matches));
// Sincronizar el tema con el atributo data-theme del HTML
watch(isDark, (dark) => {
const theme = dark ? "dark" : "light";
document.documentElement.setAttribute("data-theme", theme);
localStorage.setItem("theme", theme);
document.documentElement.setAttribute("data-theme", dark ? "dark" : "light");
});
// Activar tema inicial
@@ -57,7 +57,7 @@ export const App = () => {
const tabs = $([
{
label: "Escritorio",
content: () => `¡Bienvenido al escritorio!`,
content: () => Desktop,
closable: false
}
]);