Skip to content

Conversation

@vadimb892
Copy link
Collaborator

Goal: fix scroll animation on main page

Description: This PR fixes issues related to scroll GSAP animations on main page

What changed:

  • used wheel event instead scroll
  • handled Firefox browser async scroll case

Copy link
Collaborator

@JekiXD JekiXD left a 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

@vadimb892
Copy link
Collaborator Author

@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.

Comment on lines +96 to +106
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 );
}
}

Copy link
Collaborator

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

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

Successfully merging this pull request may close these issues.

4 participants