-
Notifications
You must be signed in to change notification settings - Fork 86
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
Animate only if the widgets are inside the ViewPort or visible portion of the screen [Web] #106
Comments
@gskinner any input, please? |
Sorry, I'm not totally clear on which are you asking for?
|
@gskinner All the animations are instantiated at once after the website loads, so when I reach the animation attached widgets by scrolling down, nothing happens as those have already been instantiated in the website's initial load. |
Yes it should be fine to animate only once it is visible.
|
It might be possible to create an foo.animate(
// names TBD
// debounce = time to delay before playing
// threshold = how much needs to be onscreen?
adapter: OnScreenAdapter(debounce: 500.ms, threshold: 1.0)
).fadeIn() Another option would be a simple helper class that wraps the child, and starts a controller when the item becomes visible on screen. This would likely be messier though, as it would require creating the controller externally, with all the baggage that involves (state, disposal, etc). A final approach could be to have a helper method that can be called from (or passed to) onInit, that would manage it for you. Sketch: // getOnScreenWatcher would return a function that accepts the controller from onInit
// pauses the animation, and sets everything up.
foo.animate(onInit: getOnScreenWatcher(debounce: 500.ms, etc)).fadeIn() I'll add looking at these options to my backlog, but feel free to take a stab at a PR. |
i dint understood could you please explain how to acheive this behaviour |
did you find any solution? @TechSatya |
I have multiple distinct widgets inside a column and every widget has some animation effects, upon the user reaching the respective widget by scrolling they will animate which I want, but before that, if they are hidden from the user's view part means not inside the viewport, then they will not animate.
But here the issue is they all are animating at once after the website loads.
Reference - https://www.stryve.online/
The text was updated successfully, but these errors were encountered: