diff --git a/.gitignore b/.gitignore index 47cacf4..fa3fbdf 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,12 @@ coverage.txt # Dependency directories (remove the comment below to include it) # vendor/ + +# README GIF generation files +*.mov +*.mp4 +*.gif +*.prproj + +# OS files +.DS_Store diff --git a/README.md b/README.md index 69c0921..4459d25 100644 --- a/README.md +++ b/README.md @@ -57,10 +57,10 @@ pads the animation to ensure the text's position on the screen doesn't change. This results in a smoother looking animation. ##### yacspin -![yacspin animation with dynamic width](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/features/width_good.gif) +![yacspin animation with dynamic width](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/features/width_good.gif) ##### other spinners -![other spinners' animation with dynamic width](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/features/width_bad.gif) +![other spinners' animation with dynamic width](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/features/width_bad.gif) #### Success and Failure Results The spinner has both a `Stop()` and `StopFail()` method, which allows the @@ -72,10 +72,10 @@ By doing this you can use a single `yacspin` spinner to display the status of a list of tasks being executed serially. ##### Stop -![Animation with Success](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/features/stop.gif) +![Animation with Success](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/features/stop.gif) ##### StopFail -![Animation with Failure](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/features/stop_fail.gif) +![Animation with Failure](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/features/stop_fail.gif) #### Animation At End of Line The `SpinnerAtEnd` field of the `Config` struct allows you to specify whether @@ -101,7 +101,7 @@ the user will be updated live. You can see this in action in the following gif, where the filenames being uploaded are rendered independent of the spinner being animated: -![Animation with Success](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/features/stop.gif) +![Animation with Success](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/features/stop.gif) #### Pausing for Updates Sometimes you want to change a few settings, and don't want the spinner to @@ -168,81 +168,94 @@ err = spinner.Stop() ## Spinners yacspin.CharSets index | sample gif (Frequency: 200ms) -----------------------|------------------------------ -0 | ![0 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/0.gif) -1 | ![1 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/1.gif) -2 | ![2 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/2.gif) -3 | ![3 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/3.gif) -4 | ![4 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/4.gif) -5 | ![5 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/5.gif) -6 | ![6 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/6.gif) -7 | ![7 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/7.gif) -8 | ![8 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/8.gif) -9 | ![9 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/9.gif) -10 | ![10 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/10.gif) -11 | ![11 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/11.gif) -12 | ![12 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/12.gif) -13 | ![13 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/13.gif) -14 | ![14 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/14.gif) -15 | ![15 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/15.gif) -16 | ![16 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/16.gif) -17 | ![17 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/17.gif) -18 | ![18 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/18.gif) -19 | ![19 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/19.gif) -20 | ![20 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/20.gif) -21 | ![21 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/21.gif) -22 | ![22 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/22.gif) -23 | ![23 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/23.gif) -24 | ![24 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/24.gif) -25 | ![25 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/25.gif) -26 | ![26 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/26.gif) -27 | ![27 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/27.gif) -28 | ![28 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/28.gif) -29 | ![29 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/29.gif) -30 | ![30 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/30.gif) -31 | ![31 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/31.gif) -32 | ![32 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/32.gif) -33 | ![33 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/33.gif) -34 | ![34 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/34.gif) -35 | ![35 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/35.gif) -36 | ![36 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/36.gif) -37 | ![37 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/37.gif) -38 | ![38 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/38.gif) -39 | ![39 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/39.gif) -40 | ![40 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/40.gif) -41 | ![41 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/41.gif) -42 | ![42 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/42.gif) -43 | ![43 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/43.gif) -44 | ![44 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/44.gif) -45 | ![45 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/45.gif) -46 | ![46 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/46.gif) -47 | ![47 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/47.gif) -48 | ![48 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/48.gif) -49 | ![49 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/49.gif) -50 | ![50 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/50.gif) -51 | ![51 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/51.gif) -52 | ![52 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/52.gif) -53 | ![53 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/53.gif) -54 | ![54 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/54.gif) -55 | ![55 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/55.gif) -56 | ![56 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/56.gif) -57 | ![57 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/57.gif) -58 | ![58 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/58.gif) -59 | ![59 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/59.gif) -60 | ![60 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/60.gif) -61 | ![61 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/61.gif) -62 | ![62 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/62.gif) -63 | ![63 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/63.gif) -64 | ![64 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/64.gif) -65 | ![65 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/65.gif) -66 | ![66 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/66.gif) -67 | ![67 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/67.gif) -68 | ![68 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/68.gif) -69 | ![69 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/69.gif) -70 | ![70 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/70.gif) -71 | ![71 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/71.gif) -72 | ![72 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/72.gif) -73 | ![73 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/73.gif) -74 | ![74 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/74.gif) -75 | ![75 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/75.gif) -76 | ![76 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/76.gif) -77 | ![77 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/d611334044a6abe03158440385cb364910a0a036/spinners/77.gif) +0 | ![0 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/0.gif) +1 | ![1 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/1.gif) +2 | ![2 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/2.gif) +3 | ![3 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/3.gif) +4 | ![4 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/4.gif) +5 | ![5 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/5.gif) +6 | ![6 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/6.gif) +7 | ![7 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/7.gif) +8 | ![8 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/8.gif) +9 | ![9 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/9.gif) +10 | ![10 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/10.gif) +11 | ![11 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/11.gif) +12 | ![12 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/12.gif) +13 | ![13 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/13.gif) +14 | ![14 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/14.gif) +15 | ![15 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/15.gif) +16 | ![16 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/16.gif) +17 | ![17 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/17.gif) +18 | ![18 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/18.gif) +19 | ![19 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/19.gif) +20 | ![20 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/20.gif) +21 | ![21 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/21.gif) +22 | ![22 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/22.gif) +23 | ![23 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/23.gif) +24 | ![24 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/24.gif) +25 | ![25 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/25.gif) +26 | ![26 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/26.gif) +27 | ![27 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/27.gif) +28 | ![28 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/28.gif) +29 | ![29 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/29.gif) +30 | ![30 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/30.gif) +31 | ![31 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/31.gif) +32 | ![32 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/32.gif) +33 | ![33 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/33.gif) +34 | ![34 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/34.gif) +35 | ![35 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/35.gif) +36 | ![36 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/36.gif) +37 | ![37 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/37.gif) +38 | ![38 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/38.gif) +39 | ![39 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/39.gif) +40 | ![40 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/40.gif) +41 | ![41 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/41.gif) +42 | ![42 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/42.gif) +43 | ![43 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/43.gif) +44 | ![44 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/44.gif) +45 | ![45 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/45.gif) +46 | ![46 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/46.gif) +47 | ![47 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/47.gif) +48 | ![48 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/48.gif) +49 | ![49 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/49.gif) +50 | ![50 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/50.gif) +51 | ![51 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/51.gif) +52 | ![52 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/52.gif) +53 | ![53 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/53.gif) +54 | ![54 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/54.gif) +55 | ![55 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/55.gif) +56 | ![56 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/56.gif) +57 | ![57 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/57.gif) +58 | ![58 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/58.gif) +59 | ![59 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/59.gif) +60 | ![60 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/60.gif) +61 | ![61 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/61.gif) +62 | ![62 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/62.gif) +63 | ![63 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/63.gif) +64 | ![64 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/64.gif) +65 | ![65 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/65.gif) +66 | ![66 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/66.gif) +67 | ![67 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/67.gif) +68 | ![68 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/68.gif) +69 | ![69 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/69.gif) +70 | ![70 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/70.gif) +71 | ![71 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/71.gif) +72 | ![72 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/72.gif) +73 | ![73 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/73.gif) +74 | ![74 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/74.gif) +75 | ![75 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/75.gif) +76 | ![76 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/76.gif) +77 | ![77 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/77.gif) +78 | ![78 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/78.gif) +79 | ![79 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/79.gif) +80 | ![80 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/80.gif) +81 | ![81 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/81.gif) +82 | ![82 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/82.gif) +83 | ![83 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/83.gif) +84 | ![84 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/84.gif) +85 | ![85 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/85.gif) +86 | ![86 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/86.gif) +87 | ![87 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/87.gif) +88 | ![88 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/88.gif) +89 | ![89 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/89.gif) +90 | ![90 gif](https://raw.githubusercontent.com/theckman/yacspin-gifs/11953a4f12560eaf4a27054d3adad471eb19193c/spinners/90.gif) diff --git a/examples/demo/README.md b/examples/demo/README.md new file mode 100644 index 0000000..a2bbb0c --- /dev/null +++ b/examples/demo/README.md @@ -0,0 +1,44 @@ +# demo + +This program is the helper used to create the gifs in the README. What follows +are notes for when I do this in the future. + +### Overview + +The software in this `demo` folder is used to demonstrate all of the spinners +that exist, and to help generate the GIFs used for the README.md file in the +root of this repo. + +There are two helper scripts in the `scripts/` folder. `ffmpeg.sh` helps with +converting the h.264 .mp4 files into .gif files. The `rename.go` program then +helps rename those .gif files into the right name for committing to the +repository. + +The GIFs are stored in a sister GitHub repository, [github.com/theckman/yacspin-gifs](https://github.com/theckman/yacspin-gifs) +to avoid cluttering up this repo with binary files (images). + +#### Checklist + +- [ ] start a screen recording of the terminal using Apple QuickTime Player +- [ ] start the demo program (`main.go`) and let it run entirely before stopping the QuickTime recording +- [ ] load the .mov file into Adobe Preimere, and cut the clip down into the individual 10 second clips of each spinner +- [ ] turn the clips in the original Sequence into Subsequences +- [ ] use media encoder to export those subsequences to their own files, matching source with Adaptive High Bitrate +- [ ] use the `scripts/ffmpeg.sh` script to convert the `.mp4` files into `.gif` files +- [ ] `go run` the `scripts/rename.go` program, to rename the `.gif` files to match the names we expect + +#### QuickTime Capture Sizes + +When using the Apple QuickTime Player to capture the screen recording, you can +have it only capture a specific area of the screen. These are the capture sizes +I played with on my Apple 16" M1 Max MBP laptop. + +Please note, that the video files rendered from these captures tend to have +about 2x the resolution. Keep that in mind when deciding how large of an area +you want to capture. + +Capture Size (pixels) | Font Size +----------------------|---------- +650w x 24h | 18 +340w x 12h | 10 +1300w x 47h | 38 diff --git a/examples/demo/main.go b/examples/demo/main.go new file mode 100644 index 0000000..3dab4d0 --- /dev/null +++ b/examples/demo/main.go @@ -0,0 +1,66 @@ +// This program was used to generate the gifs in the README file + +package main + +import ( + "fmt" + "os" + "os/signal" + "runtime" + "runtime/debug" + "syscall" + "time" + + "github.com/theckman/yacspin" +) + +func main() { + // disable GC + debug.SetGCPercent(-1) + + cfg := yacspin.Config{ + Frequency: 200 * time.Millisecond, + CharSet: yacspin.CharSets[36], + SuffixAutoColon: true, + Suffix: " example spinner", + Message: "initial message", + Colors: []string{"fgYellow"}, + } + + spinner, err := yacspin.New(cfg) + if err != nil { + fmt.Fprintf(os.Stderr, "failed to create spinner: %v\n", err) + os.Exit(1) + } + + // handle SIGINT / SIGTERM without needing terminal reset + sigc := make(chan os.Signal, 2) + signal.Notify(sigc, syscall.SIGINT, syscall.SIGTERM) + go func() { + <-sigc + _ = spinner.Stop() + os.Exit(0) + }() + + // run GC once before we start to render + runtime.GC() + + time.Sleep(3 * time.Second) + + for i := 0; i < len(yacspin.CharSets); i++ { + spinner.Message("initial message") + + // interesting charsets for recording sizing: 19, 36 + _ = spinner.CharSet(yacspin.CharSets[i]) + + _ = spinner.Start() + + time.Sleep(5 * time.Second) + + spinner.Message("updated message") + + time.Sleep(5 * time.Second) + + _ = spinner.Stop() + } +} diff --git a/examples/demo/scripts/ffmpeg.sh b/examples/demo/scripts/ffmpeg.sh new file mode 100644 index 0000000..e55c9dd --- /dev/null +++ b/examples/demo/scripts/ffmpeg.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +#### +# +# Convert *.mp4 files in the current directory to GIFs at 10 FPS +# +#### + +function main() { + for file in *.mp4; + do + basename=$(echo "${file}" | sed -e 's/\.mp4$//') + + ffmpeg -i "${basename}.mp4" -vf "fps=10,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 "${basename}.gif" + done +} + +main diff --git a/examples/demo/scripts/rename.go b/examples/demo/scripts/rename.go new file mode 100644 index 0000000..9a72e36 --- /dev/null +++ b/examples/demo/scripts/rename.go @@ -0,0 +1,62 @@ +package main + +import ( + "flag" + "fmt" + "os" + "path/filepath" + "strconv" + "strings" + "syscall" +) + +func main() { + var sim bool + var glob string + + flag.BoolVar(&sim, "sim", false, "simulate") + flag.StringVar(&glob, "glob", "", "glob to use for matching files, must end in *.gif") + flag.Parse() + + if !strings.HasSuffix(glob, "*.gif") { + fmt.Fprintln(os.Stderr, "-glob flag required and must end in *.gif") + os.Exit(int(syscall.EINVAL)) + } + + m, err := filepath.Glob(glob) + if err != nil { + fmt.Fprintf(os.Stderr, "failed to glob %s: %v\n", glob, err) + os.Exit(1) + } + + if len(m) == 0 { + fmt.Fprintf(os.Stderr, "no files matched glob %s\n", glob) + os.Exit(1) + } + + idx := strings.Index(glob, "*") + + for _, match := range m { + num := strings.TrimSuffix(match[idx:], ".gif") + + ni, err := strconv.Atoi(num) + if err != nil { + fmt.Fprintf(os.Stderr, "failed to convert number in %s to integer: %v\n", match, err) + os.Exit(1) + } + + ni-- + + newName := fmt.Sprintf("%d.gif", ni) + + if sim { + fmt.Printf("would rename %s to %s\n", match, newName) + continue + } + + if err := os.Rename(match, newName); err != nil { + fmt.Fprintf(os.Stderr, "failed to rename %s to %s\n", match, newName) + os.Exit(1) + } + } +}