Skip to content

Commit

Permalink
Animate rich text and email signup (Shopify#2408)
Browse files Browse the repository at this point in the history
add fade in on scroll animation to Rich text and Email signup
  • Loading branch information
metamoni authored Apr 5, 2023
1 parent b8bfb79 commit 50328a6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
7 changes: 4 additions & 3 deletions sections/newsletter.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,17 @@
{%- when '@app' -%}
{% render block %}
{%- when 'heading' -%}
<h2 class="inline-richtext {{ block.settings.heading_size }}" {{ block.shopify_attributes }}>
<h2 class="inline-richtext {{ block.settings.heading_size }}{% if settings.animations_reveal_on_scroll %} scroll-trigger animate--slide-in{% endif %}" {{ block.shopify_attributes }}
data-cascade>
{{ block.settings.heading }}
</h2>
{%- when 'paragraph' -%}
<div class="newsletter__subheading rte" {{ block.shopify_attributes }}>{{ block.settings.text }}</div>
<div class="newsletter__subheading rte{% if settings.animations_reveal_on_scroll %} scroll-trigger animate--slide-in{% endif %}" {{ block.shopify_attributes }} data-cascade>{{ block.settings.text }}</div>
{%- when 'email_form' -%}
<div {{ block.shopify_attributes }}>
{% form 'customer', class: 'newsletter-form' %}
<input type="hidden" name="contact[tags]" value="newsletter">
<div class="newsletter-form__field-wrapper">
<div class="newsletter-form__field-wrapper{% if settings.animations_reveal_on_scroll %} scroll-trigger animate--slide-in{% endif %}" data-cascade>
<div class="field">
<input
id="NewsletterForm--{{ section.id }}"
Expand Down
11 changes: 7 additions & 4 deletions sections/rich-text.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,29 @@
{%- case block.type -%}
{%- when 'heading' -%}
<h2
class="rich-text__heading rte inline-richtext {{ block.settings.heading_size }}"
class="rich-text__heading rte inline-richtext {{ block.settings.heading_size }}{% if settings.animations_reveal_on_scroll %} scroll-trigger animate--slide-in{% endif %}"
{{ block.shopify_attributes }}
data-cascade
>
{{ block.settings.heading }}
</h2>
{%- when 'caption' -%}
<p
class="rich-text__caption {{ block.settings.text_style }} {{ block.settings.text_style }}--{{ block.settings.text_size }}"
class="rich-text__caption {{ block.settings.text_style }} {{ block.settings.text_style }}--{{ block.settings.text_size }}{% if settings.animations_reveal_on_scroll %} scroll-trigger animate--slide-in{% endif %}"
{{ block.shopify_attributes }}
data-cascade
>
{{ block.settings.caption | escape }}
</p>
{%- when 'text' -%}
<div class="rich-text__text rte" {{ block.shopify_attributes }}>
<div class="rich-text__text rte{% if settings.animations_reveal_on_scroll %} scroll-trigger animate--slide-in{% endif %}" {{ block.shopify_attributes }} data-cascade>
{{ block.settings.text }}
</div>
{%- when 'button' -%}
<div
class="rich-text__buttons{% if block.settings.button_label != blank and block.settings.button_label_2 != blank %} rich-text__buttons--multiple{% endif %}"
class="rich-text__buttons{% if block.settings.button_label != blank and block.settings.button_label_2 != blank %} rich-text__buttons--multiple{% endif %}{% if settings.animations_reveal_on_scroll %} scroll-trigger animate--slide-in{% endif %}"
{{ block.shopify_attributes }}
data-cascade
>
{%- if block.settings.button_label != blank -%}
<a
Expand Down

0 comments on commit 50328a6

Please sign in to comment.