feat: more anime combinators
- Dominant language
- Lua
- Stars
- 2.6k
- Forks
- 83
- PR merge metrics
- No merged PRs in 30d
Description
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:
```lua
-- 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):
- [ ] ``-style scrolling text
- [ ] ``-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 🌈
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by inspecting the existing spinner combinator API and how animation frames are represented. Use the proposed bouncer example as the first scope, then review whether marquee- and blink-style combinators fit the same interface. Done means users can compose these animations without hard-coding every frame, with coverage for the supported behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100