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
SectionJump.astroAstro41 lines1.4 KiBraw download
---
interface Item {
  key: string;
  label: string;
  count: number;
  accent: string;
}
interface Props {
  items: Item[];
  /** Names the strip for assistive tech: `Sections`, `Shelves`. */
  label: string;
}
const { items, label } = Astro.props;

/**
 * Jump links for a sectioned list, sticky under the masthead. Each link
 * carries `data-sf-jump`, so the sheet filter hides the links to sections it
 * has emptied; the leading control goes back up to the filter panel.
 * Styling lives in filter.css with the panel it works beside.
 */
---
<nav class="sec-jump" aria-label={label} data-sec-jump>
  <a class="sec-jump__top" href="#filter" aria-label="Back to the filter"><span aria-hidden="true">↑</span> Filter</a>
  <div class="sec-jump__track">
    {items.map((it, i) => (
      <a href={`#sec-${it.key}`} data-sf-jump={it.key} style={`--acc: var(--${it.accent});`}>
        <span class="n">{String(i + 1).padStart(2, '0')}</span>
        <span>{it.label}</span>
        <span class="cnt" data-sf-n={`sec:${it.key}`}>{String(it.count).padStart(2, '0')}</span>
      </a>
    ))}
  </div>
</nav>

<script>
  import { initSectionJump } from '../scripts/section-jump';

  document.addEventListener('astro:page-load', initSectionJump);
  if (document.readyState !== 'loading') initSectionJump();
  else document.addEventListener('DOMContentLoaded', initSectionJump, { once: true });
</script>