add VHS-generated GIFs for all examples
Created tape files and GIFs demonstrating each example: - counter, timer, list, spinner, views, http - Updated README with GIF showcase Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,17 +2,7 @@
|
||||
|
||||
A terminal user interface framework for Clojure, inspired by [Bubbletea](https://github.com/charmbracelet/bubbletea) (Go). Build interactive CLI applications using the Elm Architecture with Hiccup-style views.
|
||||
|
||||
```
|
||||
╭──────────────────────────────────────╮
|
||||
│ │
|
||||
│ ╭────────────────────╮ │
|
||||
│ │ Counter: 42 │ │
|
||||
│ ╰────────────────────╯ │
|
||||
│ │
|
||||
│ j/k: change r: reset q: quit │
|
||||
│ │
|
||||
╰──────────────────────────────────────╯
|
||||
```
|
||||

|
||||
|
||||
## Features
|
||||
|
||||
@@ -93,18 +83,67 @@ Output:
|
||||
j/k: change r: reset q: quit
|
||||
```
|
||||
|
||||
## Running Examples
|
||||
## Examples
|
||||
|
||||
### Counter
|
||||
Simple counter demonstrating basic Elm Architecture.
|
||||
|
||||

|
||||
|
||||
```bash
|
||||
# With Babashka (simple sync runtime)
|
||||
bb counter
|
||||
bb timer
|
||||
bb list
|
||||
bb spinner
|
||||
bb views
|
||||
bb http
|
||||
```
|
||||
|
||||
# With Clojure (full async support)
|
||||
### Timer
|
||||
Countdown timer with pause/resume - demonstrates async commands.
|
||||
|
||||

|
||||
|
||||
```bash
|
||||
bb timer
|
||||
```
|
||||
|
||||
### List Selection
|
||||
Multi-select list with cursor navigation.
|
||||
|
||||

|
||||
|
||||
```bash
|
||||
bb list
|
||||
```
|
||||
|
||||
### Spinner
|
||||
Animated loading spinners with multiple styles.
|
||||
|
||||

|
||||
|
||||
```bash
|
||||
bb spinner
|
||||
```
|
||||
|
||||
### Views
|
||||
State machine pattern with multiple views and navigation.
|
||||
|
||||

|
||||
|
||||
```bash
|
||||
bb views
|
||||
```
|
||||
|
||||
### HTTP
|
||||
Async HTTP requests with loading states.
|
||||
|
||||

|
||||
|
||||
```bash
|
||||
bb http
|
||||
```
|
||||
|
||||
### Running with Full Clojure
|
||||
|
||||
For full async support (core.async), run with Clojure:
|
||||
|
||||
```bash
|
||||
clojure -A:dev -M -m examples.counter
|
||||
```
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 28 KiB |
@@ -0,0 +1,48 @@
|
||||
# Counter Example
|
||||
Output assets/counter.gif
|
||||
|
||||
Set Shell "bash"
|
||||
Set FontSize 16
|
||||
Set Width 600
|
||||
Set Height 400
|
||||
Set Theme "Catppuccin Mocha"
|
||||
|
||||
Type "bb counter"
|
||||
Enter
|
||||
Sleep 1s
|
||||
|
||||
# Increment a few times
|
||||
Type "k"
|
||||
Sleep 400ms
|
||||
Type "k"
|
||||
Sleep 400ms
|
||||
Type "k"
|
||||
Sleep 400ms
|
||||
Type "k"
|
||||
Sleep 400ms
|
||||
Type "k"
|
||||
Sleep 600ms
|
||||
|
||||
# Decrement
|
||||
Type "j"
|
||||
Sleep 400ms
|
||||
Type "j"
|
||||
Sleep 400ms
|
||||
Type "j"
|
||||
Sleep 600ms
|
||||
|
||||
# Reset
|
||||
Type "r"
|
||||
Sleep 800ms
|
||||
|
||||
# Go negative
|
||||
Type "j"
|
||||
Sleep 400ms
|
||||
Type "j"
|
||||
Sleep 400ms
|
||||
Type "j"
|
||||
Sleep 600ms
|
||||
|
||||
# Quit
|
||||
Type "q"
|
||||
Sleep 500ms
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 68 KiB |
@@ -0,0 +1,28 @@
|
||||
# HTTP Example
|
||||
Output assets/http.gif
|
||||
|
||||
Set Shell "bash"
|
||||
Set FontSize 16
|
||||
Set Width 650
|
||||
Set Height 400
|
||||
Set Theme "Catppuccin Mocha"
|
||||
|
||||
Type "bb http"
|
||||
Enter
|
||||
Sleep 1s
|
||||
|
||||
# Start fetch
|
||||
Enter
|
||||
Sleep 2s
|
||||
|
||||
# Reset
|
||||
Type "r"
|
||||
Sleep 800ms
|
||||
|
||||
# Fetch again
|
||||
Enter
|
||||
Sleep 2s
|
||||
|
||||
# Quit
|
||||
Type "q"
|
||||
Sleep 500ms
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 61 KiB |
@@ -0,0 +1,56 @@
|
||||
# List Selection Example
|
||||
Output assets/list.gif
|
||||
|
||||
Set Shell "bash"
|
||||
Set FontSize 16
|
||||
Set Width 700
|
||||
Set Height 500
|
||||
Set Theme "Catppuccin Mocha"
|
||||
|
||||
Type "bb list"
|
||||
Enter
|
||||
Sleep 1s
|
||||
|
||||
# Navigate down and select
|
||||
Type "j"
|
||||
Sleep 300ms
|
||||
Type " "
|
||||
Sleep 400ms
|
||||
|
||||
Type "j"
|
||||
Sleep 300ms
|
||||
Type "j"
|
||||
Sleep 300ms
|
||||
Type " "
|
||||
Sleep 400ms
|
||||
|
||||
Type "j"
|
||||
Sleep 300ms
|
||||
Type "j"
|
||||
Sleep 300ms
|
||||
Type " "
|
||||
Sleep 400ms
|
||||
|
||||
# Navigate up
|
||||
Type "k"
|
||||
Sleep 300ms
|
||||
Type "k"
|
||||
Sleep 300ms
|
||||
|
||||
# Deselect
|
||||
Type " "
|
||||
Sleep 400ms
|
||||
|
||||
# Navigate and select more
|
||||
Type "j"
|
||||
Sleep 300ms
|
||||
Type "j"
|
||||
Sleep 300ms
|
||||
Type "j"
|
||||
Sleep 300ms
|
||||
Type " "
|
||||
Sleep 600ms
|
||||
|
||||
# Submit
|
||||
Enter
|
||||
Sleep 1s
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 49 KiB |
@@ -0,0 +1,41 @@
|
||||
# Spinner Example
|
||||
Output assets/spinner.gif
|
||||
|
||||
Set Shell "bash"
|
||||
Set FontSize 16
|
||||
Set Width 650
|
||||
Set Height 400
|
||||
Set Theme "Catppuccin Mocha"
|
||||
|
||||
Type "bb spinner"
|
||||
Enter
|
||||
Sleep 1.5s
|
||||
|
||||
# Watch spinner animate
|
||||
Sleep 1s
|
||||
|
||||
# Change style
|
||||
Tab
|
||||
Sleep 1s
|
||||
Tab
|
||||
Sleep 1s
|
||||
Tab
|
||||
Sleep 1s
|
||||
Tab
|
||||
Sleep 1s
|
||||
|
||||
# Complete
|
||||
Type " "
|
||||
Sleep 800ms
|
||||
|
||||
# Restart
|
||||
Type "r"
|
||||
Sleep 1.5s
|
||||
|
||||
# Change style again
|
||||
Tab
|
||||
Sleep 1s
|
||||
|
||||
# Quit
|
||||
Type "q"
|
||||
Sleep 500ms
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 29 KiB |
@@ -0,0 +1,31 @@
|
||||
# Timer Example
|
||||
Output assets/timer.gif
|
||||
|
||||
Set Shell "bash"
|
||||
Set FontSize 16
|
||||
Set Width 600
|
||||
Set Height 400
|
||||
Set Theme "Catppuccin Mocha"
|
||||
|
||||
Type "bb timer"
|
||||
Enter
|
||||
Sleep 1s
|
||||
|
||||
# Watch countdown
|
||||
Sleep 2s
|
||||
|
||||
# Pause
|
||||
Type " "
|
||||
Sleep 1s
|
||||
|
||||
# Resume
|
||||
Type " "
|
||||
Sleep 2s
|
||||
|
||||
# Reset
|
||||
Type "r"
|
||||
Sleep 3s
|
||||
|
||||
# Quit
|
||||
Type "q"
|
||||
Sleep 500ms
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 108 KiB |
@@ -0,0 +1,48 @@
|
||||
# Views Example
|
||||
Output assets/views.gif
|
||||
|
||||
Set Shell "bash"
|
||||
Set FontSize 16
|
||||
Set Width 700
|
||||
Set Height 450
|
||||
Set Theme "Catppuccin Mocha"
|
||||
|
||||
Type "bb views"
|
||||
Enter
|
||||
Sleep 1s
|
||||
|
||||
# Navigate menu
|
||||
Type "j"
|
||||
Sleep 400ms
|
||||
Type "j"
|
||||
Sleep 400ms
|
||||
|
||||
# Enter detail view
|
||||
Enter
|
||||
Sleep 1s
|
||||
|
||||
# Go back
|
||||
Type "b"
|
||||
Sleep 600ms
|
||||
|
||||
# Navigate to another item
|
||||
Type "j"
|
||||
Sleep 400ms
|
||||
Enter
|
||||
Sleep 1s
|
||||
|
||||
# Try to quit - shows confirm dialog
|
||||
Type "q"
|
||||
Sleep 800ms
|
||||
|
||||
# Say no
|
||||
Type "n"
|
||||
Sleep 600ms
|
||||
|
||||
# Go back to menu
|
||||
Escape
|
||||
Sleep 600ms
|
||||
|
||||
# Actually quit
|
||||
Type "q"
|
||||
Sleep 500ms
|
||||
Reference in New Issue
Block a user