chore: more spinner style support

This commit is contained in:
JuanZoran 2023-04-04 16:18:18 +08:00
parent da6e717f2c
commit 2ae2effecc
2 changed files with 408 additions and 187 deletions

View File

@ -127,7 +127,7 @@ function M:wait()
local spinner = Trans.style.spinner[opts.spinner]
local times = opts.width - spinner[1]:width()
local size = #spinner
local interval = math.floor(opts.timeout / opts.width)
local interval = math.floor(opts.timeout / times)
self:init_window {
height = 2,

View File

@ -29,248 +29,469 @@
-- SOFTWARE.
return {
dots = {
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
},
dots_negative = { -- dots2
"",
"",
"",
"",
"",
"",
"",
"",
'',
'',
'',
'',
'',
'',
'',
'',
},
dots_snake = { -- dots3
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
},
dots_footsteps = { -- dots10
"",
"",
"",
"",
"",
"",
"",
'',
'',
'',
'',
'',
'',
'',
},
dots_hop = { -- dots11
"",
"",
"",
"",
"",
"",
"",
"",
'',
'',
'',
'',
'',
'',
'',
'',
},
line = {
"-",
"\\",
"|",
"/",
'-',
'\\',
'|',
'/',
},
pipe = {
"",
"",
"",
"",
"",
"",
"",
"",
'',
'',
'',
'',
'',
'',
'',
'',
},
dots_ellipsis = { -- simpleDots
". ",
".. ",
"...",
" ",
'. ',
'.. ',
'...',
' ',
},
dots_scrolling = { -- simpleDotsScrolling
". ",
".. ",
"...",
" ..",
" .",
" ",
'. ',
'.. ',
'...',
' ..',
' .',
' ',
},
star = {
"",
"",
"",
"",
"",
"",
'',
'',
'',
'',
'',
'',
},
flip = {
"_",
"_",
"_",
"-",
"`",
"`",
'_',
'_',
'_',
'-',
'`',
'`',
"'",
"´",
"-",
"_",
"_",
"_",
'´',
'-',
'_',
'_',
'_',
},
hamburger = {
"",
"",
"",
'',
'',
'',
},
grow_vertical = { -- growVertical
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
},
grow_horizontal = { -- growHorizontal
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
},
noise = {
"",
"",
"",
'',
'',
'',
},
dots_bounce = { -- bounce
"",
"",
"",
"",
'',
'',
'',
'',
},
triangle = {
"",
"",
"",
"",
'',
'',
'',
'',
},
arc = {
"",
"",
"",
"",
"",
"",
'',
'',
'',
'',
'',
'',
},
circle = {
"",
"",
"",
'',
'',
'',
},
square_corners = { -- squareCorners
"",
"",
"",
"",
'',
'',
'',
'',
},
circle_quarters = { -- circleQuarters
"",
"",
"",
"",
'',
'',
'',
'',
},
circle_halves = { -- circleHalves
"",
"",
"",
"",
'',
'',
'',
'',
},
dots_toggle = { -- toggle
"",
"",
'',
'',
},
box_toggle = { -- toggle2
"",
"",
'',
'',
},
arrow = {
"",
"",
"",
"",
"",
"",
"",
"",
'',
'',
'',
'',
'',
'',
'',
'',
},
clock = {
"🕛 ",
"🕐 ",
"🕑 ",
"🕒 ",
"🕓 ",
"🕔 ",
"🕕 ",
"🕖 ",
"🕗 ",
"🕘 ",
"🕙 ",
"🕚 ",
'🕛 ',
'🕐 ',
'🕑 ',
'🕒 ',
'🕓 ',
'🕔 ',
'🕕 ',
'🕖 ',
'🕗 ',
'🕘 ',
'🕙 ',
'🕚 ',
},
earth = {
"🌍 ",
"🌎 ",
"🌏 ",
'🌍 ',
'🌎 ',
'🌏 ',
},
moon = {
"🌑 ",
"🌒 ",
"🌓 ",
"🌔 ",
"🌕 ",
"🌖 ",
"🌗 ",
"🌘 ",
'🌑 ',
'🌒 ',
'🌓 ',
'🌔 ',
'🌕 ',
'🌖 ',
'🌗 ',
'🌘 ',
},
dots_pulse = { -- point
"∙∙∙",
"●∙∙",
"∙●∙",
"∙∙●",
"∙∙∙",
'∙∙∙',
'●∙∙',
'∙●∙',
'∙∙●',
'∙∙∙',
},
fistBump = {
'🤜    🤛 ',
'🤜    🤛 ',
'🤜    🤛 ',
' 🤜  🤛  ',
'  🤜🤛   ',
' 🤜✨🤛   ',
'🤜 ✨ 🤛  ',
},
monkey = {
'🙈 ',
'🙈 ',
'🙉 ',
'🙊 '
},
soccerHeader = {
' 🧑⚽️ 🧑 ',
'🧑 ⚽️ 🧑 ',
'🧑 ⚽️ 🧑 ',
'🧑 ⚽️ 🧑 ',
'🧑 ⚽️ 🧑 ',
'🧑 ⚽️ 🧑 ',
'🧑 ⚽️🧑 ',
'🧑 ⚽️ 🧑 ',
'🧑 ⚽️ 🧑 ',
'🧑 ⚽️ 🧑 ',
'🧑 ⚽️ 🧑 ',
'🧑 ⚽️ 🧑 ',
},
weather = {
'☀️ ',
'☀️ ',
'☀️ ',
'🌤 ',
'⛅️ ',
'🌥 ',
'☁️ ',
'🌧 ',
'🌨 ',
'🌧 ',
'🌨 ',
'🌧 ',
'🌨 ',
'',
'🌨 ',
'🌧 ',
'🌨 ',
'☁️ ',
'🌥 ',
'⛅️ ',
'🌤 ',
'☀️ ',
'☀️ ',
},
speaker = {
'🔈 ',
'🔉 ',
'🔊 ',
'🔉 ',
},
smiley = {
'😄 ',
'😝 ',
},
toggle = {
'',
''
},
toggle10 = {
'',
'',
''
},
toggle11 = {
'',
''
},
toggle12 = {
'',
''
},
toggle13 = {
'=',
'*',
'-'
},
toggle2 = {
'',
''
},
toggle3 = {
'',
''
},
toggle4 = {
'',
'',
'',
''
},
toggle5 = {
'',
''
},
toggle6 = {
'',
''
},
toggle7 = {
'',
'⦿'
},
toggle8 = {
'',
''
},
toggle9 = {
'',
''
},
star = {
'',
'',
'',
'',
'',
''
},
star2 = {
'+',
'x',
'*'
},
orangeBluePulse = {
'🔸 ',
'🔶 ',
'🟠 ',
'🟠 ',
'🔶 ',
'🔹 ',
'🔷 ',
'🔵 ',
'🔵 ',
'🔷 ',
},
orangePulse = {
'🔸 ',
'🔶 ',
'🟠 ',
'🟠 ',
'🔶 '
},
mindblown = {
'😐 ',
'😐 ',
'😮 ',
'😮 ',
'😦 ',
'😦 ',
'😧 ',
'😧 ',
'🤯 ',
'💥 ',
'',
'  ',
'  ',
'  ',
},
hearts = {
'💛 ',
'💙 ',
'💜 ',
'💚 ',
'❤️ '
},
fingerDance = {
'🤘 ',
'🤟 ',
'🖖 ',
'',
'🤚 ',
'👆 '
},
christmas = {
'🌲',
'🎄'
},
circleHalves = {
'',
'',
'',
''
},
bouncingBall = {
'( ● )',
'( ● )',
'( ● )',
'( ● )',
'( ●)',
'( ● )',
'( ● )',
'( ● )',
'( ● )',
'(● )',
},
bluePulse = {
'🔹 ',
'🔷 ',
'🔵 ',
'🔵 ',
'🔷 '
},
betaWave = {
'ρββββββ',
'βρβββββ',
'ββρββββ',
'βββρβββ',
'ββββρββ',
'βββββρβ',
'ββββββρ',
},
}