Documentation
¶
Overview ¶
Package borderfx provides animated border effects for Termdash containers.
Tier 1 — Profiles (simplest) ¶
Profiles are fully pre-configured effects: colors, tick rate, and inactive style all baked in. One call wires everything:
fx := borderfx.NewAnimator(cont) fx.ApplyProfile(borderfx.Profiles.GradientArc, "root", "sidebar", "chart") go fx.Run(ctx)
Built-in profiles:
GradientArc – purple→lavender→blue arc sweeping clockwise LoadingSweepWhite – white highlight scanning across the border title FuturisticSweep – braille interlaced scanner in bright cyan NeonPulse – magenta neon-sign flicker AmberTelemetry – amber tick telemetry (professional ops look)
Tier 2 — Macro + Palette (intermediate) ¶
For fine-grained color control, combine a Macro with a Palette:
fx.RegisterMacro("sensors", borderfx.Presets.Orbit, borderfx.Palettes.Cyan)
Tier 3 — Raw Effect (advanced) ¶
For maximum flexibility, build and register an Effect directly:
fx.Register("sensors", borderfx.GradientArcN(stops, dim, 0.45))
Index ¶
- Variables
- type Animator
- func (a *Animator) ApplyProfile(p Profile, ids ...string)
- func (a *Animator) Register(id string, e *Effect)
- func (a *Animator) RegisterMacro(id string, m Macro, p Palette)
- func (a *Animator) Run(ctx context.Context) error
- func (a *Animator) SetAlwaysActive(v bool)
- func (a *Animator) SetInactiveStyle(styler func(id string, bc container.BorderCell) container.BorderCellStyle)
- func (a *Animator) SetTickRate(d time.Duration)
- func (a *Animator) Unregister(id string)
- type DecryptCharsetGroup
- type Effect
- func BracketScan(bright, mid, dim cell.Color) *Effect
- func BraidedScanner(bright, mid, dim cell.Color) *Effect
- func BrailleDrift(bright, mid, dim cell.Color) *Effect
- func ColorScanner(bright, dim cell.Color) *Effect
- func Cycle(colors []cell.Color) *Effect
- func DataTicks(bright, mid, dim cell.Color) *Effect
- func Dots6Spinner(bright, mid, dim cell.Color) *Effect
- func Dots10Spinner(bright, mid, dim cell.Color) *Effect
- func DualColorScanner(bright, mid, dim cell.Color) *Effect
- func DualGradientArc(colorA, colorB, dim cell.Color, arcFraction float64) *Effect
- func DualScanner(bright, mid, dim cell.Color) *Effect
- func Fire() *Effect
- func FocusBrace(bright, mid, dim cell.Color) *Effect
- func FocusMatrix(bright, mid, dim cell.Color) *Effect
- func FocusPins(bright, mid, dim cell.Color) *Effect
- func FocusPinsBrace(bright, mid, dim cell.Color) *Effect
- func FocusPinsEmoji(bright, mid, dim cell.Color) *Effect
- func FocusPinsMatrix(bright, mid, dim cell.Color) *Effect
- func FocusPinsPower(bright, mid, dim cell.Color) *Effect
- func FocusPinsPulse(bright, mid, dim cell.Color) *Effect
- func FocusPinsRail(bright, mid, dim cell.Color) *Effect
- func FocusPinsRibbon(bright, mid, dim cell.Color) *Effect
- func FocusPinsShard(bright, mid, dim cell.Color) *Effect
- func FocusRail(bright, mid, dim cell.Color) *Effect
- func FocusRibbon(bright, mid, dim cell.Color) *Effect
- func Glow(c cell.Color) *Effect
- func GradientArc(colorA, colorB, dim cell.Color, arcFraction float64) *Effect
- func GradientArcN(stops []cell.Color, dim cell.Color, arcFraction float64) *Effect
- func Ice() *Effect
- func InterlacedScanner(bright, mid, dim cell.Color) *Effect
- func Matrix() *Effect
- func Neon(bright cell.Color) *Effect
- func OrbitScanner(bright, mid, dim cell.Color) *Effect
- func Pulse(a, b cell.Color) *Effect
- func RainScanner(bright, mid, dim cell.Color) *Effect
- func Rainbow() *Effect
- func Scanner(bright, dim cell.Color) *Effect
- func ShardScanner(bright, mid, dim cell.Color) *Effect
- func SpinnerPulse(bright, mid, dim cell.Color) *Effect
- func StaticNoise(bright, mid, dim cell.Color) *Effect
- func Synthwave() *Effect
- func TextSweep(sweepColor, restColor cell.Color) *Effect
- func TextSweepWidth(sweepColor, restColor cell.Color, windowWidth, speed int) *Effect
- func Warp() *Effect
- type LoadingBackground
- type LoadingBackgroundOption
- type LoadingOverlay
- type Macro
- type Palette
- type PanelRectFunc
- type Profile
- type TitleSpec
- func (s TitleSpec) Decorated(step int) string
- func (s TitleSpec) HasSpinners() bool
- func (s TitleSpec) Plain() string
- func (s TitleSpec) Scrambled(reveal int) string
- func (s TitleSpec) WithLeftSpinner(spinner spin.Spinner) TitleSpec
- func (s TitleSpec) WithRightSpinner(spinner spin.Spinner) TitleSpec
- type TitleSpinnerPlacement
Constants ¶
This section is empty.
Variables ¶
var DecryptCharsets = DecryptCharsetGroup{
WarpCoreFlux: "01$#*+-",
LCARSTelemetry: "><=|/-",
Comms: "[]{}:;?",
Controls: ".,:*~^",
Default: "⠿⣾⣶⣤⣀⠒",
Sensors: "⠿⣾⣶⣤⣀⠒",
}
DecryptCharsets exposes reusable title-reveal character groups for the borderfx user API. The intended call site is:
borderfx.DecryptingTitle(" Comms ", borderfx.DecryptCharsets.Comms)
so callers can choose a named reveal set without hand-copying character sequences into their own widget setup code.
var Palettes = struct { Cyan Palette Amber Palette Matrix Palette Synthwave Palette Ice Palette Silver Palette }{ Cyan: Colors(cell.ColorNumber(51), cell.ColorNumber(24), cell.ColorNumber(236)), Amber: Colors(cell.ColorNumber(214), cell.ColorNumber(136), cell.ColorNumber(236)), Matrix: Colors(cell.ColorNumber(123), cell.ColorNumber(39), cell.ColorNumber(236)), Synthwave: Colors(cell.ColorNumber(201), cell.ColorNumber(90), cell.ColorNumber(236)), Ice: Colors(cell.ColorNumber(220), cell.ColorNumber(178), cell.ColorNumber(236)), Silver: Duo(cell.ColorNumber(250), cell.ColorNumber(239)), }
Palettes exposes a few ready-made color palettes for common borderfx looks.
var Presets = struct { Scanner Macro Dual Macro Interlace Macro Braided Macro Shard Macro Orbit Macro Focus Macro Rail Macro Decode Macro Power Macro Rain Macro Braille Macro Bracket Macro Ticks Macro Noise Macro SpinPulse Macro Dots6 Macro Dots10 Macro Ribbon Macro Brace Macro Emoji Macro Pulse Macro Fire Macro Ice Macro Rainbow Macro Neon Macro Matrix Macro Glow Macro Warp Macro TextSweep Macro GradArc Macro // single gradient arc sweeping clockwise; uses Palette.Bright→Mid, dim background DualGradArc Macro // two opposing gradient arcs; uses Palette.Bright vs Palette.Mid }{ Scanner: newMacro("scanner", func(p Palette) *Effect { return Scanner(p.Bright, p.Dim) }), Dual: newMacro("dual", func(p Palette) *Effect { return DualScanner(p.Bright, p.Mid, p.Dim) }), Interlace: newMacro("interlace", func(p Palette) *Effect { return InterlacedScanner(p.Bright, p.Mid, p.Dim) }), Braided: newMacro("braided", func(p Palette) *Effect { return BraidedScanner(p.Bright, p.Mid, p.Dim) }), Shard: newMacro("shard", func(p Palette) *Effect { return ShardScanner(p.Bright, p.Mid, p.Dim) }), Orbit: newMacro("orbit", func(p Palette) *Effect { return OrbitScanner(p.Bright, p.Mid, p.Dim) }), Focus: newMacro("focus", func(p Palette) *Effect { return FocusPins(p.Bright, p.Mid, p.Dim) }), Rail: newMacro("rail", func(p Palette) *Effect { return FocusPinsRail(p.Bright, p.Mid, p.Dim) }), Decode: newMacro("decode", func(p Palette) *Effect { return FocusPinsMatrix(p.Bright, p.Mid, p.Dim) }), Power: newMacro("power", func(p Palette) *Effect { return FocusPinsPower(p.Bright, p.Mid, p.Dim) }), Rain: newMacro("rain", func(p Palette) *Effect { return RainScanner(p.Bright, p.Mid, p.Dim) }), Braille: newMacro("braille", func(p Palette) *Effect { return BrailleDrift(p.Bright, p.Mid, p.Dim) }), Bracket: newMacro("bracket", func(p Palette) *Effect { return BracketScan(p.Bright, p.Mid, p.Dim) }), Ticks: newMacro("ticks", func(p Palette) *Effect { return DataTicks(p.Bright, p.Mid, p.Dim) }), Noise: newMacro("noise", func(p Palette) *Effect { return StaticNoise(p.Bright, p.Mid, p.Dim) }), SpinPulse: newMacro("spin_pulse", func(p Palette) *Effect { return SpinnerPulse(p.Bright, p.Mid, p.Dim) }), Dots6: newMacro("dots6", func(p Palette) *Effect { return Dots6Spinner(p.Bright, p.Mid, p.Dim) }), Dots10: newMacro("dots10", func(p Palette) *Effect { return Dots10Spinner(p.Bright, p.Mid, p.Dim) }), Ribbon: newMacro("ribbon", func(p Palette) *Effect { return FocusPinsRibbon(p.Bright, p.Mid, p.Dim) }), Brace: newMacro("brace", func(p Palette) *Effect { return FocusPinsBrace(p.Bright, p.Mid, p.Dim) }), Emoji: newMacro("emoji", func(p Palette) *Effect { return FocusPinsEmoji(p.Bright, p.Mid, p.Dim) }), Pulse: newMacro("pulse", func(p Palette) *Effect { return FocusPinsPulse(p.Bright, p.Mid, p.Dim) }), Fire: newMacro("fire", func(Palette) *Effect { return Fire() }), Ice: newMacro("ice", func(Palette) *Effect { return Ice() }), Rainbow: newMacro("rainbow", func(Palette) *Effect { return Rainbow() }), Neon: newMacro("neon", func(p Palette) *Effect { return Neon(p.Bright) }), Matrix: newMacro("matrix", func(Palette) *Effect { return Matrix() }), Glow: newMacro("glow", func(p Palette) *Effect { return Glow(p.Bright) }), Warp: newMacro("warp", func(Palette) *Effect { return Warp() }), TextSweep: newMacro("text_sweep", func(p Palette) *Effect { return TextSweep(cell.ColorWhite, cell.ColorNumber(245)) }), GradArc: newMacro("grad_arc", func(p Palette) *Effect { return GradientArc(p.Bright, p.Mid, p.Dim, 0.35) }), DualGradArc: newMacro("dual_grad_arc", func(p Palette) *Effect { return DualGradientArc(p.Bright, p.Mid, p.Dim, 0.35) }), }
Presets exposes the package's high-level reusable animation presets.
var Profiles = struct { // GradientArc sweeps a purple→lavender→blue→purple gradient arc clockwise. // The focused panel animates; inactive panels show a warm-gold static border. // // Origin: extracted from the ops-dashboard timeline demo (timelinedemo.go). // // Recommended for: general-purpose dashboards, ops panels, any widget where // you want a premium animated border with a clear focus indicator. GradientArc Profile // LoadingSweepWhite sweeps a bright-white highlight across the border title // text, leaving non-title cells in near-black. Creates a clean "loading" or // "scanning" feel. // // Origin: extracted from the ThreeD tab of the tabdemo (tabdemo.go). // // Recommended for: panels that boot/load data, 3-D / render stages, any // widget whose title text deserves a spotlight moment. LoadingSweepWhite Profile // FuturisticSweep runs a multi-lane braille interlaced scanner in bright cyan. // Dense and high-energy — the border looks like live signal telemetry. // // Origin: extracted from the Spectrum Analyzer pane of the tabdemo. // // Recommended for: signal visualization, sensor feeds, spectrum analyzers, // any high-frequency data panel. FuturisticSweep Profile // NeonPulse flickers a magenta neon-sign effect around the full border. // Occasional dark frames mimic the gas-discharge instability of a real tube. // // Recommended for: alert panels, critical-status widgets, notification areas, // anything that should draw the eye immediately. NeonPulse Profile // AmberTelemetry sweeps measured block ticks in amber/gold across the border. // Clean and readable — a professional ops look inspired by hardware consoles. // // Recommended for: production dashboards, metrics panels, timeline widgets, // anywhere you want animation that doesn't distract from the data. AmberTelemetry Profile }{ GradientArc: Profile{ // contains filtered or unexported fields }, LoadingSweepWhite: Profile{ // contains filtered or unexported fields }, FuturisticSweep: Profile{ // contains filtered or unexported fields }, NeonPulse: Profile{ // contains filtered or unexported fields }, AmberTelemetry: Profile{ // contains filtered or unexported fields }, }
Profiles contains named, fully pre-configured border effect profiles. Each profile bundles an effect, color scheme, tick rate, and inactive style into a single value you can apply in one call.
All five built-in profiles are described below. For the full catalogue of lower-level effects and palette primitives see Presets and Palettes.
Profile Visual character ────────────────── ───────────────────────────────────────────────────── GradientArc Purple→lavender→blue→purple arc sweeping clockwise LoadingSweepWhite White highlight scanning across the border title text FuturisticSweep Braille-interlaced multi-lane scanner in bright cyan NeonPulse Magenta neon-sign flicker with occasional dark frames AmberTelemetry Amber measured-tick telemetry sweep (ops-dashboard look)
var TitleCharsets = DecryptCharsets
TitleCharsets is a compatibility alias for older code that started using the earlier grouped charset name before DecryptCharsets became the preferred public entry point.
Functions ¶
This section is empty.
Types ¶
type Animator ¶
type Animator struct {
// contains filtered or unexported fields
}
Animator drives border animations on containers by ID.
func NewAnimator ¶
NewAnimator creates an animator bound to the root container.
func (*Animator) ApplyProfile ¶
ApplyProfile configures the animator from a pre-baked Profile in one call. It sets the tick rate to the profile's recommended value, registers a fresh Effect instance for each supplied container ID, and wires up the inactive style so unfocused panels show the profile's recommended resting color.
Each ID receives its own independent Effect so animation phases never lock together — a panel's arc position is not shared with its neighbours.
Example:
fx := borderfx.NewAnimator(cont) fx.ApplyProfile(borderfx.Profiles.GradientArc, "root", "sidebar", "chart") go fx.Run(ctx)
func (*Animator) Register ¶
Register assigns an effect to a container ID. Replaces any existing effect.
func (*Animator) RegisterMacro ¶
RegisterMacro applies a high-level macro preset to a container ID.
func (*Animator) Run ¶
Run starts the animation loop. Blocks until ctx is done.
A single ticker is created once and reused for the lifetime of the loop. The previous pattern of creating a new ticker on every iteration caused the effective tick interval to be 64ms + tick_duration instead of a steady 64ms, making the animation speed vary with system load (e.g. faster when the mouse was moving because tick() completed sooner). A persistent ticker fires on a wall-clock schedule regardless of how long tick() takes.
func (*Animator) SetAlwaysActive ¶
SetAlwaysActive makes every registered effect animate at full brightness on every tick, regardless of which container is focused. When false (default), only the focused container's effect plays; others receive the inactive style or are cleared.
func (*Animator) SetInactiveStyle ¶
func (a *Animator) SetInactiveStyle(styler func(id string, bc container.BorderCell) container.BorderCellStyle)
SetInactiveStyle sets a styler applied to unfocused registered windows.
func (*Animator) SetTickRate ¶
SetTickRate sets the animation tick interval. Must be called before Run(); changes made after Run() has started have no effect.
func (*Animator) Unregister ¶
Unregister removes animation from a container ID.
type DecryptCharsetGroup ¶
type DecryptCharsetGroup struct {
WarpCoreFlux string
LCARSTelemetry string
Comms string
Controls string
Default string
Sensors string
}
DecryptCharsetGroup groups the common scramble/decrypt character sets used by borderfx title reveal effects.
type Effect ¶
type Effect struct {
// contains filtered or unexported fields
}
Effect holds one animated border treatment.
func BracketScan ¶
BracketScan runs restrained bracket-like ticks that sweep along the rails.
func BraidedScanner ¶
BraidedScanner runs two luminous tracers with a softer, more segmented tail.
func BrailleDrift ¶
BrailleDrift runs a continuous shaded-block spinner around the border.
func ColorScanner ¶
ColorScanner simulates a scanning beam travelling clockwise around the border using only color changes — the original box-drawing rune characters are never replaced. This matches a CSS conic-gradient rotation effect.
func Dots6Spinner ¶
Dots6Spinner runs the spinner2 dots_6 frames across the border.
func Dots10Spinner ¶
Dots10Spinner runs the spinner2 dots_10 frames across the border.
func DualColorScanner ¶
DualColorScanner runs two color beams in opposite directions around the border, preserving all original rune characters. Gives the rotating conic-gradient illusion of the HTML demo preview.
func DualGradientArc ¶
DualGradientArc runs two gradient arcs simultaneously: one sweeping clockwise lit with colorA, one counter-clockwise lit with colorB. Where arcs overlap the brighter cell (closest to its head) wins. Cells outside both arcs receive dim. arcFraction is clamped to [0.05, 0.95].
func DualScanner ¶
DualScanner runs two beams in opposite directions for a denser sci-fi trace.
func FocusBrace ¶
FocusBrace performs a vertical brace sweep, then parks on the side rails.
func FocusMatrix ¶
FocusMatrix performs a decode-style sweep, then parks as matrix glyph locks.
func FocusPinsBrace ¶
FocusPinsBrace uses brace-like side rails during activation.
func FocusPinsEmoji ¶
FocusPinsEmoji uses symbol-heavy sweeps and energized corner pins.
func FocusPinsMatrix ¶
FocusPinsMatrix uses denser decode-like blocks during activation.
func FocusPinsPower ¶
FocusPinsPower uses electrical glyphs and a sine-wave sweep before pinning corners.
func FocusPinsPulse ¶
FocusPinsPulse uses softer round markers during activation.
func FocusPinsRail ¶
FocusPinsRail uses heavier rail blocks during activation before pinning corners.
func FocusPinsRibbon ¶
FocusPinsRibbon uses diamond ribbons during activation.
func FocusPinsShard ¶
FocusPinsShard uses compact shard markers during activation.
func FocusRail ¶
FocusRail performs a brief dual-rail activation sweep, then parks as top-edge markers.
func FocusRibbon ¶
FocusRibbon performs a braided sweep, then parks as a centered ribbon.
func GradientArc ¶
GradientArc renders a single arc of arcFraction of the total border length that sweeps clockwise. The leading edge of the arc glows with colorA, the trailing edge fades to colorB, and cells outside the arc receive dim.
For visually smooth gradients choose colorA and colorB that are adjacent in the xterm-256 cube (e.g. the pure-hue column: 21, 57, 93, 129, 165, 201 — each 36 apart). arcFraction is clamped to [0.05, 0.95].
func GradientArcN ¶
GradientArcN is like GradientArc but accepts an ordered slice of color stops. stops[0] is the leading-edge color; stops[len-1] is the trailing-edge color. Cells outside the arc receive dim. arcFraction is clamped to [0.05, 0.95].
Example — purple→indigo→blue with stops from the xterm-256 pure-hue column:
GradientArcN([]cell.Color{
cell.ColorNumber(201), // magenta
cell.ColorNumber(129), // violet
cell.ColorNumber(57), // indigo
cell.ColorNumber(21), // blue
}, cell.ColorNumber(17), 0.4)
func InterlacedScanner ¶
InterlacedScanner runs a denser multi-lane tracer with a braille shimmer tail.
func OrbitScanner ¶
OrbitScanner runs a denser, tri-lane scanner for high-energy panels.
func RainScanner ¶
RainScanner runs a restrained telemetry shimmer with sparse side markers and a faint bottom accent.
func Scanner ¶
Scanner simulates a scanning beam traveling clockwise around the full border. Top and bottom edges therefore move in opposite visual directions.
func ShardScanner ¶
ShardScanner runs a sharper segmented scanner with longer travel streaks.
func SpinnerPulse ¶
SpinnerPulse runs the spinner2 pulse frames across the border.
func StaticNoise ¶
StaticNoise flickers clean border glyphs with a cool noisy signal field, without any moving artifact or traveling tracer.
func TextSweep ¶
TextSweep creates a left-to-right sweep effect on the border title text. The title text is held at grey (restColor) and a white (sweepColor) window quickly sweeps across it left to right. Text returns to grey once the window passes. The sweep repeats continuously to signal active focus or loading. The sweep head advances 3 characters per frame for a fast, snappy feel.
func TextSweepWidth ¶
TextSweepWidth is like TextSweep but lets the caller choose the sweep window width and speed. Speed is how many characters the sweep head advances per frame (higher = faster).
func (*Effect) NextStyler ¶
func (e *Effect) NextStyler() container.BorderCellStyler
NextStyler advances one frame and returns a per-border-cell styler.
type LoadingBackground ¶
type LoadingBackground struct {
// contains filtered or unexported fields
}
LoadingBackground draws a striped loading surface for widgets that are still booting or hydrating content.
func NewLoadingBackground ¶
func NewLoadingBackground(opts ...LoadingBackgroundOption) LoadingBackground
NewLoadingBackground returns a loading background with the supplied options.
func (LoadingBackground) Draw ¶
func (lb LoadingBackground) Draw(t terminalapi.Terminal, rect image.Rectangle, frame string) error
Draw renders the striped loading background into rect and then draws the provided loading frame on top of it.
func (LoadingBackground) RowCellOpts ¶
func (lb LoadingBackground) RowCellOpts(row int) []cell.Option
RowCellOpts returns the cell options for the supplied row of the loading background.
type LoadingBackgroundOption ¶
type LoadingBackgroundOption interface {
// contains filtered or unexported methods
}
LoadingBackgroundOption configures a loading background renderer.
func InterlacedLoadingBackground ¶
func InterlacedLoadingBackground(primary, secondary cell.Color) LoadingBackgroundOption
InterlacedLoadingBackground alternates two background colors row-by-row.
func LoadingTextColor ¶
func LoadingTextColor(color cell.Color) LoadingBackgroundOption
LoadingTextColor sets the foreground color used for loading copy rendered on top of the background stripes.
type LoadingOverlay ¶
type LoadingOverlay struct {
terminalapi.Terminal // all non-overridden calls delegate here
// contains filtered or unexported fields
}
LoadingOverlay wraps a terminal and paints an interlaced loading background over one or more named panels during the boot or hydration phase of your app.
It implements terminalapi.Terminal — pass it wherever a terminal is expected (container.New, termdash.Run, etc.). All method calls are forwarded to the wrapped terminal; only Flush() is intercepted to paint the overlay.
Quickstart — three steps:
Wrap your terminal:
lo := borderfx.WrapWithLoading(t, func(size image.Point, id string) image.Rectangle { outer := myLayout.BorderRect(size, id) // the panel's outer border rect return outer.Inset(1) // strip the 1-cell border })
Set loading content and show the overlay:
lo.SetContent("sensors", " :: carrier lock ::\n\n preparing .......\n") lo.Show()
Hide when boot is done:
lo.Hide()
func WrapWithLoading ¶
func WrapWithLoading(t terminalapi.Terminal, rectFn PanelRectFunc) *LoadingOverlay
WrapWithLoading wraps t and returns a LoadingOverlay ready to display an interlaced boot screen.
rectFn maps (terminal size, panel ID) to the drawable inner rectangle for that panel. It is called on every Flush so the overlay stays correct after terminal resize. For a bordered panel the inner rect is the outer border rect inset by 1:
func(size image.Point, id string) image.Rectangle {
return outerBorderRects(size)[id].Inset(1)
}
func (*LoadingOverlay) Flush ¶
func (lo *LoadingOverlay) Flush() error
Flush flushes the wrapped terminal's back buffer, then — when the overlay is visible — paints the interlaced loading background into each registered panel. This method satisfies terminalapi.Terminal and overrides the embedded one.
func (*LoadingOverlay) Hide ¶
func (lo *LoadingOverlay) Hide()
Hide removes the loading overlay, revealing the live widget content beneath. Call this when your application has finished booting or loading.
func (*LoadingOverlay) SetContent ¶
func (lo *LoadingOverlay) SetContent(id, text string)
SetContent sets the loading text displayed inside a named panel. Call before Show() to pre-populate panels, or at any time during the loading phase to update the copy. Use "\n" to separate lines.
func (*LoadingOverlay) Show ¶
func (lo *LoadingOverlay) Show()
Show makes the loading overlay visible.
type Macro ¶
type Macro struct {
// contains filtered or unexported fields
}
Macro is a reusable, high-level border animation preset.
type Palette ¶
Palette groups the colors used by the higher-level borderfx presets.
type PanelRectFunc ¶
PanelRectFunc maps a terminal size and panel ID to the drawable content rectangle for that panel. For a panel with a 1-cell border, shrink the outer border rectangle by 1 on all sides using rect.Inset(1).
type Profile ¶
type Profile struct {
// contains filtered or unexported fields
}
Profile is a fully pre-configured border effect. Colors, animation speed, and the recommended inactive-panel style are all baked in — no palette selection required.
Quickstart:
fx := borderfx.NewAnimator(cont) fx.ApplyProfile(borderfx.Profiles.GradientArc, "root", "panel1", "panel2") go fx.Run(ctx)
func (Profile) Description ¶
Description returns a human-readable summary of the visual effect.
func (Profile) InactiveColor ¶
InactiveColor returns the color used to style unfocused panels.
type TitleSpec ¶
type TitleSpec struct {
Base string
Charset string
Spinner spin.Spinner
LeftSpin spin.Spinner
RightSpin spin.Spinner
SpinnerPlacement TitleSpinnerPlacement
}
TitleSpec describes one focus-aware border title.
Base and Charset cover the common reveal effect. Spinner, LeftSpin, and RightSpin are lower-level hooks for title ornamentation so callers can build outward from a single stable title representation rather than choosing between competing title APIs.
func DecryptingTitle ¶
DecryptingTitle returns a title spec that reveals itself from the provided charset when the pane becomes focused.
This is the simplest public entry point for the "decrypt on focus" title effect used by the borderfx demo. Callers can keep building on the returned spec with the existing spinner fields or the chainable helpers below.
func (TitleSpec) HasSpinners ¶
HasSpinners reports whether the spec has any spinner configured.
func (TitleSpec) WithLeftSpinner ¶
WithLeftSpinner returns a copy of the title spec with a left-side spinner.
type TitleSpinnerPlacement ¶
type TitleSpinnerPlacement int
TitleSpinnerPlacement controls where a spinner is rendered relative to a title.
const ( // TitleSpinnerRight appends the spinner to the title. TitleSpinnerRight TitleSpinnerPlacement = iota + 1 // TitleSpinnerLeft prefixes the spinner to the title. TitleSpinnerLeft )
Directories
¶
| Path | Synopsis |
|---|---|
|
Binary borderfxdemo - animated LCARS-style borders.
|
Binary borderfxdemo - animated LCARS-style borders. |