Introducing a new way to review your PRs.

Read the announcement

bas3line / ascii

Animated ascii art for web pages, in TypeScript: React, Next.js, Astro, or one HTML tag

View on GitHub

21 documents · Updated Oct 26, 2026

docs / project-website

Project website

The project website is an Astro-based product site for ascii.rest. It presents the library as live animated art, helps people choose a piece, and turns that choice into code for a web page, README, terminal, or coding agent. It also provides browser tools that create new banners and image-based pieces without sending source files to a server.

Product role

Library showcase

The site makes the library understandable through direct use. Visitors see animated pieces in context, browse them by category, and open a dedicated page when they need details or a way to use one. The site is therefore both the public catalog and the first working example of the library.

References: site/…/index.astro• L3-24 site/…/[slug].astro• L1-39 site/…/library.ts• L1-18

Learning path

The main path moves from discovery to adoption: a visitor sees a live piece, reads a short explanation, copies a usage example, and then follows the docs for a deeper need. The site keeps the first step visual while making the next step practical. The docs guide the same visitor toward framework use, terminal use, browser tools, the kit, and AI coding agents.

The following path shows how the site connects discovery to use.

flowchart LR
  D[Discover a live piece] --> C[Choose a piece page]
  C --> U[Copy a usage example]
  U --> R[Read the docs or use a tool]

The website experience page describes the site structure and shared browsing model. The creative kit examples page covers the curated programs that show how the library can be used.

References: site/…/index.astro• L42-61 site/…/index.md• L18-79 site/…/Usage.astro• L17-74 site/…/index.md• L117-153

Site structure

Home page

The home page is the broad entry point. It combines a changing hero scene, a short product pitch, quick links to the main tools and docs, one ready-to-copy usage example, and the full piece catalog. A notice highlights new scenes, while categories let visitors scan the library without starting from a technical reference.

References: site/…/index.astro• L24-97 site/…/added.json• L1-12

Piece pages

Each piece page turns one catalog choice into a small product page. It shows the live result, basic facts, download and share actions, supported usage forms, and the source for readers who want to inspect or copy it. The usage area now includes plain HTML, React, Astro, TypeScript, terminal, coding-agent, and eligible README paths. Previous and next links support browsing without returning to the catalog.

References: site/…/[slug].astro• L34-89 site/…/Usage.astro• L17-74

Documentation pages

The docs are a guided reference for using the library in common environments. They cover setup, framework use, browser and terminal use, generated output, the kit for making new art, the public API, banners, images, AI coding agents, and common questions. The docs use the same site shell while replacing the piece index with a docs index and adding page navigation.

References: site/…/docs.ts• L6-68 site/…/Docs.astro• L24-70 site/…/index.md• L66-159 site/…/api.md• L7-44 site/…/cli.md• L7-35 site/…/faq.md• L7-8

Agent-readable documentation

The site also publishes the docs as plain text for coding agents. /llms.txt gives an index and /llms-full.txt gives the full guide, with site links made absolute and browser-only demos described in text. This lets an agent follow the same learning path without depending on the visual site.

References: site/…/llms.ts• L1-24 site/…/plain.ts• L1-44 site/…/index.md• L117-153

Interactive tools

The banner maker turns chosen text into a shareable animated banner. A visitor can set the letter style, motion, colors, background, tagline, and optional library art, then use the result in a README, web page, SVG workflow, terminal, or coding-agent prompt. The URL records the choices so a configured banner can be shared, while the browser preview and generated snippets stay aligned with that URL.

References: site/…/banner.astro• L1-13 site/…/banner.astro• L119-132 site/…/banner.astro• L316-430 site/…/banner.ts• L97-167

Image converter

The image converter turns a local image or pasted SVG into an animated ASCII piece. It supports logo and shade styles, lets the visitor control size, motion, category, and background handling, then previews the result and provides an embed, README SVGs, and downloadable piece source. The conversion stays in the browser, so the input image is not uploaded.

References: site/…/make.astro• L1-7 site/…/make.astro• L22-147 site/…/make.astro• L477-524

Interactive experience

Shared site shell

The shared shell gives every page a stable way to move through the product. It provides the site identity, searchable piece or docs navigation, links to the main tools, theme control, issue links, source links, live repository stars, and page metadata for sharing. On smaller screens it changes the navigation shape so the content remains the main focus. This keeps the catalog, detail pages, tools, and docs connected as one product rather than separate demos.

References: site/…/Layout.astro• L80-139 site/…/Layout.astro• L259-365 site/…/Icon.astro• L1-58 site/…/site.css• L181-219 site/…/site.css• L1236-1353

Live previews

Live art is progressive: the page first has a usable still image, then starts the animation when the preview is near the viewport. This keeps large catalogs approachable while preserving a visual result before interactive code loads. The experience also respects reduced-motion settings and lets the visitor opt into playback.

References: site/…/Art.astro• L1-21 site/…/Layout.astro• L367-484 site/…/examples.md• L37-41

Personal controls

The site remembers choices that affect repeated browsing. Visitors can switch between light and dark themes, choose color or one-ink logo views, and choose whether motion plays when their system asks for reduced motion. These controls change presentation without changing the underlying piece.

References: site/…/Layout.astro• L35-75 site/…/Layout.astro• L284-322 site/…/Layout.astro• L371-459 site/…/make.astro• L334-345

Code examples

Code examples connect a visual result to a usable integration. The site presents the same piece or banner in the formats that its audience needs, highlights the code for the page theme, and lets browser-generated examples start as plain text while highlighting loads. This keeps copying useful even when an optional code highlighter cannot load.

References: site/…/Usage.astro• L6-12 site/…/Usage.astro• L77-122 site/…/highlight.ts• L1-43 site/…/paint.ts• L1-26 site/…/banner.astro• L376-430 site/…/make.astro• L422-438

Share cards

Share cards give the home page, docs, tools, and piece pages a consistent preview when a URL is shared. A piece card presents the selected art with its name and credit, while a page card presents the page title and description over the site's visual style. This extends the product experience beyond the browser page without changing the underlying library content.

References: site/…/Layout.astro• L27-32 site/…/og.ts• L469-496 site/…/og.ts• L498-609 site/…/[slug].png.ts• L1-16

Delivery model

Built product surface

The site is built as a deployable Astro application for https://ascii.rest. Its pages are prepared ahead of time, while selected banner responses are produced when requested. The built library is exposed with the site so the same public origin can serve both the product experience and browser-facing library assets. Deployment keeps older page assets available long enough for open pages to recover from a new build.

References: site/astro.config.mjs• L6-35 site/…/[file].ts• L1-20 site/package.json• L1-21

Library-backed content

The site treats the package as its content source rather than maintaining a separate catalog. It reads the available pieces and their metadata, groups them into the browsing order, and derives examples, previews, usage snippets, and navigation from that shared view. The same view marks recent additions and supplies the art choices for the banner maker, so a library change can affect several public ways to use the product.

References: site/…/library.ts• L20-78 site/…/library.ts• L128-223 site/…/banner.astro• L87-92 site/…/added.json• L1-237

Change checklist

When these files or sections are changed, remember to consider these:

  • A new or renamed piece must remain consistent across the catalog, piece routes, sidebar links, usage snippets, recent markers, banner art choices, and generated share-card links.
  • Changes to docs order must keep the docs sidebar, previous and next links, page paths, edit links, and plain-text agent outputs aligned.
  • Changes to banner options must stay consistent between the interactive controls, shareable URL, generated SVG, and README, React, SVG, CLI, terminal, and agent output.
  • Changes to the shared shell must preserve both the piece navigation and the alternate docs navigation, including the small-screen layout and saved motion, ink, theme, and sidebar state.
  • Changes to the public asset path must preserve the site pages that load the library and the direct browser, README, and generated banner URLs.
  • Changes to code generation or highlighting must keep server-rendered examples, browser-generated examples, copy behavior, and plain-text fallbacks aligned.
  • Changes to share-card content must keep page metadata, piece routes, image generation, and image descriptions aligned.

Important failure modes

TriggerConsequenceGuard
A piece name changes without updating its public slugCatalog links or copied snippets point to a missing pieceKeep the package names, generated routes, and site library view in sync
A banner option is accepted by the form but not encoded in its URLShared links show a different banner from the one the visitor madeTreat the URL, preview, and generated output as one contract
A preview chunk cannot load after a deployA still image remains, but the live piece does not startUse the site reload path for stale page assets
Reduced-motion behavior is bypassed by a new interactive controlVisitors who ask for less motion see unexpected animationRoute playback through the shared motion choice
An input image fails browser decoding or exceeds the tool limitThe converter cannot produce a piece or output filesShow an input-specific status and keep the source local
A piece route has no matching share-card pathShared piece links have missing or generic imagesGenerate cards from the same piece set that creates the routes
Agent docs omit a page or leave a relative linkA coding agent cannot follow the site's guidance from plain textBuild both agent files from the same docs and normalize their links
Browser code highlighting fails after generated code changesThe example remains readable but loses its intended presentationKeep the plain code visible until highlighting succeeds

Key files

FileWhy to read it
site/src/pages/index.astroShows the product's main discovery and catalog journey
site/src/pages/[slug].astroShows the detail page that connects a piece to usage and source
site/src/layouts/Layout.astroDefines the shared navigation and interactive page behavior
site/src/layouts/Docs.astroShows how the docs fit into the same product shell
site/…/library.tsDefines the site's shared view of library content and usage paths
site/…/index.mdIntroduces the product and maps the main ways to use it
site/…/llms.tsDefines the plain-text docs surface for coding agents
site/src/pages/banner.astroShows the configurable banner creation experience
site/…/banner.tsDefines the shared banner URL and output contract
site/src/pages/make.astroShows the local image-to-piece creation experience
site/…/highlight.tsDefines code presentation for built and browser-generated examples
site/…/paint.tsDefines the safe plain-text fallback for live code examples
site/…/og.tsDefines the visual language for page and piece share cards
site/astro.config.mjsDefines the public site, deployment, and library delivery boundary