Update web/index.html
Browse files- web/index.html +37 -0
web/index.html
CHANGED
|
@@ -1985,6 +1985,43 @@
|
|
| 1985 |
document.addEventListener('DOMContentLoaded', function() {
|
| 1986 |
_fObserver.observe(document.body, { childList: true, subtree: true });
|
| 1987 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1988 |
</script>
|
| 1989 |
</body>
|
| 1990 |
</html>
|
|
|
|
| 1985 |
document.addEventListener('DOMContentLoaded', function() {
|
| 1986 |
_fObserver.observe(document.body, { childList: true, subtree: true });
|
| 1987 |
});
|
| 1988 |
+
</script>
|
| 1989 |
+
<script>
|
| 1990 |
+
(function () {
|
| 1991 |
+
|
| 1992 |
+
// Inyecta el CSS de transición en el <head>
|
| 1993 |
+
const style = document.createElement('style');
|
| 1994 |
+
style.textContent = [
|
| 1995 |
+
'.theme-transitioning *,',
|
| 1996 |
+
'.theme-transitioning *::before,',
|
| 1997 |
+
'.theme-transitioning *::after {',
|
| 1998 |
+
' transition:',
|
| 1999 |
+
' background-color 0.25s ease,',
|
| 2000 |
+
' color 0.20s ease,',
|
| 2001 |
+
' border-color 0.20s ease,',
|
| 2002 |
+
' box-shadow 0.20s ease !important;',
|
| 2003 |
+
'}'
|
| 2004 |
+
].join('\n');
|
| 2005 |
+
document.head.appendChild(style);
|
| 2006 |
+
|
| 2007 |
+
// Activa la transición durante el cambio de tema
|
| 2008 |
+
function smoothThemeSwitch() {
|
| 2009 |
+
document.body.classList.add('theme-transitioning');
|
| 2010 |
+
setTimeout(function () {
|
| 2011 |
+
document.body.classList.remove('theme-transitioning');
|
| 2012 |
+
}, 400);
|
| 2013 |
+
}
|
| 2014 |
+
|
| 2015 |
+
// Intercepta el botón #modeSwitcher que ya existe en tu HTML
|
| 2016 |
+
document.addEventListener('DOMContentLoaded', function () {
|
| 2017 |
+
const btn = document.getElementById('modeSwitcher');
|
| 2018 |
+
if (btn) {
|
| 2019 |
+
btn.addEventListener('click', smoothThemeSwitch, true);
|
| 2020 |
+
// true = capture phase: se ejecuta antes que el listener de apps.js
|
| 2021 |
+
}
|
| 2022 |
+
});
|
| 2023 |
+
|
| 2024 |
+
})();
|
| 2025 |
</script>
|
| 2026 |
</body>
|
| 2027 |
</html>
|