/
spinners.go
652 lines (647 loc) · 15.2 KB
/
spinners.go
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
//DO NOT EDIT : this file was automatically generated.
package spin
// Spinner defines a spinner widget
type Spinner struct {
Name Name
Interval int
Frames []string
}
// Name represents a name for a spinner item.
type Name uint
// available spinners
const (
Unknown Name = iota
Arc
Arrow
Arrow2
Arrow3
Balloon
Balloon2
Bounce
BouncingBall
BouncingBar
BoxBounce
BoxBounce2
Christmas
Circle
CircleHalves
CircleQuarters
Clock
Dots
Dots10
Dots11
Dots12
Dots2
Dots3
Dots4
Dots5
Dots6
Dots7
Dots8
Dots9
Dqpb
Earth
Flip
Grenade
GrowHorizontal
GrowVertical
Hamburger
Hearts
Layer
Line
Line2
Monkey
Moon
Noise
Pipe
Point
Pong
Runner
Shark
SimpleDots
SimpleDotsScrolling
Smiley
SquareCorners
Squish
Star
Star2
Toggle
Toggle10
Toggle11
Toggle12
Toggle13
Toggle2
Toggle3
Toggle4
Toggle5
Toggle6
Toggle7
Toggle8
Toggle9
Triangle
Weather
)
func (s Name) String() string {
switch s {
case Arc:
return "arc"
case Arrow:
return "arrow"
case Arrow2:
return "arrow2"
case Arrow3:
return "arrow3"
case Balloon:
return "balloon"
case Balloon2:
return "balloon2"
case Bounce:
return "bounce"
case BouncingBall:
return "bouncingBall"
case BouncingBar:
return "bouncingBar"
case BoxBounce:
return "boxBounce"
case BoxBounce2:
return "boxBounce2"
case Christmas:
return "christmas"
case Circle:
return "circle"
case CircleHalves:
return "circleHalves"
case CircleQuarters:
return "circleQuarters"
case Clock:
return "clock"
case Dots:
return "dots"
case Dots10:
return "dots10"
case Dots11:
return "dots11"
case Dots12:
return "dots12"
case Dots2:
return "dots2"
case Dots3:
return "dots3"
case Dots4:
return "dots4"
case Dots5:
return "dots5"
case Dots6:
return "dots6"
case Dots7:
return "dots7"
case Dots8:
return "dots8"
case Dots9:
return "dots9"
case Dqpb:
return "dqpb"
case Earth:
return "earth"
case Flip:
return "flip"
case Grenade:
return "grenade"
case GrowHorizontal:
return "growHorizontal"
case GrowVertical:
return "growVertical"
case Hamburger:
return "hamburger"
case Hearts:
return "hearts"
case Layer:
return "layer"
case Line:
return "line"
case Line2:
return "line2"
case Monkey:
return "monkey"
case Moon:
return "moon"
case Noise:
return "noise"
case Pipe:
return "pipe"
case Point:
return "point"
case Pong:
return "pong"
case Runner:
return "runner"
case Shark:
return "shark"
case SimpleDots:
return "simpleDots"
case SimpleDotsScrolling:
return "simpleDotsScrolling"
case Smiley:
return "smiley"
case SquareCorners:
return "squareCorners"
case Squish:
return "squish"
case Star:
return "star"
case Star2:
return "star2"
case Toggle:
return "toggle"
case Toggle10:
return "toggle10"
case Toggle11:
return "toggle11"
case Toggle12:
return "toggle12"
case Toggle13:
return "toggle13"
case Toggle2:
return "toggle2"
case Toggle3:
return "toggle3"
case Toggle4:
return "toggle4"
case Toggle5:
return "toggle5"
case Toggle6:
return "toggle6"
case Toggle7:
return "toggle7"
case Toggle8:
return "toggle8"
case Toggle9:
return "toggle9"
case Triangle:
return "triangle"
case Weather:
return "weather"
default:
return ""
}
}
func Get(name Name) Spinner {
switch name {
case Arc:
return Spinner{
Name: Arc,
Interval: 100,
Frames: []string{`◜`, `◠`, `◝`, `◞`, `◡`, `◟`},
}
case Arrow:
return Spinner{
Name: Arrow,
Interval: 100,
Frames: []string{`←`, `↖`, `↑`, `↗`, `→`, `↘`, `↓`, `↙`},
}
case Arrow2:
return Spinner{
Name: Arrow2,
Interval: 80,
Frames: []string{`⬆️ `, `↗️ `, `➡️ `, `↘️ `, `⬇️ `, `↙️ `, `⬅️ `, `↖️ `},
}
case Arrow3:
return Spinner{
Name: Arrow3,
Interval: 120,
Frames: []string{`▹▹▹▹▹`, `▸▹▹▹▹`, `▹▸▹▹▹`, `▹▹▸▹▹`, `▹▹▹▸▹`, `▹▹▹▹▸`},
}
case Balloon:
return Spinner{
Name: Balloon,
Interval: 140,
Frames: []string{` `, `.`, `o`, `O`, `@`, `*`, ` `},
}
case Balloon2:
return Spinner{
Name: Balloon2,
Interval: 120,
Frames: []string{`.`, `o`, `O`, `°`, `O`, `o`, `.`},
}
case Bounce:
return Spinner{
Name: Bounce,
Interval: 120,
Frames: []string{`⠁`, `⠂`, `⠄`, `⠂`},
}
case BouncingBall:
return Spinner{
Name: BouncingBall,
Interval: 80,
Frames: []string{`( ● )`, `( ● )`, `( ● )`, `( ● )`, `( ●)`, `( ● )`, `( ● )`, `( ● )`, `( ● )`, `(● )`},
}
case BouncingBar:
return Spinner{
Name: BouncingBar,
Interval: 80,
Frames: []string{`[ ]`, `[= ]`, `[== ]`, `[=== ]`, `[ ===]`, `[ ==]`, `[ =]`, `[ ]`, `[ =]`, `[ ==]`, `[ ===]`, `[====]`, `[=== ]`, `[== ]`, `[= ]`},
}
case BoxBounce:
return Spinner{
Name: BoxBounce,
Interval: 120,
Frames: []string{`▖`, `▘`, `▝`, `▗`},
}
case BoxBounce2:
return Spinner{
Name: BoxBounce2,
Interval: 100,
Frames: []string{`▌`, `▀`, `▐`, `▄`},
}
case Christmas:
return Spinner{
Name: Christmas,
Interval: 400,
Frames: []string{`🌲`, `🎄`},
}
case Circle:
return Spinner{
Name: Circle,
Interval: 120,
Frames: []string{`◡`, `⊙`, `◠`},
}
case CircleHalves:
return Spinner{
Name: CircleHalves,
Interval: 50,
Frames: []string{`◐`, `◓`, `◑`, `◒`},
}
case CircleQuarters:
return Spinner{
Name: CircleQuarters,
Interval: 120,
Frames: []string{`◴`, `◷`, `◶`, `◵`},
}
case Clock:
return Spinner{
Name: Clock,
Interval: 100,
Frames: []string{`🕛 `, `🕐 `, `🕑 `, `🕒 `, `🕓 `, `🕔 `, `🕕 `, `🕖 `, `🕗 `, `🕘 `, `🕙 `, `🕚 `},
}
case Dots:
return Spinner{
Name: Dots,
Interval: 80,
Frames: []string{`⠋`, `⠙`, `⠹`, `⠸`, `⠼`, `⠴`, `⠦`, `⠧`, `⠇`, `⠏`},
}
case Dots10:
return Spinner{
Name: Dots10,
Interval: 80,
Frames: []string{`⢄`, `⢂`, `⢁`, `⡁`, `⡈`, `⡐`, `⡠`},
}
case Dots11:
return Spinner{
Name: Dots11,
Interval: 100,
Frames: []string{`⠁`, `⠂`, `⠄`, `⡀`, `⢀`, `⠠`, `⠐`, `⠈`},
}
case Dots12:
return Spinner{
Name: Dots12,
Interval: 80,
Frames: []string{`⢀⠀`, `⡀⠀`, `⠄⠀`, `⢂⠀`, `⡂⠀`, `⠅⠀`, `⢃⠀`, `⡃⠀`, `⠍⠀`, `⢋⠀`, `⡋⠀`, `⠍⠁`, `⢋⠁`, `⡋⠁`, `⠍⠉`, `⠋⠉`, `⠋⠉`, `⠉⠙`, `⠉⠙`, `⠉⠩`, `⠈⢙`, `⠈⡙`, `⢈⠩`, `⡀⢙`, `⠄⡙`, `⢂⠩`, `⡂⢘`, `⠅⡘`, `⢃⠨`, `⡃⢐`, `⠍⡐`, `⢋⠠`, `⡋⢀`, `⠍⡁`, `⢋⠁`, `⡋⠁`, `⠍⠉`, `⠋⠉`, `⠋⠉`, `⠉⠙`, `⠉⠙`, `⠉⠩`, `⠈⢙`, `⠈⡙`, `⠈⠩`, `⠀⢙`, `⠀⡙`, `⠀⠩`, `⠀⢘`, `⠀⡘`, `⠀⠨`, `⠀⢐`, `⠀⡐`, `⠀⠠`, `⠀⢀`, `⠀⡀`},
}
case Dots2:
return Spinner{
Name: Dots2,
Interval: 80,
Frames: []string{`⣾`, `⣽`, `⣻`, `⢿`, `⡿`, `⣟`, `⣯`, `⣷`},
}
case Dots3:
return Spinner{
Name: Dots3,
Interval: 80,
Frames: []string{`⠋`, `⠙`, `⠚`, `⠞`, `⠖`, `⠦`, `⠴`, `⠲`, `⠳`, `⠓`},
}
case Dots4:
return Spinner{
Name: Dots4,
Interval: 80,
Frames: []string{`⠄`, `⠆`, `⠇`, `⠋`, `⠙`, `⠸`, `⠰`, `⠠`, `⠰`, `⠸`, `⠙`, `⠋`, `⠇`, `⠆`},
}
case Dots5:
return Spinner{
Name: Dots5,
Interval: 80,
Frames: []string{`⠋`, `⠙`, `⠚`, `⠒`, `⠂`, `⠂`, `⠒`, `⠲`, `⠴`, `⠦`, `⠖`, `⠒`, `⠐`, `⠐`, `⠒`, `⠓`, `⠋`},
}
case Dots6:
return Spinner{
Name: Dots6,
Interval: 80,
Frames: []string{`⠁`, `⠉`, `⠙`, `⠚`, `⠒`, `⠂`, `⠂`, `⠒`, `⠲`, `⠴`, `⠤`, `⠄`, `⠄`, `⠤`, `⠴`, `⠲`, `⠒`, `⠂`, `⠂`, `⠒`, `⠚`, `⠙`, `⠉`, `⠁`},
}
case Dots7:
return Spinner{
Name: Dots7,
Interval: 80,
Frames: []string{`⠈`, `⠉`, `⠋`, `⠓`, `⠒`, `⠐`, `⠐`, `⠒`, `⠖`, `⠦`, `⠤`, `⠠`, `⠠`, `⠤`, `⠦`, `⠖`, `⠒`, `⠐`, `⠐`, `⠒`, `⠓`, `⠋`, `⠉`, `⠈`},
}
case Dots8:
return Spinner{
Name: Dots8,
Interval: 80,
Frames: []string{`⠁`, `⠁`, `⠉`, `⠙`, `⠚`, `⠒`, `⠂`, `⠂`, `⠒`, `⠲`, `⠴`, `⠤`, `⠄`, `⠄`, `⠤`, `⠠`, `⠠`, `⠤`, `⠦`, `⠖`, `⠒`, `⠐`, `⠐`, `⠒`, `⠓`, `⠋`, `⠉`, `⠈`, `⠈`},
}
case Dots9:
return Spinner{
Name: Dots9,
Interval: 80,
Frames: []string{`⢹`, `⢺`, `⢼`, `⣸`, `⣇`, `⡧`, `⡗`, `⡏`},
}
case Dqpb:
return Spinner{
Name: Dqpb,
Interval: 100,
Frames: []string{`d`, `q`, `p`, `b`},
}
case Earth:
return Spinner{
Name: Earth,
Interval: 180,
Frames: []string{`🌍 `, `🌎 `, `🌏 `},
}
case Flip:
return Spinner{
Name: Flip,
Interval: 70,
Frames: []string{`_`, `_`, `_`, `-`, "`", "`", `'`, `´`, `-`, `_`, `_`, `_`},
}
case Grenade:
return Spinner{
Name: Grenade,
Interval: 80,
Frames: []string{`، `, `′ `, ` ´ `, ` ‾ `, ` ⸌`, ` ⸊`, ` |`, ` ⁎`, ` ⁕`, ` ෴ `, ` ⁓`, ` `, ` `, ` `},
}
case GrowHorizontal:
return Spinner{
Name: GrowHorizontal,
Interval: 120,
Frames: []string{`▏`, `▎`, `▍`, `▌`, `▋`, `▊`, `▉`, `▊`, `▋`, `▌`, `▍`, `▎`},
}
case GrowVertical:
return Spinner{
Name: GrowVertical,
Interval: 120,
Frames: []string{`▁`, `▃`, `▄`, `▅`, `▆`, `▇`, `▆`, `▅`, `▄`, `▃`},
}
case Hamburger:
return Spinner{
Name: Hamburger,
Interval: 100,
Frames: []string{`☱`, `☲`, `☴`},
}
case Hearts:
return Spinner{
Name: Hearts,
Interval: 100,
Frames: []string{`💛 `, `💙 `, `💜 `, `💚 `, `❤️ `},
}
case Layer:
return Spinner{
Name: Layer,
Interval: 150,
Frames: []string{`-`, `=`, `≡`},
}
case Line:
return Spinner{
Name: Line,
Interval: 130,
Frames: []string{`-`, `\`, `|`, `/`},
}
case Line2:
return Spinner{
Name: Line2,
Interval: 100,
Frames: []string{`⠂`, `-`, `–`, `—`, `–`, `-`},
}
case Monkey:
return Spinner{
Name: Monkey,
Interval: 300,
Frames: []string{`🙈 `, `🙈 `, `🙉 `, `🙊 `},
}
case Moon:
return Spinner{
Name: Moon,
Interval: 80,
Frames: []string{`🌑 `, `🌒 `, `🌓 `, `🌔 `, `🌕 `, `🌖 `, `🌗 `, `🌘 `},
}
case Noise:
return Spinner{
Name: Noise,
Interval: 100,
Frames: []string{`▓`, `▒`, `░`},
}
case Pipe:
return Spinner{
Name: Pipe,
Interval: 100,
Frames: []string{`┤`, `┘`, `┴`, `└`, `├`, `┌`, `┬`, `┐`},
}
case Point:
return Spinner{
Name: Point,
Interval: 125,
Frames: []string{`∙∙∙`, `●∙∙`, `∙●∙`, `∙∙●`, `∙∙∙`},
}
case Pong:
return Spinner{
Name: Pong,
Interval: 80,
Frames: []string{`▐⠂ ▌`, `▐⠈ ▌`, `▐ ⠂ ▌`, `▐ ⠠ ▌`, `▐ ⡀ ▌`, `▐ ⠠ ▌`, `▐ ⠂ ▌`, `▐ ⠈ ▌`, `▐ ⠂ ▌`, `▐ ⠠ ▌`, `▐ ⡀ ▌`, `▐ ⠠ ▌`, `▐ ⠂ ▌`, `▐ ⠈ ▌`, `▐ ⠂▌`, `▐ ⠠▌`, `▐ ⡀▌`, `▐ ⠠ ▌`, `▐ ⠂ ▌`, `▐ ⠈ ▌`, `▐ ⠂ ▌`, `▐ ⠠ ▌`, `▐ ⡀ ▌`, `▐ ⠠ ▌`, `▐ ⠂ ▌`, `▐ ⠈ ▌`, `▐ ⠂ ▌`, `▐ ⠠ ▌`, `▐ ⡀ ▌`, `▐⠠ ▌`},
}
case Runner:
return Spinner{
Name: Runner,
Interval: 140,
Frames: []string{`🚶 `, `🏃 `},
}
case Shark:
return Spinner{
Name: Shark,
Interval: 120,
Frames: []string{`▐|\____________▌`, `▐_|\___________▌`, `▐__|\__________▌`, `▐___|\_________▌`, `▐____|\________▌`, `▐_____|\_______▌`, `▐______|\______▌`, `▐_______|\_____▌`, `▐________|\____▌`, `▐_________|\___▌`, `▐__________|\__▌`, `▐___________|\_▌`, `▐____________|\▌`, `▐____________/|▌`, `▐___________/|_▌`, `▐__________/|__▌`, `▐_________/|___▌`, `▐________/|____▌`, `▐_______/|_____▌`, `▐______/|______▌`, `▐_____/|_______▌`, `▐____/|________▌`, `▐___/|_________▌`, `▐__/|__________▌`, `▐_/|___________▌`, `▐/|____________▌`},
}
case SimpleDots:
return Spinner{
Name: SimpleDots,
Interval: 400,
Frames: []string{`. `, `.. `, `...`, ` `},
}
case SimpleDotsScrolling:
return Spinner{
Name: SimpleDotsScrolling,
Interval: 200,
Frames: []string{`. `, `.. `, `...`, ` ..`, ` .`, ` `},
}
case Smiley:
return Spinner{
Name: Smiley,
Interval: 200,
Frames: []string{`😄 `, `😝 `},
}
case SquareCorners:
return Spinner{
Name: SquareCorners,
Interval: 180,
Frames: []string{`◰`, `◳`, `◲`, `◱`},
}
case Squish:
return Spinner{
Name: Squish,
Interval: 100,
Frames: []string{`╫`, `╪`},
}
case Star:
return Spinner{
Name: Star,
Interval: 70,
Frames: []string{`✶`, `✸`, `✹`, `✺`, `✹`, `✷`},
}
case Star2:
return Spinner{
Name: Star2,
Interval: 80,
Frames: []string{`+`, `x`, `*`},
}
case Toggle:
return Spinner{
Name: Toggle,
Interval: 250,
Frames: []string{`⊶`, `⊷`},
}
case Toggle10:
return Spinner{
Name: Toggle10,
Interval: 100,
Frames: []string{`㊂`, `㊀`, `㊁`},
}
case Toggle11:
return Spinner{
Name: Toggle11,
Interval: 50,
Frames: []string{`⧇`, `⧆`},
}
case Toggle12:
return Spinner{
Name: Toggle12,
Interval: 120,
Frames: []string{`☗`, `☖`},
}
case Toggle13:
return Spinner{
Name: Toggle13,
Interval: 80,
Frames: []string{`=`, `*`, `-`},
}
case Toggle2:
return Spinner{
Name: Toggle2,
Interval: 80,
Frames: []string{`▫`, `▪`},
}
case Toggle3:
return Spinner{
Name: Toggle3,
Interval: 120,
Frames: []string{`□`, `■`},
}
case Toggle4:
return Spinner{
Name: Toggle4,
Interval: 100,
Frames: []string{`■`, `□`, `▪`, `▫`},
}
case Toggle5:
return Spinner{
Name: Toggle5,
Interval: 100,
Frames: []string{`▮`, `▯`},
}
case Toggle6:
return Spinner{
Name: Toggle6,
Interval: 300,
Frames: []string{`ဝ`, `၀`},
}
case Toggle7:
return Spinner{
Name: Toggle7,
Interval: 80,
Frames: []string{`⦾`, `⦿`},
}
case Toggle8:
return Spinner{
Name: Toggle8,
Interval: 100,
Frames: []string{`◍`, `◌`},
}
case Toggle9:
return Spinner{
Name: Toggle9,
Interval: 100,
Frames: []string{`◉`, `◎`},
}
case Triangle:
return Spinner{
Name: Triangle,
Interval: 50,
Frames: []string{`◢`, `◣`, `◤`, `◥`},
}
case Weather:
return Spinner{
Name: Weather,
Interval: 100,
Frames: []string{`☀️ `, `☀️ `, `☀️ `, `🌤 `, `⛅️ `, `🌥 `, `☁️ `, `🌧 `, `🌨 `, `🌧 `, `🌨 `, `🌧 `, `🌨 `, `⛈ `, `🌨 `, `🌧 `, `🌨 `, `☁️ `, `🌥 `, `⛅️ `, `🌤 `, `☀️ `, `☀️ `},
}
default:
return Spinner{}
}
}