splash

package
v1.0.0-rc.16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package splash is the opening screen: a piece of pixel art and an Effect that draws it over a full-viewport Stage, the way Omarchy plays Terminal Text Effects over its logo. Art and effect are separate seams on purpose (ADR 0005): a new logo is a new Art, a new animation is a new Effect, and neither knows the theme beyond a Palette of roles.

Pixels are drawn two per terminal row with dual-color half-block glyphs (▀ ▄ █), giving independent color per pixel at square 1:2 proportions on any monospace font. Twelve built-in 80s/90s effects are registered in All.

Index

Constants

This section is empty.

Variables

View Source
var DefaultCRT = CRTPowerOn{}

DefaultCRT is the standard CRTPowerOn instance.

View Source
var DefaultDither = BayerDither{}

DefaultDither is the standard BayerDither instance.

View Source
var DefaultDrop = PixelDrop{}

DefaultDrop is the standard PixelDrop instance.

View Source
var DefaultFire = DoomFire{}

DefaultFire is the standard DoomFire instance.

View Source
var DefaultLaser = LaserEtch{
	Sweep: 1100 * time.Millisecond,
	Cool:  450 * time.Millisecond,
}

DefaultLaser is the tuning the UI uses: about a second and a half in total, long enough to read as a reveal and short enough that nobody reaches for the skip key.

View Source
var DefaultMatrix = MatrixRain{}

DefaultMatrix is the standard MatrixRain instance.

View Source
var DefaultOutrun = OutrunGrid{}

DefaultOutrun is the standard OutrunGrid instance.

View Source
var DefaultPlasma = CopperPlasma{}

DefaultPlasma is the standard CopperPlasma instance.

View Source
var DefaultShatter = ShatterRewind{}

DefaultShatter is the standard ShatterRewind instance.

View Source
var DefaultSlitScan = SlitScan{}

DefaultSlitScan is the standard SlitScan instance.

View Source
var DefaultVHS = VHSTracking{}

DefaultVHS is the standard VHSTracking instance.

View Source
var DefaultWarp = StarfieldWarp{}

DefaultWarp is the standard StarfieldWarp instance.

Functions

func Names

func Names() []string

Names returns the sorted names of every built-in splash effect.

func Static

func Static(a Art, p Palette) []string

Static is the art fully drawn in Ink on a tight stage, the frame every effect ends on when tight.

func StaticIn

func StaticIn(a Art, s Stage, p Palette) []string

StaticIn is the art fully drawn in Ink anchored at (s.ArtX, 2*s.ArtRow) inside s, the frame every effect ends on.

Types

type Art

type Art struct {
	W, H int
	// contains filtered or unexported fields
}

Art is a monochrome bitmap, row-major, origin top-left. It is a value: Scale returns a new one and never mutates the receiver.

func Fit

func Fit(a Art, w, h int) (Art, bool)

Fit returns the art at the largest scale that fits w columns by h rows, and false when it does not fit even at scale 1, which is the signal to skip the splash rather than clip it.

func Wordmark

func Wordmark() Art

Wordmark is the "NG CHAT" mark at scale 1: 38×7 pixels, 4 rows.

func (Art) At

func (a Art) At(x, y int) bool

At reports whether pixel (x, y) is lit. Out-of-range is unlit, so callers can read the odd last pixel row of an odd-height bitmap.

func (Art) Rows

func (a Art) Rows() int

Rows is the terminal rows the art needs: two pixel rows per cell.

func (Art) Scale

func (a Art) Scale(n int) Art

Scale enlarges every pixel to an n×n block. n < 1 is treated as 1.

type BayerDither

type BayerDither struct{}

BayerDither dissolves the wordmark in via a classic 4×4 ordered Bayer matrix while stepping newly lit pixels through a 5-stop VGA palette cycle and finishing with a diagonal metallic sheen.

func (BayerDither) Duration

func (BayerDither) Duration() time.Duration

Duration implements Effect.

func (BayerDither) Frame

func (BayerDither) Frame(a Art, s Stage, p Palette, t time.Duration) []string

Frame implements Effect.

func (BayerDither) Name

func (BayerDither) Name() string

Name implements Effect.

type CRTPowerOn

type CRTPowerOn struct{}

CRTPowerOn snaps open as a bright horizontal cathode line, expands vertically with scanlines, triggers a damped degauss coil wave with RGB chromatic fringe, and locks crisp into Ink.

func (CRTPowerOn) Duration

func (CRTPowerOn) Duration() time.Duration

Duration implements Effect.

func (CRTPowerOn) Frame

func (CRTPowerOn) Frame(a Art, s Stage, p Palette, t time.Duration) []string

Frame implements Effect.

func (CRTPowerOn) Name

func (CRTPowerOn) Name() string

Name implements Effect.

type CopperPlasma

type CopperPlasma struct{}

CopperPlasma runs an Amiga/C64 sine-wave plasma shader across the wordmark silhouette as a diagonal wave front reveals it, then smoothly crossfades the swirling plasma into Ink.

func (CopperPlasma) Duration

func (CopperPlasma) Duration() time.Duration

Duration implements Effect.

func (CopperPlasma) Frame

func (CopperPlasma) Frame(a Art, s Stage, p Palette, t time.Duration) []string

Frame implements Effect.

func (CopperPlasma) Name

func (CopperPlasma) Name() string

Name implements Effect.

type DoomFire

type DoomFire struct{}

DoomFire forges the wordmark out of an advected procedural pixel flame rising from the base of the logo, dying cleanly down to Ink.

func (DoomFire) Duration

func (DoomFire) Duration() time.Duration

Duration implements Effect.

func (DoomFire) Frame

func (DoomFire) Frame(a Art, s Stage, p Palette, t time.Duration) []string

Frame implements Effect.

func (DoomFire) Name

func (DoomFire) Name() string

Name implements Effect.

type Effect

type Effect interface {
	// Name identifies the effect in help text and CLI flags.
	Name() string
	// Duration is when Frame stops changing; Frame at or past it must
	// equal StaticIn.
	Duration() time.Duration
	// Frame renders the art at elapsed time t: exactly s.Rows lines,
	// each s.W cells wide, ANSI-styled.
	Frame(a Art, s Stage, p Palette, t time.Duration) []string
}

Effect animates an Art. Frame is a pure function of t, so the UI can call it at whatever rate it likes and a test can pin any instant.

func All

func All() []Effect

All returns a fresh slice of every built-in splash effect, sorted by Name.

func Lookup

func Lookup(name string) (Effect, bool)

Lookup returns the built-in effect with the given name, matched case-insensitively with surrounding whitespace trimmed.

func Random

func Random() Effect

Random returns one built-in splash effect chosen uniformly at random.

type LaserEtch

type LaserEtch struct {
	// Sweep is how long the beam takes to cross the art.
	Sweep time.Duration
	// Cool is how long a pixel takes to settle from Hot to Ink.
	Cool time.Duration
}

LaserEtch sweeps a beam left to right; pixels ignite white-hot as it passes, cool through warm to ink behind it, and a few sparks fly ahead of the beam. In full-stage mode an angled beam fires down from the top-right emitter and sheds cooling embers with gravity.

Timing is fixed rather than per-column so a wider terminal (a larger scale) does not make the splash slower: the beam always crosses in Sweep, and Duration is the same for every terminal.

func (LaserEtch) Duration

func (l LaserEtch) Duration() time.Duration

Duration implements Effect: the last column is revealed at Sweep and settled Cool later.

func (LaserEtch) Frame

func (l LaserEtch) Frame(a Art, s Stage, p Palette, t time.Duration) []string

Frame implements Effect.

func (LaserEtch) Name

func (LaserEtch) Name() string

Name implements Effect.

type MatrixRain

type MatrixRain struct{}

MatrixRain drops deterministic columns of 1-width ASCII/hex digital rain across the stage; wherever a drop crosses a lit wordmark pixel, that pixel crystallizes into a solid block cooling Hot -> Phosphor -> Ink.

func (MatrixRain) Duration

func (MatrixRain) Duration() time.Duration

Duration implements Effect.

func (MatrixRain) Frame

func (MatrixRain) Frame(a Art, s Stage, p Palette, t time.Duration) []string

Frame implements Effect.

func (MatrixRain) Name

func (MatrixRain) Name() string

Name implements Effect.

type OutrunGrid

type OutrunGrid struct{}

OutrunGrid scrolls an 80s synthwave perspective wireframe floor beneath the wordmark while a Venetian-blind retro sunset slice reveal builds the letters from bottom to top.

func (OutrunGrid) Duration

func (OutrunGrid) Duration() time.Duration

Duration implements Effect.

func (OutrunGrid) Frame

