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

Add intersection observer #2337

Merged
merged 2 commits into from
Mar 8, 2023

Conversation

metamoni
Copy link
Contributor

@metamoni metamoni commented Feb 28, 2023

PR Summary:

This PR adds an animations script with an intersection observer that will watch elements with a class of scroll-animation__trigger and add a scroll-animation__trigger--active class as they scroll them into view.

Why are these changes introduced?

Fixes #2316

What approach did you take?

Visual impact on existing themes

None. This code won't do anything until we add the CSS and the trigger class to different elements we want to animate.

Testing steps/scenarios

  • In your network tab, check that the animations script is loaded for the following pages: Homepage, Default product, Collections, Collections List, Blogs

Demo links

Checklist

@metamoni metamoni self-assigned this Feb 28, 2023
@metamoni metamoni force-pushed the add-intersection-observer branch 2 times, most recently from 334c0a1 to bdc3d37 Compare March 1, 2023 08:57
@metamoni metamoni changed the title Add animation script to theme layout Add intersection observer and first scroll animation Mar 1, 2023
@metamoni metamoni force-pushed the animate-on-scroll branch 2 times, most recently from 842f4ae to 606261a Compare March 1, 2023 09:22
@metamoni metamoni requested review from stufreen, kjellr and LucasLacerdaUX and removed request for kjellr and stufreen March 1, 2023 18:27
assets/animations.js Outdated Show resolved Hide resolved
assets/animations.js Outdated Show resolved Hide resolved
assets/animations.js Outdated Show resolved Hide resolved
assets/animations.js Outdated Show resolved Hide resolved
assets/theme-editor.js Outdated Show resolved Hide resolved
sections/image-with-text.liquid Outdated Show resolved Hide resolved
@metamoni metamoni force-pushed the add-intersection-observer branch 3 times, most recently from 070b1ac to 1f37a8a Compare March 2, 2023 09:45
@metamoni metamoni force-pushed the add-intersection-observer branch 2 times, most recently from e3e17e6 to bb4dca0 Compare March 2, 2023 11:02
@metamoni metamoni marked this pull request as ready for review March 2, 2023 11:14
assets/animations.js Outdated Show resolved Hide resolved
assets/animations.js Outdated Show resolved Hide resolved
assets/base.css Outdated Show resolved Hide resolved
assets/theme-editor.js Outdated Show resolved Hide resolved
assets/animations.js Outdated Show resolved Hide resolved
@metamoni metamoni force-pushed the add-intersection-observer branch 3 times, most recently from d7cf582 to 2ebbebd Compare March 3, 2023 17:05
@metamoni metamoni requested a review from stufreen March 3, 2023 17:10
@metamoni metamoni changed the base branch from animate-on-scroll to reveal-on-scroll-animations March 3, 2023 17:15
Copy link
Contributor

@stufreen stufreen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me with one small comment! I tested in Chrome and Safari in code by adding a scroll-animation__trigger to the featured collection list items.

assets/animations.js Outdated Show resolved Hide resolved
assets/animations.js Show resolved Hide resolved
@metamoni metamoni changed the title Add intersection observer and first scroll animation Add intersection observer Mar 6, 2023
@metamoni metamoni changed the base branch from reveal-on-scroll-animations to animate-on-scroll March 6, 2023 12:36
Base automatically changed from animate-on-scroll to reveal-on-scroll-animations March 7, 2023 10:28
@metamoni metamoni requested a review from kjellr March 7, 2023 11:06
@metamoni metamoni force-pushed the reveal-on-scroll-animations branch from 0e6d095 to cfefdd7 Compare March 7, 2023 11:08
Copy link
Contributor

@kjellr kjellr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's working for me!

Copy link
Contributor

@LucasLacerdaUX LucasLacerdaUX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! :D

@metamoni metamoni merged commit 8e48d95 into reveal-on-scroll-animations Mar 8, 2023
@metamoni metamoni deleted the add-intersection-observer branch March 8, 2023 07:05
metamoni added a commit that referenced this pull request Mar 10, 2023
* add scroll animation observer for section
metamoni added a commit that referenced this pull request Mar 13, 2023
* add scroll animation observer for section
metamoni added a commit that referenced this pull request Mar 15, 2023
* add scroll animation observer for section
metamoni added a commit that referenced this pull request Mar 23, 2023
* add scroll animation observer for section
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