Replies: 5 comments 4 replies
-
It occurred to me that this particular plugin would not support input elements... that's ok. |
Beta Was this translation helpful? Give feedback.
-
Good suggestion. I am waiting for the next version to create the odometer plugin with this simple and effective interface :) |
Beta Was this translation helpful? Give feedback.
-
Ready! You can check https://github.com/msoler75/odometer_countup.js and test it? |
Beta Was this translation helpful? Give feedback.
-
Looks good to me! Can you publish a package on npm and add install instructions to your repo? Once that is done I will update the README and link to your repo. |
Beta Was this translation helpful? Give feedback.
-
@msoler75 just wanted to check in. Were you able to publish your plugin? I'd love to add it to the countUp README |
Beta Was this translation helpful? Give feedback.
-
Recently, @msoler75 made PR #304 into CountUp with a new animation style:
It's very cool! But rather than merge his code, (about 130 lines) I would like to create a plugin interface for CountUp. This would allow plugin authors to get credit for and maintain their code, prevent shipping unused code, and allow for endless alternative animations of CountUp.
As part of supporting plugins, I would like to call out each available plugin in the README of CountUp with a sample gif, explanation, package name and author credit. I would also add an explanation of how to use plugins in general.
Which brings me to the API. Marcel's code gets invoked in
printValue
, and just needs a reference tothis.el
. So if plugins where exported as a class with a render function, we could use it like this:The plugin interface could look like this. It just needs to implement a render function that accepts the target element and a string of the formatted number. Render would get called in place of the existing
printValue
on each frame.So the Odometer class might look something like this:
Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions