-
Notifications
You must be signed in to change notification settings - Fork 2
/
demo.sh
executable file
·62 lines (53 loc) · 1.08 KB
/
demo.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#! /usr/bin/env bash
set -e
source spinny.sh
default_spinner() {
printf "Spinny can be a classic spinner... "
spinny::start
sleep 3
spinny::stop
printf " \n"
}
dots_spinner() {
SPINNY_FRAMES=(⠇ ⠋ ⠙ ⠸ ⠴ ⠦)
SPINNY_DELAY=0.2
printf "or a bunch of dots... "
spinny::start
sleep 3
spinny::stop
printf " \n"
}
clock_spinner() {
SPINNY_FRAMES=("🕐 " "🕑" "🕒" "🕓" 🕔 🕕 🕖 🕗 🕘 🕙 🕚 🕛)
SPINNY_DELAY=0.1
echo ""
printf "It can show you the time... "
spinny::start
sleep 3
spinny::stop
printf " \n"
}
shrink_spinner() {
SPINNY_FRAMES=(. .. ... .... ..... " ...." " ..." " .." " ." " " )
SPINNY_DELAY=0.1
printf "and animate different length inputs"
spinny::start
sleep 3
spinny::stop
printf ". \n"
}
crazy_spinner() {
SPINNY_FRAMES=("\e[31mcrazy!" "\e[32mcrazy!" "\e[33mcrazy!" "\e[34mcrazy!" "\e[36mcrazy!" )
SPINNY_DELAY=0.1
echo ""
printf "Go "
spinny::start
sleep 3
spinny::stop
printf "\e[39mcrazy!\n"
}
default_spinner
dots_spinner
clock_spinner
shrink_spinner
crazy_spinner