kute.js icon indicating copy to clipboard operation
kute.js copied to clipboard

update/set tween progress programatically

Open HannesGitH opened this issue 3 years ago • 8 comments

i want to set the progress programatically but the update method doesn't work like i expected

see example on codepen

is this an issue with kute itself or am i doing something wrong? if the latter please update the docs on how to use the update method / set progress programatically

PS: yes, i've seen the official way with binding to a slider, but in my actual scenario i dont want a slider (yes i could probably build a workaround with a hidden slider whose mouseevents i trigger programatically, but that would be bad)

HannesGitH avatar Sep 30 '22 08:09 HannesGitH

and even better would be setting the progress of combined tweens (commented in the codepen)

HannesGitH avatar Sep 30 '22 08:09 HannesGitH

Yes, because KUTE was developed different from it's parents (tween.js, raphael, etc). We may have to revisit this at some point in time. I'm thinking on ways to make the tween object even smaller, a bit more flexible, and disconnect a DOM node from it, so you should be able to use it with any UI framework there is.

thednp avatar Oct 01 '22 03:10 thednp

Perhaps this will help.

https://thednp.github.io/kute.js/progress.html

thednp avatar Oct 01 '22 03:10 thednp

Perhaps this will help.

https://thednp.github.io/kute.js/progress.html

yep this is the one i meant

PS: yes, i've seen the official way with binding to a slider, but in my actual scenario i dont want a slider (yes i could probably build a workaround with a hidden slider whose mouseevents i trigger programatically, but that would be bad)

but as you guessed correctly, i want to use it with svelte and have the animationProgress coupled to some state

HannesGitH avatar Oct 01 '22 11:10 HannesGitH

The best I can do right now is to link you the actual ProgressBar, perhaps you can find a way to adapt to your Svelte app.

thednp avatar Oct 01 '22 11:10 thednp

thats where im coming from and https://github.com/thednp/kute.js/blob/9f8b874567601d038161ee3d1fbac3a692db39bc/src/util/progressBar.js#L78 gave me the idea for my codepen linked above.

but thanks for your help :) (imma switch to flubber2 for now tho)

HannesGitH avatar Oct 01 '22 13:10 HannesGitH

Was hoping this would be possible. Any eta on a feature like this or no?

b2hinkle avatar Oct 05 '22 03:10 b2hinkle

This feature would be nice indeed, however we would have to rework the entire thing, decouple the target HTMLElement from the tween object. I believe this should be achievable but hard to find time for it these days.

thednp avatar Oct 05 '22 17:10 thednp