Skip to content

Feat/elephant splash - #75

Open
tusharmalpani20 wants to merge 29 commits into
ChrisBuilds:mainfrom
tusharmalpani20:feat/elephant-splash
Open

Feat/elephant splash#75
tusharmalpani20 wants to merge 29 commits into
ChrisBuilds:mainfrom
tusharmalpani20:feat/elephant-splash

Conversation

@tusharmalpani20

Copy link
Copy Markdown

Summary

Adds a new elephantsplash effect featuring a playful purple elephant that walks along the bottom of the canvas, stops at a puddle,
draws water into its trunk, and sprays it toward the input text to reveal it.

The elephant is implemented as a coordinated multiline sprite. Every character remains locked to one shared origin, preventing
body deformation or independently drifting glyphs. After revealing the text, the elephant raises its trunk, walks out, and leaves
the completed text stationary.

Highlights

  • Adds the public ElephantSplash, ElephantSplashConfig, and ElephantSplashIterator API
  • Registers the elephantsplash CLI command
  • Uses a persistent sprite-cell grid with one shared integer origin
  • Adds four manually authored, grounded walking poses
  • Moves the elephant in synchronized one-column steps
  • Keeps the body, head, ear, and trunk stable while the legs move
  • Adds coordinated trunk-lowering and trunk-raising sequences
  • Draws water from a visible puddle using bounded TTE particles
  • Emits splash particles from the declared trunk-tip coordinate
  • Reveals input characters only after the elephant reaches the puddle
  • Leaves the completed text stationary while the elephant walks away
  • Supports full-size, compact, and particle-only fallback modes
  • Handles multiline input, small canvases, empty input, and ANSI colours
  • Adds configurable elephant colours, water colours, walking timing, final gradient, and hold duration
  • Credits the original jgs elephant artwork in the documentation without displaying the signature
  • Adds reference documentation, showroom content, and an updated animation demo

Animation architecture

The elephant uses TTE’s existing BaseEffect and BaseEffectIterator architecture and normal terminal lifecycle.

Individual elephant characters do not receive independent motion paths. A central state machine controls the shared sprite origin
and current pose through entering, walking, settling, drinking, revealing, holding, raising the trunk, and walking out.

TTE paths and scenes remain responsible for independent water particles, colour transitions, and the final text reveal.

Testing

  • Dedicated Elephant Splash tests: 102 passed
  • Generic effect contracts filtered to Elephant Splash: 20 passed, 162 skipped
  • CLI tests: 17 passed
  • Ruff lint checks on the changed production and test code: passed
  • Ruff formatting check: passed
  • mkdocs build --strict: passed
  • Package build with uv build: passed
  • git diff --check: passed
  • Representative multiline CLI animation: completed successfully
  • Omarchy ORCA screensaver animation on a 160 × 48 canvas: completed successfully

The full repository suite was not run. Verification was limited to Elephant Splash and directly affected components.

Demo

printf 'TERMINAL\nTEXT\nEFFECTS' | uv run tte \
  --frame-rate 30 \
  --canvas-width 100 \
  --canvas-height 30 \
  --ignore-terminal-dimensions \
  --anchor-canvas c \
  --anchor-text c \
  elephantsplash \
  --walk-pose-frames 8 \
  --horizontal-step-frames 4 \
  --final-hold-frames 120

Omarchy screensaver demo

uv run tte \
  --input-file ~/.config/omarchy/branding/screensaver.txt \
  --frame-rate 30 \
  --canvas-width 160 \
  --canvas-height 48 \
  --ignore-terminal-dimensions \
  --anchor-canvas c \
  --anchor-text c \
  elephantsplash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant