metasidd / Orb

A mesmerizing orb, fully designed in SwiftUI.
https://siddhant.ca
MIT License
180 stars 7 forks source link

Feature Request: Start and Stop Orb Animation #4

Open seyhunak opened 3 days ago

seyhunak commented 3 days ago

Thanks @metasidd Great work, tested with demo app works well.

Suggesting a feature, It will be great if OrbView can take start() and stop() like methods to pause/resume Orb animation would be great, that will help to design dynamic Orb animation on specific events.

metasidd commented 2 days ago

@seyhunak, you can control the speed with the timing right now. Though, changing this might restart the orb animations because it refreshes the views.

Link: https://github.com/metasidd/Orb?tab=readme-ov-file#available-configuration-options Property: speed: 60

Lmk if that helps.

seyhunak commented 2 days ago

Let me try with that. My understanding is that seems speed property can only effected once Orb configuration object initialized, it will make speed like constant speed: 60 .

My use-case is the stop and re-animate basis on such kind of during event time (for example like loader animation during API call etc.).

Thanks @metasidd

metasidd commented 2 days ago

Got it. Yes, I don't have various states for the orb right now. I'd imagine having states like idle(speed: int), thinking(speed: Int) etc. Then any change in state would just smoothly transition between them.

This may take a little bit of work to make happen... Not in my plan for the next 2-4 weeks at least. Keep me updated though!