daemon-sec-cheatsheet

The cheatsheet vault for operators: AD, enumeration, exploitation, priv-esc, web, DFIR
git clone https://git.daemon-sec.xyz/daemon-sec-cheatsheet.git
Log | Files | Refs | README | LICENSE

SignalField.astro (1243B)


      1 <canvas class="signal-field" data-signal aria-hidden="true"></canvas>
      2 
      3 <script>
      4   // The field behind every hero and banner: daemon-sec's dot field
      5   // (src/scripts/dmn), which replaced the old connection-node map. It reads
      6   // this site's mode-flipping tokens off the canvas, so inside a `.plate`
      7   // band it takes the band's night values.
      8   import { mountParticleField } from '../scripts/dmn/particle-field';
      9 
     10   const cleanups = new Set<() => void>();
     11   function init(): void {
     12     document.querySelectorAll<HTMLCanvasElement>('[data-signal]:not([data-bound])').forEach((canvas) => {
     13       canvas.dataset.bound = '1';
     14       cleanups.add(
     15         mountParticleField(canvas, {
     16           vars: { ink: '--text', base: '--base', iris: '--iris', love: '--love' },
     17           onFail: () => canvas.remove(),
     18         }),
     19       );
     20     });
     21   }
     22 
     23   // Heroes belong to their page; release their GPU resources before Astro swaps it.
     24   document.addEventListener('astro:before-swap', () => {
     25     cleanups.forEach((cleanup) => cleanup());
     26     cleanups.clear();
     27   });
     28   document.addEventListener('astro:page-load', init);
     29   if (document.readyState !== 'loading') init();
     30   else document.addEventListener('DOMContentLoaded', init, { once: true });
     31 </script>