repositories

daemon-sec-cheatsheet

The cheatsheet vault for operators: AD, enumeration, exploitation, priv-esc, web, DFIR

clonegit clone https://git.daemon-sec.xyz/daemon-sec-cheatsheet.git
PalettePicker.astroAstro44 lines1.7 KiBraw download
---
/**
 * The palette switcher, beside the sun/moon toggle in the masthead — the
 * same control as daemon-sec.xyz's. The toggle answers "light or dark";
 * this answers "which family" (Rosé Pine, Gruvbox, Gruvepine), and the two
 * are independent, so every palette keeps both of its modes.
 *
 * The button wears the current palette's three dots. All three sets are in
 * the markup and palettes.css shows the one matching `<html data-palette>`,
 * so the button is right before any script runs. Behaviour is in
 * src/scripts/palette.ts; the list itself is generated (src/lib/palettes.ts).
 */
import { PALETTES } from '../lib/palettes';
---

<div class="mast__palette" data-palette-picker>
  <button
    class="mast__icon mast__palette-btn"
    type="button"
    aria-haspopup="menu"
    aria-expanded="false"
    aria-label="Palette"
    title="Palette"
    data-palette-trigger
  >
    {PALETTES.map((p) => (
      <span class="pal-dots" data-palette-dots={p.id} aria-hidden="true">
        {p.swatch.map((c) => <i style={`background:${c}`}></i>)}
      </span>
    ))}
  </button>
  <div class="mast__palette-menu" role="menu" aria-label="Palette" hidden data-palette-menu>
    <p class="mast__palette-label" aria-hidden="true">Palette</p>
    {PALETTES.map((p) => (
      <button type="button" role="menuitemradio" aria-checked="false" tabindex="-1" data-palette-id={p.id}>
        <span class="pal-dots pal-dots--on" aria-hidden="true">
          {p.swatch.map((c) => <i style={`background:${c}`}></i>)}
        </span>
        <span class="mast__palette-name">{p.name}</span>
        <span class="mast__palette-tick" aria-hidden="true">✓</span>
      </button>
    ))}
  </div>
</div>