Skip to content

Commit

Permalink
chore: new gifs (JetBrains Mono)
Browse files Browse the repository at this point in the history
  • Loading branch information
maaslalani committed Apr 5, 2024
1 parent 42f59ed commit 9ab722c
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 12 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ A tool for glamorous shell scripts. Leverage the power of
Gloss](https://github.com/charmbracelet/lipgloss) in your scripts and aliases
without writing any Go code!

<img alt="Shell running the ./demo.sh script" width="600" src="https://stuff.charm.sh/gum/demo.gif">
<img alt="Shell running the ./demo.sh script" width="600" src="https://vhs.charm.sh/vhs-1qY57RrQlXCuydsEgDp68G.gif">

The above example is running from a single shell script ([source](./examples/demo.sh)).

Expand Down Expand Up @@ -51,7 +51,7 @@ gum confirm "Commit changes?" && git commit -m "$SUMMARY" -m "$DESCRIPTION"

For a working version of the script see how it is all [put together](https://github.com/charmbracelet/gum/blob/main/examples/commit.sh) in a single script.

<img alt="Running the ./examples/commit.sh script to commit to git" width="600" src="https://stuff.charm.sh/gum/commit_2.gif">
<img alt="Running the ./examples/commit.sh script to commit to git" width="600" src="https://vhs.charm.sh/vhs-7rRq3LsEuJVwhwr0xf6Er7.gif">

## Installation

Expand Down
1 change: 1 addition & 0 deletions examples/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.gif
6 changes: 3 additions & 3 deletions examples/commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
#
# alias gcm='git commit -m "$(gum input)" -m "$(gum write)"'

if [ -z "$(git status -s -uno | grep -v '^ ' | awk '{print $2}')" ]; then
gum confirm "Stage all?" && git add .
fi
# if [ -z "$(git status -s -uno | grep -v '^ ' | awk '{print $2}')" ]; then
# gum confirm "Stage all?" && git add .
# fi

TYPE=$(gum choose "fix" "feat" "docs" "style" "refactor" "test" "chore" "revert")
SCOPE=$(gum input --placeholder "scope")
Expand Down
45 changes: 45 additions & 0 deletions examples/commit.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
Output commit.gif

Set Shell "bash"
Set FontSize 32
Set Width 1200
Set Height 600

Type "./commit.sh" Sleep 500ms Enter

Sleep 1s
Down@250ms 2
Sleep 500ms
Enter

Sleep 500ms

Type "gum"

Sleep 500ms
Enter

Sleep 1s

Type "Gum is sooo tasty"
Sleep 500ms

Enter

Sleep 1s

Type@65ms "I love bubble gum."
Sleep 500ms
Alt+Enter
Sleep 500ms
Alt+Enter
Sleep 500ms
Type "This commit shows how much I love chewing bubble gum!!!"
Sleep 500ms
Enter

Sleep 1s

Left@400ms 3

Sleep 1s
13 changes: 6 additions & 7 deletions examples/demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ NAME=$(gum input --placeholder "What is your name?")

echo -e "Well, it is nice to meet you, $(gum style --foreground 212 "$NAME")."

sleep 2; clear
sleep 1; clear

echo -e "Can you tell me a $(gum style --italic --foreground 99 'secret')?\n"

Expand All @@ -14,7 +14,7 @@ gum write --placeholder "I'll keep it to myself, I promise!" > /dev/null # we ke
clear; echo "What should I do with this information?"; sleep 1

READ="Read"; THINK="Think"; DISCARD="Discard"
ACTIONS=$(gum choose --cursor-prefix "[ ] " --selected-prefix "[✓] " --no-limit "$READ" "$THINK" "$DISCARD")
ACTIONS=$(gum choose --no-limit "$READ" "$THINK" "$DISCARD")

clear; echo "One moment, please."

Expand All @@ -24,8 +24,7 @@ grep -q "$DISCARD" <<< "$ACTIONS" && gum spin -s monkey --title " Discarding you

sleep 1; clear

echo "What's your favorite $(gum style --foreground 212 "Gum") flavor?"
GUM=$(echo -e "Cherry\nGrape\nLime\nOrange" | gum filter)
GUM=$(echo -e "Cherry\nGrape\nLime\nOrange" | gum filter --placeholder "Favorite flavor?")
echo "I'll keep that in mind!"

sleep 1; clear
Expand All @@ -39,10 +38,10 @@ CHOICE=$(gum choose --item.foreground 250 "Yes" "No" "It's complicated")

sleep 1

gum spin --title "Chewing some $(gum style --foreground "#04B575" "$GUM") bubble gum..." -- sleep 5
gum spin --title "Chewing some $(gum style --foreground "#04B575" "$GUM") bubble gum..." -- sleep 2.5

clear

NICE_MEETING_YOU=$(gum style --height 5 --width 25 --padding '1 3' --border double --border-foreground 57 "Well, it was nice meeting you, $(gum style --foreground 212 "$NAME"). Hope to see you soon!")
CHEW_BUBBLE_GUM=$(gum style --width 25 --padding '1 3' --border double --border-foreground 212 "Don't forget to chew some $(gum style --foreground "#04B575" "$GUM") bubble gum.")
NICE_MEETING_YOU=$(gum style --height 5 --width 20 --padding '1 3' --border double --border-foreground 57 "Nice meeting you, $(gum style --foreground 212 "$NAME"). See you soon!")
CHEW_BUBBLE_GUM=$(gum style --width 17 --padding '1 3' --border double --border-foreground 212 "Go chew some $(gum style --foreground "#04B575" "$GUM") bubble gum.")
gum join --horizontal "$NICE_MEETING_YOU" "$CHEW_BUBBLE_GUM"
49 changes: 49 additions & 0 deletions examples/demo.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
Output ./demo.gif

Set Shell bash

Set FontSize 22
Set Width 800
Set Height 450

Type "./demo.sh"
Enter
Sleep 1s
Type "Walter"
Sleep 500ms
Enter

Sleep 2s

Type "Nope, sorry!"
Sleep 500ms
Alt+Enter
Sleep 200ms
Alt+Enter
Sleep 500ms
Type "I don't trust you."
Sleep 1s
Enter

Sleep 2s

Type "x" Sleep 250ms Type "j" Sleep 250ms
Type "x" Sleep 250ms Type "j" Sleep 250ms
Type "x" Sleep 1s

Enter

Sleep 6s

Type "li"
Sleep 1s
Enter

Sleep 3s
Down@500ms 2
Up@500ms 2
Sleep 1s
Enter


Sleep 6s

0 comments on commit 9ab722c

Please sign in to comment.