bit-twiddler 0.1.0

Cross-platform developer toolbox: bit manipulation, hashing, YAML/JSON/SQL, QR, Markdown, cron, and 40+ more tools — Tauri v2, no Node.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
  // THEME PICKER — 4 accent color schemes, persisted to localStorage
  // ============================================================
  const applyTheme = (theme) => {
    const t = theme || 'ocean';
    document.body.setAttribute('data-theme', t);
    localStorage.setItem('bt-theme', t);
    $('.theme-dot').removeClass('active-theme');
    $(`.theme-dot[data-theme="${t}"]`).addClass('active-theme');
  };

  $('.theme-dot').on('click', function() { applyTheme($(this).data('theme')); });

  // Restore saved theme (or default ocean)
  applyTheme(localStorage.getItem('bt-theme') || 'ocean');