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 ¶
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 ¶
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 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 ¶
Duration implements Effect: the last column is revealed at Sweep and settled Cool later.
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.