Skip to content

Commit

Permalink
animate Collage and Slideshow on scroll (Shopify#2410)
Browse files Browse the repository at this point in the history
add fade in on scroll animation to Collage and Slideshow
  • Loading branch information
metamoni authored Apr 11, 2023
1 parent 5fcb859 commit 0d3e05a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions sections/collage.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@

<div class="color-{{ section.settings.color_scheme }} gradient isolate">
<div class="page-width{% if section.settings.heading == blank %} no-heading{% endif %} section-{{ section.id }}-padding">
<h2 class="collage-wrapper-title inline-richtext {{ section.settings.heading_size }}">
<h2 class="collage-wrapper-title inline-richtext {{ section.settings.heading_size }}{% if settings.animations_reveal_on_scroll %} scroll-trigger animate--slide-in{% endif %}">
{{ section.settings.heading }}
</h2>
<div class="collage{% if section.settings.mobile_layout == 'collage' %} collage--mobile{% endif %}">
{%- for block in section.blocks -%}
<div
class="collage__item collage__item--{{ block.type }} collage__item--{{ section.settings.desktop_layout }}"
class="collage__item collage__item--{{ block.type }} collage__item--{{ section.settings.desktop_layout }}{% if settings.animations_reveal_on_scroll %} scroll-trigger animate--slide-in{% endif %}"
{{ block.shopify_attributes }}
{% if settings.animations_reveal_on_scroll %}data-cascade{% endif %}
>
{%- case block.type -%}
{%- when 'image' -%}
Expand Down
4 changes: 2 additions & 2 deletions sections/slideshow.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
{%- endif -%}

<div
class="slideshow banner banner--{{ section.settings.slide_height }} grid grid--1-col slider slider--everywhere{% if section.settings.show_text_below %} banner--mobile-bottom{% endif %}{% if section.blocks.first.settings.image == blank %} slideshow--placeholder{% endif %}"
class="slideshow banner banner--{{ section.settings.slide_height }} grid grid--1-col slider slider--everywhere{% if section.settings.show_text_below %} banner--mobile-bottom{% endif %}{% if section.blocks.first.settings.image == blank %} slideshow--placeholder{% endif %}{% if settings.animations_reveal_on_scroll %} scroll-trigger animate--fade-in{% endif %}"
id="Slider-{{ section.id }}"
aria-live="polite"
aria-atomic="true"
Expand Down Expand Up @@ -152,7 +152,7 @@
{{ 'lifestyle-2' | placeholder_svg_tag: 'placeholder-svg' }}
{%- endif -%}
</div>
<div class="slideshow__text-wrapper banner__content banner__content--{{ block.settings.box_align }} page-width{% if block.settings.show_text_box == false %} banner--desktop-transparent{% endif %}">
<div class="slideshow__text-wrapper banner__content banner__content--{{ block.settings.box_align }} page-width{% if block.settings.show_text_box == false %} banner--desktop-transparent{% endif %}{% if settings.animations_reveal_on_scroll and forloop.index == 1 %} scroll-trigger animate--slide-in{% endif %}">
<div class="slideshow__text banner__box content-container content-container--full-width-mobile color-{{ block.settings.color_scheme }} gradient slideshow__text--{{ block.settings.text_alignment }} slideshow__text-mobile--{{ block.settings.text_alignment_mobile }}">
{%- if block.settings.heading != blank -%}
<h2 class="banner__heading inline-richtext {{ block.settings.heading_size }}">
Expand Down

0 comments on commit 0d3e05a

Please sign in to comment.