-
Notifications
You must be signed in to change notification settings - Fork 4
NOT READY: Fix scroll animation on main page #161
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
base: master
Are you sure you want to change the base?
Conversation
JekiXD
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't you think that the scroll logic is a bit too complicated? The camera position and other related stuff could just be interpolated using splines, without gsap
|
@JekiXD, answer on your question (#161 (review)): GSAP do almost all animations transitions related to frontend. This lib do automatic animation interpolation and sync all elements transitions while scroll and state change. It will be hard to replace it's behavior with own manual solution. This will take too much time and all animations must be changed from zero. This isn't correct solution. |
| fn clamp_canvas_size( canvas : &HtmlCanvasElement ) | ||
| { | ||
| let aspect = canvas.client_width() as f32 / canvas.client_height() as f32; | ||
|
|
||
| if canvas.width() > 1920 || canvas.height() > 1080 | ||
| { | ||
| canvas.set_width( ( 1080.0 * aspect ) as u32 ); | ||
| canvas.set_height( 1080 ); | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can make our rendering look bad if user has high resolution screen like 2k or 4k. I think its better to let user decide, for example we can add a check box "Fast performance" and if user clicks it then we decrease resolution
Goal: fix scroll animation on main page
Description: This PR fixes issues related to scroll GSAP animations on main page
What changed: