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 / ascii-art-catalog

ASCII art catalog

The ASCII art catalog is the reusable artwork collection behind ascii.rest. It gives each piece a stable name, a visual category, and enough display metadata for consumers to choose and render it through the ASCII art library. The catalog also provides both direct module exports and name-based lookup for different loading needs.

Piece model

Piece contract

A piece is one artwork that can produce a fixed-size frame from play time and optional display context. Its metadata describes the user-facing name, category, short description, frame size, motion rate, and optional color or timing behavior. This common contract lets the same artwork work in the browser, a terminal, an SVG, or a framework component.

References: src/types.ts• L26-50 src/types.ts• L63-70 src/mount.ts• L44-63

Visual forms

The catalog contains both text pieces and color-aware pieces. Text pieces render as one-ink characters, while color-aware pieces expose a palette and can use per-cell color when a consumer chooses a canvas; either form can still be shown as plain text. Some pieces are still images, some animate from play time, and some read the real clock or date. UI pieces such as chat, repository history, and CI pipelines extend the text collection with familiar software views that change over time and can accept piece-specific input. Company marks such as HelixDB add branded visual assets that can keep a still form or show a timed visual effect.

References: src/types.ts• L35-50 src/types.ts• L53-64 src/mount.ts• L49-60 src/…/donut.ts• L7-14 src/…/ubuntu.ts• L19-31 src/…/analog-clock.ts• L13-22 src/…/chat.ts• L48-58 src/…/git-graph.ts• L50-59 src/…/pipeline.ts• L57-67 src/…/helixdb.ts• L21-33 src/…/helixdb.ts• L116-150

Scene collection

The recent collection growth is concentrated in scenes, a category for complete visual moments rather than isolated symbols or interface parts. These pieces use color palettes to build views of places, weather, cities, travel, and space; their shared frame shape lets consumers browse them with the same catalog rules as the older pieces.

The scene set now covers several broad visual themes:

  • Places and water: amer fort, gangaur ghat, jal mahal, kite festival, and lake pichola depict Indian landmarks, city life, and lakes.
  • Weather and land: cloud sea, green storm, jungle falls, night highway, snow train, and volcano night focus on changing natural or travel scenes.
  • Cities and light: black prism, command city, lava wall, prism city, and salt flat use built forms, signs, roads, or light as the main subject.
  • Orbit and planets: edge orbit, planet scale, and saturn rise present Earth or planetary scenes at a large scale.

These themes are descriptive groupings for people who browse the collection. They do not create new catalog categories; each added piece remains in scenes.

References: src/…/amer-fort.ts• L14-31 src/…/black-prism.ts• L20-36 src/…/cloud-sea.ts• L14-31 src/…/command-city.ts• L19-35 src/…/edge-orbit.ts• L18-35 src/…/gangaur-ghat.ts• L15-38 src/…/green-storm.ts• L14-29 src/…/jal-mahal.ts• L14-32 src/…/jungle-falls.ts• L15-33 src/…/kite-festival.ts• L16-33 src/…/lake-pichola.ts• L15-31 src/…/lava-wall.ts• L13-33 src/…/night-highway.ts• L20-38 src/…/planet-scale.ts• L15-29 src/…/prism-city.ts• L18-36 src/…/salt-flat.ts• L17-34 src/…/saturn-rise.ts• L17-34 src/…/snow-train.ts• L15-32 src/…/volcano-night.ts• L14-31

Catalog categories

Category groups

Each piece has one category. The category describes what the artwork represents or how it is used, so a consumer can browse a broad group without knowing the piece's internal drawing method.

CategoryVisual asset group
scenesPlaces and wider views such as coasts, forests, and city scenes
shapesGeometric or three-dimensional forms
spaceCelestial objects and space scenes
physicsMotion and physical-system studies
natureWeather, plants, water, and other natural subjects
creaturesAnimals and other living subjects
objectsRecognizable objects and devices
generativePatterns made from rules or repeated calculation
effectsAtmosphere and visual treatments such as smoke, rain, or static
uiInterface-like displays such as clocks, bars, terminals, chats, repository histories, and build pipelines
dataCharts, meters, and data-shaped displays
typeText, lettering, and typewriter-like displays
logosProgramming-language and project marks
companiesCompany or product marks
distrosOperating-system distribution marks

References: src/types.ts• L7-22 src/…/donut.ts• L7-14 src/…/galaxy.ts• L8-15 src/…/progress-bar.ts• L12-20 src/…/terminal.ts• L13-21 src/…/chat.ts• L48-55 src/…/git-graph.ts• L50-55 src/…/pipeline.ts• L57-64

Piece metadata

Metadata supports catalog browsing and display choice without running the artwork first. A consumer can use the name and note for labels, the category for filtering, the dimensions for layout, and the frame rate or motion fields to understand whether the piece can move. Options provide the piece's own defaults, so a consumer can present a usable artwork before applying overrides.

References: src/types.ts• L26-50 src/…/ubuntu.ts• L19-31 src/…/progress-bar.ts• L12-20 src/…/analog-clock.ts• L13-22 src/…/edge-orbit.ts• L18-35 src/…/chat.ts• L48-58 src/…/pipeline.ts• L57-67

Artwork index

Named exports

The package's ascii.rest/pieces entry point exposes every catalog item as a named export. The added scene pieces are included in this same surface, as are the UI pieces chat, gitGraph, and pipeline, and the company mark helixdb, so direct consumers can bundle them without using name lookup. Export names use normal JavaScript naming for multi-word pieces, while the piece metadata and file-based lookup retain the catalog's readable hyphenated names.

References: src/…/index.ts• L1-5 src/…/index.ts• L34-35 src/…/index.ts• L92-93 src/…/index.ts• L107-108 src/…/index.ts• L160-162 src/…/index.ts• L226-243 package.json• L22-30

Name lookup

The central library index maps each hyphenated piece name to a load operation and exposes the full name list. It also marks the color-aware subset so consumers that load by name can select a suitable display before the piece finishes loading. Lookup is on demand, which keeps an application from loading the whole collection when it uses only one artwork.

References: src/library.ts• L5-7 src/library.ts• L224-235 src/index.ts• L9-11 src/react.tsx• L25-69

Consumer selection flow

The catalog turns a consumer's choice into a piece module, then the shared rendering path uses the piece contract to create frames in the selected output form.

This diagram shows the two public selection paths and their shared rendering result.

flowchart LR
    A[Consumer chooses category or name] --> B{Access path}
    B -->|Named import| C[Piece module bundled by the consumer]
    B -->|Name lookup| D[Catalog index loads one piece]
    C --> E[Piece metadata and frame function]
    D --> E
    E --> F[Shared renderer]
    F --> G[Text or color output]

References: src/library.ts• L5-7 src/library.ts• L226-235 src/…/index.ts• L4-7 src/mount.ts• L44-63

Change checklist

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

  • Keep the generated name-to-loader index and the named-export index aligned with the piece files.
  • Keep a piece's category, display name, note, dimensions, and color metadata consistent with the artwork consumers receive.
  • When a piece changes from text to color or back, review the catalog's canvas classification and the consumer's first-render behavior.
  • Preserve the piece name used by name-based consumers when renaming a source file; update all public lookup and export surfaces together.
  • Keep new scene pieces in the broad scenes category unless the catalog model gains a deliberate new category; descriptive subject themes do not replace the category contract.

Important failure modes

TriggerConsequenceGuard
A piece exists but is absent from the generated lookup indexName-based consumers cannot load itRegenerate the index after adding a piece
The lookup name and file export name drift apartDirect imports and name-based loading refer to different catalog entriesTreat the piece file name as the shared public identity
Metadata marks a text piece as color-aware or the reverseConsumers choose the wrong output surfaceKeep palette and the catalog's color set derived from the same artwork metadata
A frame does not keep its declared row and column sizeRenderers can misplace cells or produce broken outputKeep every frame aligned with its meta.rows and meta.cols contract
A new scene is named in metadata but absent from src/…/index.tsDirect consumers cannot bundle the artwork even though its source file existsRegenerate the named-export index after adding a piece

Key files

FileWhy to read it
src/types.tsDefines the piece contract, categories, metadata, and frame context shared by the catalog.
src/library.tsDefines name-based loading, the complete name list, and the color-aware subset.
src/…/index.tsShows the direct named-export surface for consumers that bundle pieces.
src/…/helixdb.tsShows a company mark that supports both plain text and color-aware output with an optional timed glint.
src/…/donut.tsGives a small example of a category, metadata record, and animated text piece.
src/…/ubuntu.tsShows a color-aware piece with options and a palette.
src/…/chat.tsShows a UI conversation piece with configurable messages.
src/…/git-graph.tsShows a UI history view with branch and commit motion.
src/…/pipeline.tsShows a UI build view with configurable stages and pass or fail states.
src/mount.tsExplains how catalog metadata becomes text or canvas output.
registry/ascii.tsxShows how a consumer-facing registry component accepts a piece and renders it.
registry/ascii-banner.tsxShows the separate generated-text asset path, which complements the fixed catalog pieces.

The component registry documents how these capabilities are packaged for external component tooling.