Skip to content

Commit

Permalink
docs: add new gifs (charmbracelet#533)
Browse files Browse the repository at this point in the history
* docs: add new gifs

* Update README.md

* docs: spin.gif

* docs: add spin.gif to readme

* fix: lint

* don't commit filter.tape
  • Loading branch information
maaslalani authored Apr 5, 2024
1 parent 2a35019 commit f75dfa6
Show file tree
Hide file tree
Showing 17 changed files with 227 additions and 14 deletions.
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export GUM_INPUT_WIDTH=80
gum input
```

<img alt="Gum input displaying most customization options" width="600" src="https://stuff.charm.sh/gum/customization.gif">
<img alt="Gum input displaying most customization options" width="600" src="https://vhs.charm.sh/vhs-5zb9DlQYA70aL9ZpYLTwKv.gif">

## Input

Expand All @@ -141,7 +141,7 @@ gum input > answer.txt
gum input --password > password.txt
```

<img src="https://stuff.charm.sh/gum/input_1.gif" width="600" alt="Shell running gum input typing Not much, you?" />
<img src="https://vhs.charm.sh/vhs-1nScrStFI3BMlCp5yrLtyg.gif" width="600" alt="Shell running gum input typing Not much, you?" />

## Write

Expand All @@ -151,7 +151,7 @@ Prompt for some multi-line text (`ctrl+d` to complete text entry).
gum write > story.txt
```

<img src="https://stuff.charm.sh/gum/write.gif" width="600" alt="Shell running gum write typing a story" />
<img src="https://vhs.charm.sh/vhs-7abdKKrUEukgx9aJj8O5GX.gif" width="600" alt="Shell running gum write typing a story" />

## Filter

Expand All @@ -164,7 +164,7 @@ echo Cherry >> flavors.txt
gum filter < flavors.txt > selection.txt
```

<img src="https://stuff.charm.sh/gum/filter.gif" width="600" alt="Shell running gum filter on different bubble gum flavors" />
<img src="https://vhs.charm.sh/vhs-61euOQtKPtQVD7nDpHQhzr.gif" width="600" alt="Shell running gum filter on different bubble gum flavors" />

Select multiple options with the `--limit` flag or `--no-limit` flag. Use `tab` or `ctrl+space` to select, `enter` to confirm.

Expand All @@ -191,7 +191,7 @@ cat songs.txt | gum choose --limit 5
cat foods.txt | gum choose --no-limit --header "Grocery Shopping"
```

<img src="https://stuff.charm.sh/gum/choose.gif" width="600" alt="Shell running gum choose with numbers and gum flavors" />
<img src="https://vhs.charm.sh/vhs-3zV1LvofA6Cbn5vBu1NHHl.gif" width="600" alt="Shell running gum choose with numbers and gum flavors" />

## Confirm

Expand All @@ -202,7 +202,7 @@ Confirm whether to perform an action. Exits with code `0` (affirmative) or `1`
gum confirm && rm file.txt || echo "File not removed"
```

<img src="https://stuff.charm.sh/gum/confirm_2.gif" width="600" alt="Shell running gum confirm" />
<img src="https://vhs.charm.sh/vhs-3xRFvbeQ4lqGerbHY7y3q2.gif" width="600" alt="Shell running gum confirm" />

## File

Expand All @@ -212,7 +212,7 @@ Prompt the user to select a file from the file tree.
EDITOR $(gum file $HOME)
```

<img src="https://stuff.charm.sh/gum/file.gif" width="600" alt="Shell running gum file" />
<img src="https://vhs.charm.sh/vhs-2RMRqmnOPneneIgVJJ3mI1.gif" width="600" alt="Shell running gum file" />

## Pager

Expand All @@ -222,7 +222,7 @@ Scroll through a long document with line numbers and a fully customizable viewpo
gum pager < README.md
```

<img src="https://stuff.charm.sh/gum/pager.gif" width="600" alt="Shell running gum pager" />
<img src="https://vhs.charm.sh/vhs-3iMDpgOLmbYr0jrYEGbk7p.gif" width="600" alt="Shell running gum pager" />

## Spin

Expand All @@ -235,7 +235,7 @@ To view or pipe the command's output, use the `--show-output` flag.
gum spin --spinner dot --title "Buying Bubble Gum..." -- sleep 5
```

<img src="https://stuff.charm.sh/gum/spin.gif" width="600" alt="Shell running gum spin while sleeping for 5 seconds" />
<img src="https://vhs.charm.sh/vhs-3YFswCmoY4o3Q7MyzWl6sS.gif" width="600" alt="Shell running gum spin while sleeping for 5 seconds" />

Available spinner types include: `line`, `dot`, `minidot`, `jump`, `pulse`, `points`, `globe`, `moon`, `monkey`, `meter`, `hamburger`.

Expand All @@ -247,7 +247,7 @@ Select a row from some tabular data.
gum table < flavors.csv | cut -d ',' -f 1
```

<img src="https://stuff.charm.sh/gum/table.gif" width="600" alt="Shell running gum table" />
<!-- <img src="https://stuff.charm.sh/gum/table.gif" width="600" alt="Shell running gum table" /> -->

## Style

Expand All @@ -260,7 +260,7 @@ gum style \
'Bubble Gum (1¢)' 'So sweet and so fresh!'
```

<img src="https://stuff.charm.sh/gum/style.gif" width="600" alt="Bubble Gum, So sweet and so fresh!" />
<img src="https://github.com/charmbracelet/gum/assets/42545625/67468acf-b3e0-4e78-bd89-360739eb44fa" width="600" alt="Bubble Gum, So sweet and so fresh!" />

## Join

Expand All @@ -281,7 +281,7 @@ BUBBLE_GUM=$(gum join "$BUBBLE" "$GUM")
gum join --align center --vertical "$I_LOVE" "$BUBBLE_GUM"
```

<img src="https://stuff.charm.sh/gum/join.gif" width="600" alt="I LOVE Bubble Gum written out in four boxes with double borders around them." />
<img src="https://github.com/charmbracelet/gum/assets/42545625/68f7a25d-b495-48dd-982a-cee0c8ea5786" width="600" alt="I LOVE Bubble Gum written out in four boxes with double borders around them." />

## Format

Expand All @@ -308,7 +308,7 @@ For more information on template helpers, see the [Termenv
docs](https://github.com/muesli/termenv#template-helpers). For a full list of
named emojis see the [GitHub API](https://api.github.com/emojis).

<img src="https://stuff.charm.sh/gum/format.gif" width="600" alt="Running gum format for different types of formats" />
<img src="https://github.com/charmbracelet/gum/assets/42545625/5cfbb0c8-0022-460d-841b-fec37527ca66" width="300" alt="Running gum format for different types of formats" />

## Log

Expand Down
1 change: 1 addition & 0 deletions examples/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.gif
*.png
36 changes: 36 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Glamour

A casual introduction. 你好世界!

## Let's talk about artichokes

The artichoke is mentioned as a garden
plant in the 8th century BC by Homer
and Hesiod. The naturally occurring
variant of the artichoke, the cardoon,
which is native to the Mediterranean
area, also has records of use as a
food among the ancient Greeks and
Romans. Pliny the Elder mentioned
growing of 'carduus' in Carthage
and Cordoba.

He holds him with his skinny hand,
There was ship,' quoth he.
'Hold off! unhand me, grey-beard loon!'
An artichoke dropt he.

## Other foods worth mentioning

1. Carrots
2. Celery
3. Tacos
• Soft
• Hard
4. Cucumber

## Things to eat today

* Carrots
* Ramen
* Currywurst
26 changes: 26 additions & 0 deletions examples/choose.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Output choose.gif

Set Width 1000
Set Height 430
Set Shell bash

Type "gum choose {1..5}"
Sleep 500ms
Enter
Sleep 500ms
Down@250ms 3
Sleep 500ms
Up@250ms 2
Enter
Sleep 1.5s
Ctrl+L
Sleep 500ms
Type "gum choose --limit 2 Banana Cherry Orange"
Sleep 500ms
Enter
Sleep 500ms
Type@250ms "jxjxk"
Sleep 1s
Enter
Sleep 2s

26 changes: 26 additions & 0 deletions examples/confirm.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Output confirm.gif

Set Width 1000
Set Height 350
Set Shell bash

Sleep 500ms
Type "gum confirm && echo 'Me too!' || echo 'Me neither.'"
Sleep 1s
Enter
Sleep 1s
Right
Sleep 500ms
Left
Sleep 500ms
Enter
Sleep 1.5s
Ctrl+L
Type "gum confirm && echo 'Me too!' || echo 'Me neither.'"
Sleep 500ms
Enter
Sleep 500ms
Right
Sleep 500ms
Enter
Sleep 1s
19 changes: 19 additions & 0 deletions examples/customize.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Output customize.gif

Set Width 1000
Set Height 350
Set Shell bash

Sleep 1s
Type `gum input --cursor.foreground "#F4AC45" \` Enter
Type `--prompt.foreground "#04B575" --prompt "What's up? " \` Enter
Type `--placeholder "Not much, you?" --value "Not much, you?" \` Enter
Type `--width 80` Enter
Sleep 1s
Ctrl+A
Sleep 1s
Ctrl+E
Sleep 1s
Ctrl+U
Sleep 1s

1 change: 1 addition & 0 deletions examples/fav.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Banana
15 changes: 15 additions & 0 deletions examples/file.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Output file.gif
Set Width 800
Set Height 525
Set Shell bash

Type "gum file .."
Enter
Sleep 1s
Down@150ms 6
Sleep 1s
Enter
Sleep 1s
Type "j"
Sleep 1s

4 changes: 4 additions & 0 deletions examples/flavors.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Banana
Cherry
Orange
Strawberry
12 changes: 12 additions & 0 deletions examples/format.ansi
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
> gum format -t code < main.go


   package main
   
   import "fmt"
   
   func main() {
    fmt.Println("Charm_™ Gum")
   }
   

16 changes: 16 additions & 0 deletions examples/input.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Output input.gif

Set Width 800
Set Height 250
Set Shell bash

Sleep 1s
Type `gum input --placeholder "What's up?"`
Sleep 1s
Enter
Sleep 1s
Type "Not much, you?"
Sleep 1s
Enter
Sleep 1s

7 changes: 7 additions & 0 deletions examples/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package main

import "fmt"

func main() {
fmt.Println("Charm_™ Gum")
}
15 changes: 15 additions & 0 deletions examples/pager.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Output pager.gif

Set Shell bash
Set Width 900
Set Height 750

Sleep 1s
Type "gum pager < README.md"
Enter
Sleep 1.5s
Down@100ms 25
Sleep 1s
Up@100ms 25
Sleep 3s

13 changes: 13 additions & 0 deletions examples/spin.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Output spin.gif

Set Shell bash
Set Width 1200
Set Height 300
Set FontSize 36

Sleep 500ms
Type `gum spin --title "Buying Gum..." -- sleep 5`
Sleep 1s
Enter
Sleep 4s

2 changes: 2 additions & 0 deletions examples/story.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Once upon a time
In a land far, far away....
21 changes: 21 additions & 0 deletions examples/write.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Output write.gif

Set Width 800
Set Height 350
Set Shell bash

Sleep 500ms
Type "gum write > story.txt"
Enter
Sleep 1s
Type "Once upon a time"
Sleep 1s
Alt+Enter
Type "In a land far, far away...."
Sleep 500ms
Enter
Sleep 1s
Type "cat story.txt"
Enter
Sleep 2s

1 change: 0 additions & 1 deletion input/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
// Run provides a shell script interface for the text input bubble.
// https://github.com/charmbracelet/bubbles/textinput
func (o Options) Run() error {

var value string
if o.Value != "" {
value = o.Value
Expand Down

0 comments on commit f75dfa6

Please sign in to comment.