SPB Git

spb/drive Public

SPB Drive — self-hosted personal cloud drive (files, previews, sharing) on the MacLustr cluster.

JavaScript 82.7% CSS 10.6% Nunjucks 3.6% Shell 1.8% SQL 1.3%
1.2 KB · 26 lines javascript
Raw Blame History
1/**2 * ─────────────────────────────────────────────3 *  SPB Drive — Personal Cloud Drive4 * ─────────────────────────────────────────────5 *  Author  : Simon-Pierre Boucher6 *  Contact : contact@spboucher.ai7 *  File    : src/web/assets/js/theme.js8 *  Purpose : Apply the saved theme before first paint (external file —9 *            inline scripts are blocked by the strict CSP)10 *  License : MIT © Simon-Pierre Boucher11 * ─────────────────────────────────────────────12 */1314(() => {15  try {16    const saved = localStorage.getItem('spbdrive-theme');17    if (saved === 'dark' || saved === 'light') {18      document.documentElement.dataset.theme = saved;19    }20    const meta = document.getElementById('metaTheme');21    if (meta) {22      meta.content = document.documentElement.dataset.theme === 'dark' ? '#131210' : '#f6f5f1';23    }24  } catch { /* private mode — keep the default light theme */ }25})();26