From e2854d5b23d32c1b8686f014469b87de340cd58c Mon Sep 17 00:00:00 2001 From: Maas Lalani Date: Wed, 6 Jul 2022 13:16:01 -0400 Subject: [PATCH] feat: add `example/demo.sh` to showcase functionality --- examples/demo.sh | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100755 examples/demo.sh diff --git a/examples/demo.sh b/examples/demo.sh new file mode 100755 index 0000000..a1db2d3 --- /dev/null +++ b/examples/demo.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +go install github.com/charmbracelet/sodapop && mv $GOBIN/sodapop $GOBIN/pop + +echo "Hello, there! Welcome to $(pop style --foreground 212 'Soda Pop')" + +NAME=$(pop input --placeholder "What is your name?") + +echo "Well, it is nice to meet you, $(pop style --foreground 212 "$NAME")." + +COLOR=$(pop input --placeholder "What is your favorite color? (#HEX)") + +echo "Wait a moment, while I think of my favorite color..." + +pop spin --title "Thinking..." --color 212 -- sleep 3 + +echo "I like $(pop style --background $COLOR $COLOR), too. In fact, it's my $(pop style --background $COLOR 'favorite color!')" + +sleep 1 + +echo "Seems like we have a lot in common, $(pop style --foreground 212 "$NAME")." + +sleep 1 + +echo "What's your favorite Soda Pop flavor?" + +POP=$(pop search --accent-color 212 << POPS +Cherry +Grape +Lime +Orange +POPS) + +echo "One sec, while I finish my drink." + +pop spin --title "Drinking some $POP soda pop..." --color 212 -- sleep 5 + +pop style --width 50 --padding "1 5" --margin "1 2" --border double --border-foreground 212 \ + "Well, it was nice meeting you, $(pop style --foreground 212 "$NAME"). Hope to see you soon! Don't forget to drink some $(pop style --foreground 212 $POP) soda pop."