repositories

daemon-sec-lotl

DÆMONBins: GTFOBins × LOLBAS × WADComs × LOOBins in one filterable catalog

clonegit clone https://git.daemon-sec.xyz/daemon-sec-lotl.git
SlantTitle.astroAstro105 lines3.1 KiBraw download
---
/**
 * The slanted page banner — ported from daemon-sec.xyz's SlantTitle. A slab
 * skewed skewX(-11deg) in the section's accent, the title counter-skewed so
 * the letterforms stay upright, and a misregistered ink edge nudged up-left so
 * the pair reads as two printing plates rather than one bordered box.
 *
 * The accent is a theme-aware Rosé Pine semantic token, so the slab keeps its
 * role in both Dawn and Night. The title decodes on view via app.ts's
 * initUnscramble() (data-unscramble), and the edge registers in with a CSS
 * settle that collapses to nothing under prefers-reduced-motion.
 */
type Tone = 'love' | 'iris' | 'pine' | 'foam' | 'gold' | 'rose';
interface Props {
  eyebrow: string;
  title: string;
  intro?: string;
  tone?: Tone;
}
const { eyebrow, title, intro, tone = 'pine' } = Astro.props;
const SKEW = -11;
---
<header class="slant" style={`--acc: var(--${tone});`}>
  <p class="slant__eyebrow">{eyebrow}</p>
  <div class="slant__box">
    <span class="slant__edge" aria-hidden="true" style={`transform: skewX(${SKEW}deg);`}></span>
    <h1 class="slant__plate" style={`transform: skewX(${SKEW}deg);`}>
      <span class="slant__title" data-unscramble={title} style={`transform: skewX(${-SKEW}deg);`}>{title}</span>
    </h1>
  </div>
  {intro && <p class="slant__intro">{intro}</p>}
  {(Astro.slots.has('meta')) && <div class="slant__meta"><slot name="meta" /></div>}
</header>

<style>
  .slant { display: block; }
  .slant__eyebrow {
    font-family: var(--font-plex);
    font-size: 10.5px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--acc);
    margin: 0;
  }
  .slant__box { position: relative; display: inline-block; margin-top: 1rem; }
  .slant__edge {
    position: absolute;
    top: -7px;
    left: -7px;
    height: 100%;
    width: 100%;
    border: 2px solid var(--fg);
    transform-origin: center;
    animation: slant-edge 900ms var(--ease) both;
  }
  .slant__plate {
    position: relative;
    margin: 0;
    padding: 14px 26px;
    background: var(--acc);
    color: var(--base);
    transform-origin: center;
    animation: slant-plate 900ms var(--ease) both;
  }
  .slant__title {
    display: block;
    font-family: var(--font-archivo);
    font-weight: 900;
    font-size: clamp(30px, 5.4vw, 62px);
    line-height: 0.94;
    letter-spacing: -0.03em;
    font-stretch: 76%;
    text-transform: uppercase;
  }
  .slant__intro {
    margin-top: 1.75rem;
    max-width: 62ch;
    font-size: 16px;
    line-height: 1.6;
    color: var(--fg);
    text-wrap: pretty;
  }
  .slant__meta {
    margin-top: 1.75rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 2rem;
    border-top: 1px solid var(--rule);
    padding-top: 1rem;
    font-family: var(--font-plex);
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--acc);
  }
  @keyframes slant-edge {
    from { opacity: 0.25; top: -22px; left: -33px; }
    to { opacity: 1; top: -7px; left: -7px; }
  }
  @keyframes slant-plate {
    from { transform: skewX(-11deg) translate(14px, -6px); }
    to { transform: skewX(-11deg) translate(0, 0); }
  }
</style>