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 / website-experience

Website experience

The website is an Astro front end for browsing, using, and making animated ASCII art. It combines build-time page data with small browser enhancements so visitors can see a useful first frame without JavaScript, then interact with live art, code samples, themes, downloads, and creation tools.

Page experience

The site gives each visitor a common shell and a clear path from discovery to use. The home page introduces the collection, piece pages explain one work, docs explain the product, and the two maker pages turn user input into reusable output. See the parent page, Project website, for the wider site role and Creative kit examples for the example programs shown by the product.

Page map

The page map groups routes by the visitor goal they serve. Collection pages lead to a single piece, while tool pages produce assets that can leave the site.

Visitor goalMain routeExperience
Discover the collection/A featured scene, sponsor area, short product pitch, usage example, and category grids of live piece previews.
Inspect one piece/<slug>/A large preview, facts, download and share actions, usage choices, and the piece source.
Learn how to use the library/docs/Markdown guides with a docs index, table of contents, code copying, live examples, and previous/next navigation.
Make a banner/banner/A browser editor for text, style, motion, color, background, and optional library art. It produces previews and usage forms.
Convert an image/make/A local browser editor that turns an image or SVG into an animated piece, an embed, README SVGs, and source code.
Find project context/author/Author links, support choices, sponsors, and acknowledgements.
Recover from a bad route/404A not-found piece with links back to the collection and docs.

The site also serves generated assets and machine-facing responses. Piece SVGs support script-free README use, banner SVGs are produced from URL choices, and sitemap, LLM, Open Graph, and registry routes expose the site to search, sharing, and tooling.

References: site/…/index.astro• L24-96 site/…/[slug].astro• L36-91 site/…/make.astro• L19-150 site/…/banner.astro• L119-270 site/…/author.astro• L9-19 site/…/404.astro• L10-18 site/…/[name].svg.ts• L1-20 site/…/[file].ts• L1-71

Collection browsing

The home page turns the library into a browsable catalogue. It opens with a scene chosen from the scene collection, then places common UI and identity pieces before the wider set of shapes, simulations, nature, and effects; each card links to the full piece page and marks recent additions.

The sidebar repeats this catalogue on collection pages. Visitors can search piece names or categories, keep their sidebar position while moving between pages, and see the current piece marked in the index. On narrow screens the sidebar becomes a compact category line until search needs the full result list.

References: site/…/index.astro• L11-95 site/…/library.ts• L20-78 site/…/added.json• L1-10 site/…/Layout.astro• L78-138 site/…/Layout.astro• L141-257 site/…/site.css• L181-376 site/…/site.css• L1236-1311

Piece pages

A piece page is the main hand-off from browsing to adoption. It shows the work in the site's current visual context, gives enough facts to identify its shape and motion, then places ways to use, save, share, or inspect it below the preview.

The available usage views match the product's delivery targets: HTML, React, Astro, TypeScript, terminal, a coding-agent skill, and, when the piece supports it, a script-free README SVG. The page keeps the source visible so a visitor can copy it or open the matching repository file without leaving the context of the example.

References: site/…/[slug].astro• L27-85 site/…/Usage.astro• L6-75 site/…/Usage.astro• L85-125 site/…/Downloads.astro• L1-25 site/…/Share.astro• L1-45 site/…/library.ts• L157-223

Share cards

Share cards give piece pages a stable image for link previews. The page shell selects a site-wide card by default or a piece-specific card when the page supplies one, so shared links keep the same art, title, and credit as the browsing experience.

The piece card route is generated for every library piece. It turns the piece's selected visual moment into a 1200×630 PNG and includes the piece name and relevant design credit without requiring a browser to run the animation.

References: site/…/Layout.astro• L27-34 site/…/og.ts• L430-496 site/…/[slug].png.ts• L9-16

Documentation pages

The docs use the same site shell but replace the piece catalogue with a task-based docs index. The pages introduce the product, explain its web and terminal use, answer common setup questions, and show the public package surface through readable Markdown, copyable code blocks, and live examples.

The introduction presents the library's main ways to use art: a script tag, package components, SVG output, the terminal, the image maker, coding agents, and the creative kit. The docs index is shared by the sidebar, page order, sitemap, and generated LLM text. This keeps navigation and machine-facing summaries aligned with the Markdown pages under site/src/pages/docs/.

References: site/…/Docs.astro• L8-72 site/…/Docs.astro• L74-98 site/…/docs.ts• L1-68 site/…/index.md• L7-16 site/…/index.md• L66-115 site/…/llms.ts• L10-24 site/…/plain.ts• L7-44 site/…/site.css• L980-1234

Machine-readable documentation

The site turns its docs into plain text for coding agents and other tools. The generated view keeps Markdown code blocks, replaces browser-only examples with short descriptions, and makes site links absolute so the text works outside the website.

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

Shared visual system

The shared layout gives every page the same navigation, metadata, controls, footer, and progressive enhancement rules. The visual system uses a restrained monospace treatment so text, code, controls, and ASCII art belong to one browsing surface.

Layout shell

site/src/layouts/Layout.astro is the site-wide frame. It owns the page head, canonical and social metadata, analytics, author credit, sidebar, top tools, footer, and the browser behavior shared by collection, tool, author, and error pages. It also selects the default or page-specific image used in social metadata.

The shell also establishes the no-script baseline. Art starts as a server-rendered first frame, tabs leave all panels readable before enhancement, and copy controls appear only after their browser action is available. This makes the same page useful during slow loads and in reduced-script environments.

References: site/…/Layout.astro• L8-35 site/…/Layout.astro• L37-77 site/…/Layout.astro• L259-323 site/…/Layout.astro• L367-536 site/…/Art.astro• L1-21

Theme and responsive behavior

The site supports light and dark themes from the start of page load. A saved choice wins over the system preference, and the choice changes page colors, browser chrome, sponsor marks, code colors, and the first visible art frame.

The layout uses a sticky sidebar on wide screens and a compact navigation flow on narrow screens. Wells size art from its cell shape, grids adapt to available width, and docs and previews collapse to single columns when the screen is small.

References: site/…/Layout.astro• L37-51 site/…/Layout.astro• L284-322 site/…/site.css• L11-90 site/…/site.css• L216-236 site/…/site.css• L719-724 site/…/site.css• L1236-1360

Shared components

The reusable components keep product actions consistent across the home page and piece pages. They separate the display of art from usage code, downloads, social sharing, sponsor slots, and small brand marks.

ComponentProduct role
Art.astroProvides the server-visible first frame and the metadata needed to start live playback later.
Usage.astroPresents the supported ways to place a piece in another product.
Downloads.astroOffers browser-made image, video, GIF, and supported README SVG files.
Share.astroConnects a piece to social posts, links, README snippets, and banner creation.
Sponsors.astroShows sponsor, open sponsor, and acknowledgement areas in the right page context.
Credit.astro and Icon.astroProvide consistent author and external-service identity marks.

References: site/…/Art.astro• L1-21 site/…/Usage.astro• L1-125 site/…/Downloads.astro• L1-114 site/…/Share.astro• L1-75 site/…/Sponsors.astro• L1-77 site/…/Credit.astro• L1-21 site/…/Icon.astro• L6-58

Code presentation

Code examples use one highlighting service for build-time snippets and code that changes in the browser. It loads only the language needed, uses the site's light and dark color variables, and leaves code as readable plain text if browser highlighting cannot load.

References: site/…/highlight.ts• L1-43 site/…/paint.ts• L1-26 site/…/site.css• L34-67 site/…/site.css• L961-971 site/…/banner.astro• L272-294 site/…/make.astro• L309-315

Website data model

The browsing experience is built from a small set of shared data views. Package metadata supplies the art, site data supplies grouping and labels, and page data supplies the descriptions for the interactive tools.

Library view

library.ts turns package pieces into the site-facing Piece view. Each entry joins its package metadata with its slug, source text, baked light and dark first frames, and a recent marker derived from added.json. The same view drives the sidebar, category cards, piece routes, usage snippets, sponsor context, and issue links.

The category order is part of the experience rather than a raw package listing. It defines the order used for discovery, navigation, and the visual grouping of the home page.

References: site/…/library.ts• L1-78 site/…/library.ts• L80-105 site/…/library.ts• L157-223 site/…/added.json• L1-10

Page and docs data

Tool titles, descriptions, paths, and share-card text come from one page data map. The docs data map gives the docs shell one ordered source for section labels, sidebar links, page navigation, and generated site indexes.

This shared data prevents a route from showing one description in its page head and another in its share image. It also lets navigation change as a product flow instead of as separate page-local lists.

References: site/…/pages.ts• L1-26 site/…/docs.ts• L1-68 site/…/Docs.astro• L15-29

Client-side behavior

The browser layer turns static pages into live browsing surfaces without making the initial render depend on it. It loads art near the viewport, remembers visitor choices, and exposes actions only when the browser can perform them.

Art playback

Each art preview begins with a baked text frame. As it nears the viewport, the page loads that piece and replaces the frame with its live canvas or text playback. This keeps the first page light while preserving motion for the art the visitor is actually viewing.

The shared playback layer respects reduced-motion settings by holding art still. A visible control can override that choice, and a saved ink choice lets supported logos switch between their palette and one ink across pages.

References: site/…/Layout.astro• L367-484 site/…/Art.astro• L16-21 site/…/shown.ts• L1-6

Browsing controls

Search, theme switching, copy actions, usage tabs, and sidebar position are browser enhancements layered onto ordinary links and content. Keyboard users can open search with /, move through tabs with arrow keys, and use the same actions without pointer input.

The page records the currently shown art time so a PNG download matches what the visitor sees. Downloads run in the browser and use the active theme and ink choice rather than a server-side copy of the preview.

References: site/…/Layout.astro• L141-257 site/…/Layout.astro• L284-365 site/…/Layout.astro• L486-535 site/…/Downloads.astro• L27-114 site/…/download.ts• L1-18

