runnerd-web 0.0.4

The web dashboard runnerd serves on loopback: a client of the daemon's API
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
// The light/dark switch: the choice is kept in localStorage; without one, the system's preference applies.
const root = document.documentElement;
const stored = localStorage.getItem('runnerd-theme');
if (stored === 'light' || stored === 'dark') root.dataset.theme = stored;

document.addEventListener('click', (event) => {
  if (!(event.target instanceof Element) || !event.target.closest('[data-theme-toggle]')) return;
  const dark = root.dataset.theme
    ? root.dataset.theme === 'dark'
    : matchMedia('(prefers-color-scheme: dark)').matches;
  root.dataset.theme = dark ? 'light' : 'dark';
  localStorage.setItem('runnerd-theme', root.dataset.theme);
});