splash

package
v1.0.0-rc.4 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: MIT Imports: 5 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 in over time, the way Omarchy plays one Terminal Text Effects run 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 the half-block glyphs (▀ ▄ █), which makes a pixel square on the usual 1:2 cell and gives the wordmark its pixelated look on any monospace font.

Index

Constants

This section is empty.

Variables

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.

Functions

func Static

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

Static is the art fully drawn in Ink, 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 Effect

type Effect interface {
	// Name identifies the effect in help text and future settings.
	Name() string
	// Duration is when Frame stops changing; Frame at or past it must
	// equal Static.
	Duration() time.Duration
	// Frame renders the art at elapsed time t: exactly a.Rows() lines,
	// each a.W cells wide, ANSI-styled.
	Frame(a Art, 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.

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. It is a port in spirit of Terminal Text Effects' laseretch, the effect omarchy.org plays over its mark.

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, p Palette, t time.Duration) []string

Frame implements Effect.

func (LaserEtch) Name

func (LaserEtch) 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 the instant a pixel appears.
	Hot color.Color
	// Warm sits between Hot and Ink while a pixel cools.
	Warm color.Color
	// Spark is for debris the effect throws off; it never lands on art.
	Spark 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: the wordmark settles on primary, flashes in as body text, cools through warning gold, and throws accent sparks.

Jump to

Keyboard shortcuts

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