func (OutrunGrid) Frame(a Art, s Stage, p Palette, t time.Duration) []string

Frame implements Effect.

func (OutrunGrid) Name

func (OutrunGrid) Name() string

Name implements Effect.

type Palette

type Palette struct {
	// Ink is the color the art settles on.
	Ink color.Color
	// Hot is the brightest color, used for flashes and peaks.
	Hot color.Color
	// Warm sits between Hot and Ink while a pixel cools.
	Warm color.Color
	// Spark is for debris, RGB red/magenta channels, and fire bases.
	Spark color.Color
	// Cool carries cyan/blue channels, plasma contrast, and horizons.
	Cool color.Color
	// Phosphor is CRT/Matrix green.
	Phosphor color.Color
	// Dim is a subdued secondary tone for grids and trails.
	Dim color.Color
	// Bg is the theme base color used strictly as a fade-out target for
	// foreground particles, never painted as a full-screen background.
	Bg color.Color
}

Palette is the handful of roles an effect paints with, so an effect is written once against roles and every theme lights it its own way.

func FromTheme

func FromTheme(t theme.Theme) Palette

FromTheme maps theme roles onto the palette.

type PixelDrop

type PixelDrop struct{}

PixelDrop rains wordmark pixels down from the top under gravity, stacking bottom-row-first with a damped arcade bounce and sparks.

func (PixelDrop) Duration

func (PixelDrop) Duration() time.Duration

Duration implements Effect.

func (PixelDrop) Frame

func (PixelDrop) Frame(a Art, s Stage, p Palette, t time.Duration) []string

Frame implements Effect.

func (PixelDrop) Name

func (PixelDrop) Name() string

Name implements Effect.

type ShatterRewind

type ShatterRewind struct{}

ShatterRewind opens with a bright center flash, then rewinds scattered pixels across the viewport along curved swirl arcs into the wordmark.

func (ShatterRewind) Duration

func (ShatterRewind) Duration() time.Duration

Duration implements Effect.

func (ShatterRewind) Frame

func (ShatterRewind) Frame(a Art, s Stage, p Palette, t time.Duration) []string

Frame implements Effect.

func (ShatterRewind) Name

func (ShatterRewind) Name() string

Name implements Effect.

type SlitScan

type SlitScan struct{}

SlitScan interlocks alternating pixel scanlines from opposite sides of the stage, leaving glowing horizontal motion trails before a metallic sheen sweeps across the locked logo.

func (SlitScan) Duration

func (SlitScan) Duration() time.Duration

Duration implements Effect.

func (SlitScan) Frame

func (SlitScan) Frame(a Art, s Stage, p Palette, t time.Duration) []string

Frame implements Effect.

func (SlitScan) Name

func (SlitScan) Name() string

Name implements Effect.

type Stage

type Stage struct {
	W, Rows      int
	ArtX, ArtRow int
}

Stage describes the terminal region an effect draws into and where the wordmark lands inside it. W and Rows are terminal cell counts; ArtX and ArtRow locate the wordmark's top-left cell inside the stage. Pixel coordinates span [0, W) × [0, 2*Rows), with the wordmark anchored at (ArtX, 2*ArtRow).

func TightStage

func TightStage(a Art) Stage

TightStage returns a stage sized tightly to a, used where the wordmark sits above another widget (such as the login form).

type StarfieldWarp

type StarfieldWarp struct{}

StarfieldWarp rushes a 3D starfield outward from the center while the wordmark's own pixels curve inward from warp space and lock into place with a radial shockwave flash.

func (StarfieldWarp) Duration

func (StarfieldWarp) Duration() time.Duration

Duration implements Effect.

func (StarfieldWarp) Frame

func (StarfieldWarp) Frame(a Art, s Stage, p Palette, t time.Duration) []string

Frame implements Effect.

func (StarfieldWarp) Name

func (StarfieldWarp) Name() string

Name implements Effect.

type VHSTracking

type VHSTracking struct{}

VHSTracking slices the wordmark into jittering horizontal tape bands with RGB chroma bleed and rolling snow/static tracking bars that lock cleanly in two stutters.

func (VHSTracking) Duration

func (VHSTracking) Duration() time.Duration

Duration implements Effect.

func (VHSTracking) Frame

func (VHSTracking) Frame(a Art, s Stage, p Palette, t time.Duration) []string

Frame implements Effect.

func (VHSTracking) Name

func (VHSTracking) Name() string

Name implements Effect.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL