Skip to content
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

Resizing? #3

Closed
cmalpeli opened this issue Mar 13, 2023 · 14 comments
Closed

Resizing? #3

cmalpeli opened this issue Mar 13, 2023 · 14 comments

Comments

@cmalpeli
Copy link

Great library! I noticed that resizing the browser on desktop causes the previously animated content to disappear. It doesn't seem to re-animate consistently either after resize. Is this s known issue? You can replicate it on the demo site.

@volkandkaya
Copy link
Collaborator

volkandkaya commented Mar 31, 2023

Confirmed the issue, i will need to add a check after to readd elements in view and most likely a throttle.

@cmalpeli
Copy link
Author

Hi @volkandkaya did you happen to have a chance to look into this issue?

@RyanRoberts
Copy link

It would be good to get a fix for this :)

@volkandkaya
Copy link
Collaborator

Fixed, please give it a try.

@RyanRoberts
Copy link

Thanks for looking into that and updating it.

It does seem to work for the most part but the animation is still triggered again when the browser is resized. I wasn't too concerned on desktop but when I scroll down in iOS Safari's UI minimises and when you scroll up to reveals again, this seems to be triggering the animations (I guess it's a viewport or window size change?).

I can provide an example site I'm working on but I'd have to share that privately.

@volkandkaya
Copy link
Collaborator

I didn't think about mobile height changes, so I removed some code that might have fixed that (reduce bundle size).

I will test tomorrow on a Safari device.

@volkandkaya volkandkaya reopened this Jul 26, 2023
@RyanRoberts
Copy link

Cool, thanks. I'm not great with JS so I don't have my own suggestions to make but with the help of a certain AI I did come up with this temporary solution that may help, or not. https://gist.github.com/RyanRoberts/6260530cf100c37a1f3bb3795dcbd1a3/revisions?diff=split

Thanks for looking into it.

@volkandkaya
Copy link
Collaborator

When resizing it needs to rerun initElement to get offsets and set the trigger for each element. I had some performance and other issues. This seemed to be the best solution.

@volkandkaya
Copy link
Collaborator

Updated can you try 1.0.5 @RyanRoberts

@RyanRoberts
Copy link

That's working great! Thanks for the update.

@cmalpeli
Copy link
Author

Thanks @volkandkaya - I think this may still be an issue on desktop resize. Was this fix just for mobile?

@volkandkaya
Copy link
Collaborator

volkandkaya commented Jul 29, 2023

What issue are you having on desktop resizing @cmalpeli ?

I fixed the issue where it didn't come back after resizing and reanimates.

@cmalpeli
Copy link
Author

@volkandkaya on desktop, if I resize, the previously animated content disappears and then re-animates on the next scroll event.

@cmalpeli
Copy link
Author

@volkandkaya if you see here on the example site, all the animated content disappears and then re-animates on scroll when you resize the window:

https://versoly.com/taos#fade

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants