┌─ ASTRO ────────────────────────────────────────────────────────────────────┐│ --- ││ // Frame - renders the same ASCII builder at both desktop (FRAME_W) and ││ // mobile (MOBILE_FRAME_W) widths, then CSS toggles which one is visible. ││ // Every frame passes through checkGrid, so an overflowing line or an ││ // off-grid glyph fails the build instead of bending a border. ││ import Pre from "../Pre/Pre.astro"; ││ import { checkGrid } from "../../lib/ascii"; ││ import { FRAME_W, MOBILE_FRAME_W } from "../../lib/config"; ││ ││ interface Props { ││ build: (width: number) => string; ││ class?: string; ││ } ││ ││ const { build, class: cls = "" } = Astro.props as Props; ││ const ctx = `Frame${cls ? `(${cls})` : ""} on ${Astro.url.pathname}`; ││ --- ││ <Pre class={`frame-wide ${cls}`.trim()}>{checkGrid(build(FRAME_W), FRAME_W, ctx)}< ││ /Pre> ││ <Pre class={`frame-narrow ${cls}`.trim()}>{checkGrid(build(MOBILE_FRAME_W), MOBILE ││ _FRAME_W, ctx)}</Pre> │└────────────────────────────────────────────────────────────────────────────────────┘
┌─ ASTRO ──────────────────────────────┐│ --- ││ // Frame - renders the same ASCII builder at ││ both desktop (FRAME_W) and ││ // mobile (MOBILE_FRAME_W) widths, then CSS ││ toggles which one is visible. ││ // Every frame passes through checkGrid, so ││ an overflowing line or an ││ // off-grid glyph fails the build instead of ││ bending a border. ││ import Pre from "../Pre/Pre.astro"; ││ import { checkGrid } from "../../lib/ascii"; ││ import { FRAME_W, MOBILE_FRAME_W } from "../ ││ ../lib/config"; ││ ││ interface Props { ││ build: (width: number) => string; ││ class?: string; ││ } ││ ││ const { build, class: cls = "" } = Astro.pro ││ ps as Props; ││ const ctx = `Frame${cls ? `(${cls})` : ""} o ││ n ${Astro.url.pathname}`; ││ --- ││ <Pre class={`frame-wide ${cls}`.trim()}>{che ││ ckGrid(build(FRAME_W), FRAME_W, ctx)}</Pre> ││ <Pre class={`frame-narrow ${cls}`.trim()}>{c ││ heckGrid(build(MOBILE_FRAME_W), MOBILE_FRAME ││ _W, ctx)}</Pre> │└──────────────────────────────────────────────┘