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 ¶
- Variables
- func Names() []string
- func Static(a Art, p Palette) []string
- func StaticIn(a Art, s Stage, p Palette) []string
- type Art
- type BayerDither
- type CRTPowerOn
- type CopperPlasma
- type DoomFire
- type Effect
- type LaserEtch
- type MatrixRain
- type OutrunGrid
- type Palette
- type PixelDrop
- type ShatterRewind
- type SlitScan
- type Stage
- type StarfieldWarp
- type VHSTracking
Constants ¶
This section is empty.
Variables ¶
var DefaultCRT = CRTPowerOn{}
DefaultCRT is the standard CRTPowerOn instance.
var DefaultDither = BayerDither{}
DefaultDither is the standard BayerDither instance.
var DefaultDrop = PixelDrop{}
DefaultDrop is the standard PixelDrop instance.
var DefaultFire = DoomFire{}
DefaultFire is the standard DoomFire instance.
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.
var DefaultMatrix = MatrixRain{}
DefaultMatrix is the standard MatrixRain instance.
var DefaultOutrun = OutrunGrid{}
DefaultOutrun is the standard OutrunGrid instance.
var DefaultPlasma = CopperPlasma{}
DefaultPlasma is the standard CopperPlasma instance.
var DefaultShatter = ShatterRewind{}
DefaultShatter is the standard ShatterRewind instance.
var DefaultSlitScan = SlitScan{}
DefaultSlitScan is the standard SlitScan instance.
var DefaultVHS = VHSTracking{}
DefaultVHS is the standard VHSTracking instance.
var DefaultWarp = StarfieldWarp{}
DefaultWarp is the standard StarfieldWarp instance.
Functions ¶
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 ¶
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 (Art) At ¶
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.
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.
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.
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.
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.
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.
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 ¶
Duration implements Effect: the last column is revealed at Sweep and settled Cool later.
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.
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.
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.
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.
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.
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.
type Stage ¶
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 ¶
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.
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.