| 505 | return folders.reduce((acc, f) => { acc[f] = { ...allTrue }; return acc; }, {}); |
| 506 | } |
| 507 | function applyHeaderColorsFromAdmin() { |
| 508 | try { |
| 509 | const lightInput = document.getElementById('brandingHeaderBgLight'); |
| 510 | const darkInput = document.getElementById('brandingHeaderBgDark'); |
| 511 | const root = document.documentElement; |
| 512 | |
| 513 | const light = lightInput ? lightInput.value.trim() : ''; |
| 514 | const dark = darkInput ? darkInput.value.trim() : ''; |
| 515 | |
| 516 | if (light) root.style.setProperty('--header-bg-light', light); |
| 517 | else root.style.removeProperty('--header-bg-light'); |
| 518 | |
| 519 | if (dark) root.style.setProperty('--header-bg-dark', dark); |
| 520 | else root.style.removeProperty('--header-bg-dark'); |
| 521 | } catch (e) { |
| 522 | console.warn('Failed to live-update header colors from admin panel', e); |
| 523 | } |
| 524 | } |
| 525 | function applyFooterFromAdmin() { |
| 526 | try { |
| 527 | const footerEl = document.getElementById('siteFooter'); |