The banner page is a URL-backed editor. A visitor changes text and visual choices, the page redraws light and dark previews, and the current choices remain linkable so the result can be shared or reopened.

The editor validates choices, fetches optional library art from the site's SVG routes, and produces matching HTML, Markdown, URL, React, SVG, terminal, CLI, and coding-agent forms. Dynamic snippets start as plain text and gain syntax color when the browser loads the needed language.

References: site/…/banner.astro• L122-269 site/…/banner.astro• L272-523 site/…/banner.ts• L17-167 site/…/banner.ts• L169-307 site/…/paint.ts• L8-25 site/…/[file].ts• L32-69 site/…/svg.ts• L30-47

Image workflow

The image page keeps conversion local to the visitor's browser. It accepts a file, pasted SVG markup, or a pasted image, turns the input into a piece-shaped drawing, and shows the result with controls for name, size, style, motion, category, and background.

The result can leave the page as a source file, a no-build embed, or light and dark README SVGs. The generated piece follows the same shape as the library's identity pieces, so the output can move from an experiment into a project or a future library contribution.

References: site/…/make.astro• L22-149 site/…/make.astro• L309-465 site/…/make.astro• L467-592 site/…/logo.ts• L79-170 site/…/logo-file.ts• L76-287

Change checklist

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

  • Keep library.ts, the category order, and the sidebar search model aligned when piece grouping or names change.
  • Keep Art.astro's server frame and Layout.astro's lazy loader aligned so a preview still has the right dimensions and piece key.
  • Keep Usage.astro, Downloads.astro, and the SVG route aligned when a piece gains or loses a script-free README form.
  • Keep PAGES, tool share-card paths, and the matching page routes aligned when a maker page is renamed.
  • Keep the page title, description, and selected card path aligned when a route's social preview changes.
  • Keep the banner editor's URL query choices aligned with the request-time banner route so shared links reproduce the preview.
  • Keep light and dark asset pairs aligned for sponsor logos, README SVGs, and theme-aware previews.
  • Keep the docs index aligned with Markdown page paths because it also controls page order, navigation, and generated indexes.
  • Keep highlight.ts language names aligned with every server or browser code block that calls it.
  • Keep plain.ts replacements aligned with docs markup so LLM pages describe browser-only content without exposing broken HTML.

Important failure modes

TriggerConsequenceGuard
A piece slug or category changes in only one site data viewCards, sidebar links, lazy loading, or generated SVGs can point to the wrong art or no artTreat library.ts and the package piece name as one route contract.
A baked frame uses dimensions that do not match the loaded pieceThe preview can jump in size when live playback startsKeep the metadata on Art.astro and the loaded piece in agreement.
A logo loses its looping option but its README links remainREADME previews and banner art requests fail or return an unusable assetUse the same loop decision in Usage, Downloads, SVG routes, and banner loading.
A browser cannot record canvas video or encode a downloadThe requested video or GIF cannot be savedHide unsupported video actions and report failed browser work without blocking other page actions.
A shared banner query contains an invalid option or missing artThe preview and request-time SVG can disagree or the SVG route can return an errorParse and validate the query in both the editor and the request route.
A banner update finishes after a newer updateOld art or snippets can replace the visitor's latest choiceApply fetched art and generated output only for the current draw.
A code language is not registered with the shared highlighterA snippet stays uncolored or browser highlighting failsKeep the supported language map and each caller's language value aligned.
A piece-specific Open Graph path is missing or points to an unknown slugShared links show a broken image or the wrong page cardKeep page card props, static card paths, and getStaticPaths() driven by the same library view.
A client asset from an older deploy is restored from cacheLive art modules fail to load and the page can remain staleUse the shared reload path for failed site asset imports.

Key files

FileWhy to read it
site/src/layouts/Layout.astroThe common page shell, social metadata, and shared browser behavior.
site/src/layouts/Docs.astroThe docs-specific navigation and Markdown presentation.
site/src/pages/index.astroThe main discovery and catalogue experience.
site/src/pages/[slug].astroThe complete browse-to-use flow for one piece.
site/…/[slug].png.tsThe route that exposes piece share cards.
site/…/og.tsThe visual source for page and piece share images.
site/src/pages/banner.astroThe interactive banner editor and its generated usage paths.
site/…/banner.tsThe shared banner choices, URL form, and output forms.
site/src/pages/make.astroThe local image-to-piece workflow and output actions.
site/…/library.tsThe shared site view of package art, grouping, recent markers, and usage choices.
site/…/added.jsonThe dates that mark recent pieces in the catalogue.
site/…/docs.ts and site/…/llms.tsThe docs navigation and the machine-readable docs output.
site/…/highlight.ts and site/…/paint.tsThe shared code-coloring path for build-time and changing snippets.
site/…/site.cssThe theme, layout, responsive rules, wells, grids, and reading styles.
site/src/components/Usage.astroThe common adoption surface for piece pages and examples.
site/…/download.tsThe browser download boundary for PNG, video, and GIF output.
site/…/logo.ts and site/…/logo-file.tsThe input-to-piece and piece-to-output boundary used by the image maker.