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

[Collapsible content] add animation to the section and its blocks #2529

Merged
merged 3 commits into from
Apr 21, 2023

Conversation

ludoboludo
Copy link
Contributor

PR Summary:

Add animation to this section and its blocks

Why are these changes introduced?

Fixes #2387

What approach did you take?

Added the necessary classes and data attributes

Other considerations

Visual impact on existing themes

Adds animation effect when enabled from the general settings

Testing steps/scenarios

  • Enable animation and make sure to test the section with all potential fields (caption, heading, image, opened first collapsible row)

Demo links

Checklist

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.

LGTM! 🎉

@@ -55,8 +57,11 @@
<div class="grid__item">
{%- for block in section.blocks -%}
<div
class="accordion{% if section.settings.layout == 'row' %} content-container color-{{ section.settings.container_color_scheme }} gradient{% endif %}"
class="accordion{% if section.settings.layout == 'row' %} content-container color-{{ section.settings.container_color_scheme }} gradient{% endif %} {% if settings.animations_reveal_on_scroll %} scroll-trigger animate--slide-in{% endif %}"
Copy link
Contributor

Choose a reason for hiding this comment

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

I know @kjellr has approved this, but are we sure we want the animation on each collapsible row, rather than just their container? For many other sections we decided to keep it minimal and only slide in the container rather than every single individual element. And with the animation duration being shorter now, I think this doesn't look so smooth anymore:

collapsible-row.mp4

Copy link
Contributor Author

Choose a reason for hiding this comment

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

One thing I'd like to add on that topic. The more granular we go about the elements we choose to animate the more we impact performance we will notice 🤔

It might be better to use with caution vs apply on most elements separately

Copy link
Contributor

@melissaperreault melissaperreault Apr 20, 2023

Choose a reason for hiding this comment

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

If this can improve performance overall, I can see this not being in cascade. We can rely on smoother animation as we interact with the rows instead. That would be a good trade off to me considering the points you raised. 👍

This also aligns for now with the Collapsible row blocks under the product page. It would harmonize how they reveal together.

It does give a smoother feel though when displayed alone without an image beside it instead of revealing a larger chunk, but I am fine without cascading it too!

Copy link
Contributor

@metamoni metamoni Apr 20, 2023

Choose a reason for hiding this comment

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

On the Product Page we decided to only slide in the Product Info block and fade in the image. The individual blocks within the Product Info don't cascade. Same for the Featured Product. Similarly, in the Slideshow section we don't cascade in the heading, subheading, button. So for consistency, it makes more sense to me to not cascade each individual collapsible row.

So I'm confused, because from the comments above I understand that we can get rid of the cascading effect, but the code hasn't changed to reflect that. What's the final decision here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm gonna tweak this today 👍 to remove the cascade on each row 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated now 👍

Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you! Sorry for the confusion!

@stufreen stufreen self-requested a review April 17, 2023 18:29
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.

Code LGTM pending a response to Monica's point. @melissaperreault do you have a strong opinion on the cascading here?

@ludoboludo ludoboludo merged commit 699b3ef into main Apr 21, 2023
@ludoboludo ludoboludo deleted the animate-collapsible-content branch April 21, 2023 13:53
phapsidesGT pushed a commit to Gravytrain-UK/gt-shopify-dawn-theme that referenced this pull request Sep 3, 2024
This pull request was closed.
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.

[Collapsible content] Add cascading fade in on scroll animation
5 participants