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 spinner = Trans.style.spinner[opts.spinner]
local times = opts.width - spinner[1]:width() local times = opts.width - spinner[1]:width()
local size = #spinner local size = #spinner
local interval = math.floor(opts.timeout / opts.width) local interval = math.floor(opts.timeout / times)
self:init_window { self:init_window {
height = 2, height = 2,

View File

@ -29,248 +29,469 @@
-- SOFTWARE. -- SOFTWARE.
return { return {
dots = { dots = {
"", '',
"", '',
"", '',
"", '',
"", '',
"", '',
"", '',
"", '',
"", '',
"", '',
}, },
dots_negative = { -- dots2 dots_negative = { -- dots2
"", '',
"", '',
"", '',
"", '',
"", '',
"", '',
"", '',
"", '',
}, },
dots_snake = { -- dots3 dots_snake = { -- dots3
"", '',
"", '',
"", '',
"", '',
"", '',
"", '',
"", '',
"", '',
"", '',
"", '',
"", '',
"", '',
"", '',
"", '',
"", '',
"", '',
"", '',
}, },
dots_footsteps = { -- dots10 dots_footsteps = { -- dots10
"", '',
"", '',
"", '',
"", '',
"", '',
"", '',
"", '',
}, },
dots_hop = { -- dots11 dots_hop = { -- dots11
"", '',
"", '',
"", '',
"", '',
"", '',
"", '',
"", '',
"", '',
}, },
line = { line = {
"-", '-',
"\\", '\\',
"|", '|',
"/", '/',
}, },
pipe = { pipe = {
"", '',
"", '',
"", '',
"", '',
"", '',
"", '',
"", '',
"", '',
}, },
dots_ellipsis = { -- simpleDots dots_ellipsis = { -- simpleDots
". ", '. ',
".. ", '.. ',
"...", '...',
" ", ' ',
}, },
dots_scrolling = { -- simpleDotsScrolling dots_scrolling = { -- simpleDotsScrolling
". ", '. ',
".. ", '.. ',
"...", '...',
" ..", ' ..',
" .", ' .',
" ", ' ',
}, },
star = { star = {
"", '',
"", '',
"", '',
"", '',
"", '',
"", '',
}, },
flip = { flip = {
"_", '_',
"_", '_',
"_", '_',
"-", '-',
"`", '`',
"`", '`',
"'", "'",
"´", '´',
"-", '-',
"_", '_',
"_", '_',
"_", '_',
}, },
hamburger = { hamburger = {
"", '',
"", '',
"", '',
}, },
grow_vertical = { -- growVertical grow_vertical = { -- growVertical
"", '',
"", '',
"", '',
"", '',
"", '',
"", '',
"", '',
"", '',
"", '',
"", '',
}, },
grow_horizontal = { -- growHorizontal grow_horizontal = { -- growHorizontal
"", '',
"", '',
"", '',
"", '',
"", '',
"", '',
"", '',
"", '',
"", '',
"", '',
"", '',
"", '',
}, },
noise = { noise = {
"", '',
"", '',
"", '',
}, },
dots_bounce = { -- bounce dots_bounce = { -- bounce
"", '',
"", '',
"", '',
"", '',
}, },
triangle = { triangle = {
"", '',
"", '',
"", '',
"", '',
}, },
arc = { arc = {
"", '',
"", '',
"", '',
"", '',
"", '',
"", '',
}, },
circle = { circle = {
"", '',
"", '',
"", '',
}, },
square_corners = { -- squareCorners square_corners = { -- squareCorners
"", '',
"", '',
"", '',
"", '',
}, },
circle_quarters = { -- circleQuarters circle_quarters = { -- circleQuarters
"", '',
"", '',
"", '',
"", '',
}, },
circle_halves = { -- circleHalves circle_halves = { -- circleHalves
"", '',
"", '',
"", '',
"", '',
}, },
dots_toggle = { -- toggle dots_toggle = { -- toggle
"", '',
"", '',
}, },
box_toggle = { -- toggle2 box_toggle = { -- toggle2
"", '',
"", '',
}, },
arrow = { arrow = {
"", '',
"", '',
"", '',
"", '',
"", '',
"", '',
"", '',
"", '',
}, },
clock = { clock = {
"🕛 ", '🕛 ',
"🕐 ", '🕐 ',
"🕑 ", '🕑 ',
"🕒 ", '🕒 ',
"🕓 ", '🕓 ',
"🕔 ", '🕔 ',
"🕕 ", '🕕 ',
"🕖 ", '🕖 ',
"🕗 ", '🕗 ',
"🕘 ", '🕘 ',
"🕙 ", '🕙 ',
"🕚 ", '🕚 ',
}, },
earth = { earth = {
"🌍 ", '🌍 ',
"🌎 ", '🌎 ',
"🌏 ", '🌏 ',
}, },
moon = { moon = {
"🌑 ", '🌑 ',
"🌒 ", '🌒 ',
"🌓 ", '🌓 ',
"🌔 ", '🌔 ',
"🌕 ", '🌕 ',
"🌖 ", '🌖 ',
"🌗 ", '🌗 ',
"🌘 ", '🌘 ',
}, },
dots_pulse = { -- point 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 = {
'ρββββββ',
'βρβββββ',
'ββρββββ',
'βββρβββ',
'ββββρββ',
'βββββρβ',
'ββββββρ',
}, },
} }