For the complete documentation index, see llms.txt. Markdown variants are available by appending .md to any URL or sending an Accept: text/markdown header. The asciicn agent skill, for building any ASCII effect on the engine, is at /.well-known/agent-skills/asciicn/SKILL.md.

Mountain dusk

Layered ridgelines fading into evening haze, with a setting sun, a rising moon, stars coming out, the odd shooting star and mist in the valleys.

Controls
Charset
Colour
Phosphor (mono)
Dusk to night0.35
Ridges5
Stars0.7
Mist0.7
Moon
Intensity1
Cell12px
Animate

Installation

pnpm dlx shadcn@latest add https://asciicn.dev/r/mountain-dusk.json

Usage

import { MountainDusk } from "@/components/asciicn/mountain-dusk";
 
export function Hero() {
  return (
    <section className="relative isolate min-h-[480px]">
      <MountainDusk intensity={0.6} className="absolute inset-0 -z-10" />
      <h1>Your headline</h1>
    </section>
  );
}

Ridge after ridge of mountains runs back to the horizon. Each ridgeline is drawn with real line glyphs: / up a slope, \ down the other side, ^ on a sharp peak and _ or - along the flats. Below its crest each ridge falls away into haze, dense near the top and sparse at the foot, so the ridge in front always stands out against the one behind. Far ridges are pale rose, near ones deep violet, and mist drifts in the valleys between them.

time runs the evening. At 0 the sun sits on the far ridge and the sky glows orange into violet. As it rises the sun sinks out of sight, the afterglow fades, the moon climbs on the right and the stars come out, brightest first. From about 0.3 a shooting star crosses once in a while, at most every 18 seconds. Each star is a single sample, so it stays one crisp glyph, or one Braille dot.

The mountains stand still. Only the sky moves: stars twinkle slowly, mist drifts through the valleys and the odd shooting star crosses. The scene does not react to hover or the pointer.

It draws in standard glyphs and truecolor by default. The charset sets the glyphs for the haze, sky, sun, moon and mist. With a ramp charset the ridgelines are drawn as line glyphs on top; braille and quadrants draw them from their own sub-cell dots instead. In mono mode every glyph takes the ink, or a phosphor. intensity thins every glyph at once. Lower it to around 0.5 under a headline.

Examples

Behind a headline

intensity={0.55} and time={0.6} put the scene in the blue hour, quiet enough for the headline to read first.

Night in Braille

charset="braille" with time={1} and stars={1}: the moon high, the sky full of single-dot stars, six ridges and heavy mist.

Props

PropTypeDefault
time

Where the evening is, from 0 (the sun setting) to 1 (full night, moon high).

Type: numberDefault 0.35
layers

How many ridgelines stand before the horizon, 1 to 6. Fewer ridges drop the far ones first.

Type: numberDefault 5
stars

How many stars come out, from 0 (none, and no shooting stars) to 1.

Type: numberDefault 0.7
mist

How much mist lies in the valleys, from 0 to 1.

Type: numberDefault 0.7
moon

Show the rising moon.

Type: booleanDefault true
intensity

How much of the scene shows, from 0 (empty paper) to 1. Lower it under text.

Type: numberDefault 1
charset

Which glyphs draw the haze, sky and mist. See Charsets. Ramps also get line-glyph ridgelines.

Type: CharsetNameDefault "standard"
chars

A custom ramp from empty to dense, such as " .oO@". Wins over charset.

Type: stringDefault –
colorMode

truecolor keeps the sky's colours. mono draws every glyph in the ink or phosphor.

Type: "truecolor" | "mono"Default "truecolor", or "mono" with a phosphor
phosphor

A CRT ink and glass that replace the ink and paper.

Type: "p1" | "p3" | "ibm" | "blueprint"Default –
background

"transparent" draws the glyphs only, over your own surface.

Type: "paper" | "transparent"Default "paper"
fx

CRT finish: scanlines, bloom, curvature, glitch, flicker and vignette, each 0 to 1.

Type: PostFxDefault –
cell

Height of one glyph cell in CSS pixels.

Type: numberDefault 12
speed

How fast the mist drifts and the stars twinkle.

Type: numberDefault 1
animate

false holds one still frame.

Type: booleanDefault true
stillTime

The moment drawn when motion is off or reduced, in seconds.

Type: numberDefault 14
handle

Filled with a handle that reads back the current frame, for export to text, ANSI, SVG or PNG.

Type: RefObject<AsciiHandle | null>Default –
className

Size and position. The scene fills this box.

Type: stringDefault –

Notes

  • It is decorative and hidden from assistive technology. Put real text on top of it, not inside it.
  • It ignores the pointer, so moving the mouse over it changes nothing.
  • With reduced motion turned on, it draws one still frame at stillTime and stops.
  • It draws on the CPU at up to 30 fps and pauses when scrolled out of view or when the tab is hidden. Each ridge's crest is worked out once per column, not per sample, so braille, which samples eight times per cell, costs mostly the sky and mist.