fix(pos): tema consistente en todas las paginas + theme bar ocultada
- app-init.js: aplica tema guardado en localStorage, oculta theme-bars que tapaban contenido (position:fixed), sobrescribe setTheme() de cada pagina para usar version persistente - sidebar.js: toggle de tema (sol/luna) integrado en el sidebar - Tema se mantiene al navegar entre paginas Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -36,12 +36,18 @@
|
||||
+ '</a>';
|
||||
}).join('');
|
||||
|
||||
var currentTheme = localStorage.getItem('pos_theme') || 'industrial';
|
||||
|
||||
var sidebarHtml = ''
|
||||
+ '<div class="pos-sidebar__brand">'
|
||||
+ ' <div class="pos-sidebar__logo">N</div>'
|
||||
+ ' <div class="pos-sidebar__title">Nexus POS</div>'
|
||||
+ '</div>'
|
||||
+ '<nav class="pos-sidebar__nav">' + linksHtml + '</nav>'
|
||||
+ '<div class="pos-sidebar__theme">'
|
||||
+ ' <button class="pos-theme-btn' + (currentTheme === 'industrial' ? ' is-active' : '') + '" onclick="posSetTheme(\'industrial\'); document.querySelectorAll(\'.pos-theme-btn\').forEach(function(b){b.classList.remove(\'is-active\')}); this.classList.add(\'is-active\');" title="Tema oscuro">🌙</button>'
|
||||
+ ' <button class="pos-theme-btn' + (currentTheme === 'modern' ? ' is-active' : '') + '" onclick="posSetTheme(\'modern\'); document.querySelectorAll(\'.pos-theme-btn\').forEach(function(b){b.classList.remove(\'is-active\')}); this.classList.add(\'is-active\');" title="Tema claro">☀️</button>'
|
||||
+ '</div>'
|
||||
+ '<div class="pos-sidebar__footer">'
|
||||
+ ' <div class="pos-sidebar__user">'
|
||||
+ ' <div class="pos-sidebar__avatar">' + initials + '</div>'
|
||||
@@ -129,6 +135,20 @@
|
||||
+ ' color: var(--color-error, #F85149);'
|
||||
+ ' border-color: var(--color-error, #F85149);'
|
||||
+ '}'
|
||||
+ '.pos-sidebar__theme {'
|
||||
+ ' display: flex; gap: 4px; padding: 8px 12px;'
|
||||
+ ' border-top: 1px solid var(--color-border, #30363D);'
|
||||
+ '}'
|
||||
+ '.pos-theme-btn {'
|
||||
+ ' flex: 1; padding: 6px; border: 1px solid var(--color-border, #30363D);'
|
||||
+ ' border-radius: 6px; background: none; cursor: pointer;'
|
||||
+ ' font-size: 1rem; text-align: center; transition: all 0.15s;'
|
||||
+ '}'
|
||||
+ '.pos-theme-btn:hover { background: var(--color-bg-base, rgba(255,255,255,0.05)); }'
|
||||
+ '.pos-theme-btn.is-active {'
|
||||
+ ' background: var(--color-primary, #F5A623);'
|
||||
+ ' border-color: var(--color-primary, #F5A623);'
|
||||
+ '}'
|
||||
+ '/* Push main content right */'
|
||||
+ '.pos-main-offset { margin-left: 220px; }'
|
||||
+ '@media (max-width: 768px) {'
|
||||
|
||||
Reference in New Issue
Block a user