Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: more anime combinators #161

Open
4 tasks
j-hui opened this issue Nov 13, 2023 · 0 comments · May be fixed by #251
Open
4 tasks

feat: more anime combinators #161

j-hui opened this issue Nov 13, 2023 · 0 comments · May be fixed by #251
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@j-hui
Copy link
Owner

j-hui commented Nov 13, 2023

Animations like the ones suggested in #132 should not need to be hard-coded into our spinner library, since they just involve translating a static string across an empty space. Such animation frames can easily be generated with something like this:

-- UNTESTED CODE btw
local function bouncer(icon, width)
  local frames = {}
  local padding = width - vim.fn.strdisplaywidth(icon)
  assert(padding > 0)
  for i=0, padding do
    table.insert(frames, string.format("%s%s%s", string.rep(" ", i), icon, string.rep(" ", width - i))
  end
  for i=1, padding do
    table.insert(frames, string.format("%s%s%s", string.rep(" ", width - i), icon, string.rep(" ", width))
  end
  return frames
end

This kind of thing can and should be added to spinner as a combinator so that users can roll their own anime

Other combinator ideas (resurrect HTML tags with vengeance):

  • <marquee>-style scrolling text
  • <blink>-style blinkers

Fidget could even support animated epic gamer highlights (though this will require supporting _style fields as functions):

  • "breathing" highlights that fade brighter and darker 😎
  • rainbow highlights 🌈
@j-hui j-hui added enhancement New feature or request good first issue Good for newcomers labels Nov 13, 2023
@j-hui j-hui linked a pull request Jul 13, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant