Produccion 1

This commit is contained in:
2026-10-02 19:32:54 -06:00
parent 7ed1889bfb
commit 220178d421
81 changed files with 2993 additions and 531 deletions
+4 -1
View File
@@ -114,7 +114,10 @@
{% unless variant.available %}disabled{% endunless %}
aria-label="{{ 'bestsellers.add_to_cart' | t }}"
>
<img src="{{ 'testimonials-bag.svg' | asset_url }}" alt="" width="25" height="25">
<img src="{{ 'testimonials-bag.svg' | asset_url }}" alt="" width="25" height="25"
loading="lazy"
decoding="async"
>
</button>
<button
class="bestsellers__buy"
+83
View File
@@ -0,0 +1,83 @@
{% doc %}
Article card used on the blog index and on related articles.
@param {article} article - Article to render
@param {boolean} [show_excerpt] - Shows the excerpt and read-more label
@param {boolean} [show_author] - Shows the author next to the date
@param {boolean} [eager] - Loads the image immediately
@param {string} [heading_tag] - Heading element, h2 or h3
@example
{% render 'blog-card', article: article, show_excerpt: true, show_author: true %}
{% enddoc %}
{% liquid
if heading_tag == blank
assign heading_tag = 'h2'
endif
if eager
assign image_loading = 'eager'
else
assign image_loading = 'lazy'
endif
assign image_alt = ''
if article.image != blank
if article.image.alt != blank
assign image_alt = article.image.alt
else
assign image_alt = article.title
endif
endif
assign excerpt = article.excerpt_or_content | strip_html | truncate: 180
assign published = article.published_at | date: '%B %d, %Y'
%}
<article class="min-w-0" aria-labelledby="Article-{{ article.id }}">
<a class="group flex flex-col text-inherit no-underline" href="{{ article.url }}">
<div class="overflow-hidden rounded-[18px] bg-[#f3f3f3]">
{% if article.image != blank %}
{{
article.image
| image_url: width: 1200
| image_tag:
loading: image_loading,
widths: '414, 600, 828, 1200',
sizes: '(max-width: 767px) 100vw, (max-width: 1024px) 50vw, 33vw',
alt: image_alt,
class: 'aspect-[3/2] w-full object-cover transition duration-500 ease-out group-hover:scale-105'
}}
{% else %}
<div class="aspect-[3/2] w-full"></div>
{% endif %}
</div>
<div class="flex flex-col pt-[13.5px]">
<{{ heading_tag }}
id="Article-{{ article.id }}"
class="m-0 text-[22px] font-light leading-[1.27] tracking-[0.6px] text-[#1a1b18]"
>
{{- article.title | escape -}}
</{{ heading_tag }}>
<p class="m-0 mt-[6px] text-[9px] font-normal uppercase leading-none tracking-[1.17px] text-[#212326]/75">
<time datetime="{{ article.published_at | date: '%Y-%m-%d' }}">{{ published }}</time>
{% if show_author and article.author != blank %}
<span class="px-[6px]" aria-hidden="true">·</span>
<span>{{ article.author | escape }}</span>
{% endif %}
</p>
{% if show_excerpt and excerpt != blank %}
<p class="mb-[12.6px] mt-[13.5px] line-clamp-3 text-[12.6px] font-normal leading-[21px] text-[#212326]/75">
{{ excerpt | escape }}
</p>
<span class="text-[12.6px] font-normal leading-[1.89] text-[#1a1b18]">
{{- 'blog.read_more' | t -}}
</span>
{% endif %}
</div>
</a>
</article>
+451
View File
@@ -0,0 +1,451 @@
{% doc %}
Renders the Glow Army rewards page.
When the Glow Army section renders this snippet, its settings and blocks are used.
On the default page template it falls back to the theme copy.
@example
{% render 'glow-army-page' %}
{% enddoc %}
{% liquid
assign glow_editor = false
if section.type == 'glow-army'
assign glow_editor = true
endif
assign heading = 'glow_army.heading' | t
if glow_editor
if section.settings.heading != blank
assign heading = section.settings.heading
endif
endif
assign intro = 'glow_army.text' | t
assign join_label = 'glow_army.join' | t
assign points_label = 'glow_army.points' | t
assign join_url = routes.account_register_url
assign points_url = routes.account_url
assign how_heading = 'glow_army.how' | t
assign earn_heading = 'glow_army.earn' | t
assign redeem_heading = 'glow_army.redeem' | t
assign referral_heading = 'glow_army.referral_heading' | t
assign referral_text = 'glow_army.referral_text' | t
assign referral_button = 'glow_army.referral_button' | t
assign referral_url = join_url
if glow_editor
if section.settings.text != blank
assign intro = section.settings.text
endif
if section.settings.join_label != blank
assign join_label = section.settings.join_label
endif
if section.settings.points_label != blank
assign points_label = section.settings.points_label
endif
if section.settings.join_link != blank
assign join_url = section.settings.join_link
endif
if section.settings.points_link != blank
assign points_url = section.settings.points_link
endif
if section.settings.how_heading != blank
assign how_heading = section.settings.how_heading
endif
if section.settings.earn_heading != blank
assign earn_heading = section.settings.earn_heading
endif
if section.settings.redeem_heading != blank
assign redeem_heading = section.settings.redeem_heading
endif
if section.settings.referral_heading != blank
assign referral_heading = section.settings.referral_heading
endif
if section.settings.referral_text != blank
assign referral_text = section.settings.referral_text
endif
if section.settings.referral_button != blank
assign referral_button = section.settings.referral_button
endif
if section.settings.referral_link != blank
assign referral_url = section.settings.referral_link
endif
endif
%}
<section class="glow-army" id="GlowArmy-{{ section.id }}">
<div class="glow-army__hero">
<div class="glow-army__hero-copy">
<h1 class="glow-army__title">{{ heading }}</h1>
<p class="glow-army__intro">{{ intro }}</p>
<div class="glow-army__actions">
<a class="glow-army__button glow-army__button--fill" href="{{ join_url }}">{{ join_label }}</a>
<a class="glow-army__button glow-army__button--ghost" href="{{ points_url }}">{{ points_label }}</a>
</div>
</div>
</div>
{% if section.blocks.size > 0 %}
<div class="glow-army__body">
{% assign step_count = 0 %}
{% assign earn_count = 0 %}
{% assign reward_count = 0 %}
{% for block in section.blocks %}
{% if block.type == 'step' %}
{% assign step_count = step_count | plus: 1 %}
{% endif %}
{% if block.type == 'earn' %}
{% assign earn_count = earn_count | plus: 1 %}
{% endif %}
{% if block.type == 'reward' %}
{% assign reward_count = reward_count | plus: 1 %}
{% endif %}
{% endfor %}
{% if step_count > 0 %}
<div class="glow-army__block">
<h2 class="glow-army__heading">{{ how_heading }}</h2>
<ol class="glow-army__steps">
{% for block in section.blocks %}
{% if block.type == 'step' %}
<li class="glow-army__step" {{ block.shopify_attributes }}>
<p class="glow-army__number">{{ block.settings.number }}</p>
<h3 class="glow-army__card-title">{{ block.settings.title }}</h3>
<p class="glow-army__card-text">{{ block.settings.text }}</p>
</li>
{% endif %}
{% endfor %}
</ol>
</div>
{% endif %}
{% if earn_count > 0 %}
<div class="glow-army__block">
<h2 class="glow-army__heading">{{ earn_heading }}</h2>
<ul class="glow-army__cards">
{% for block in section.blocks %}
{% if block.type == 'earn' %}
<li class="glow-army__card" {{ block.shopify_attributes }}>
<span class="glow-army__icon" aria-hidden="true">
{% case block.settings.icon %}
{% when 'birthday' %}
<svg width="32" height="32" viewBox="0 0 32 32" fill="none"><path d="M6 22.5h20v3.2a2.3 2.3 0 0 1-2.3 2.3H8.3A2.3 2.3 0 0 1 6 25.7v-3.2Z" stroke="currentColor" stroke-width="1.4"/><path d="M6.5 22.5c1.2-1.6 2.2-1.6 3.4 0s2.2 1.6 3.4 0 2.2-1.6 3.4 0 2.2 1.6 3.4 0 2.2-1.6 3.4 0" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/><path d="M16 14.2v8.3M16 8.2c.8 1.3.4 2.4-.6 3.1" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/></svg>
{% when 'review' %}
<svg width="32" height="32" viewBox="0 0 32 32" fill="none"><path d="M8.5 10.5h9.2a3 3 0 0 1 3 3v4.2a3 3 0 0 1-3 3H14l-3.2 2.6v-2.6H8.5a3 3 0 0 1-3-3v-4.2a3 3 0 0 1 3-3Z" stroke="currentColor" stroke-width="1.4"/><path d="M16.2 12.2h7.3a3 3 0 0 1 3 3v3.4a3 3 0 0 1-3 3h-.4" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/></svg>
{% when 'profile' %}
<svg width="32" height="32" viewBox="0 0 32 32" fill="none"><rect x="8" y="6.5" width="16" height="19" rx="2" stroke="currentColor" stroke-width="1.4"/><path d="M12 12.5h8M12 16.5h8M12 20.5h5" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/></svg>
{% else %}
<svg width="32" height="32" viewBox="0 0 32 32" fill="none"><rect x="8" y="11" width="16" height="13" rx="2.2" stroke="currentColor" stroke-width="1.4"/><path d="M12.5 11V9.8a3.5 3.5 0 0 1 7 0V11" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/><path d="M16 16.2v3.2" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/></svg>
{% endcase %}
</span>
<h3 class="glow-army__card-title">{{ block.settings.title }}</h3>
<p class="glow-army__card-text">{{ block.settings.text }}</p>
</li>
{% endif %}
{% endfor %}
</ul>
</div>
{% endif %}
{% if reward_count > 0 %}
<div class="glow-army__block">
<h2 class="glow-army__heading">{{ redeem_heading }}</h2>
<ul class="glow-army__cards">
{% for block in section.blocks %}
{% if block.type == 'reward' %}
<li class="glow-army__card" {{ block.shopify_attributes }}>
{% if block.settings.image != blank %}
{{
block.settings.image
| image_url: width: 160
| image_tag: class: 'glow-army__reward-image', alt: block.settings.title, widths: '80, 160', loading: 'lazy'
}}
{% endif %}
<h3 class="glow-army__card-title">{{ block.settings.title }}</h3>
<p class="glow-army__card-text">{{ block.settings.text }}</p>
</li>
{% endif %}
{% endfor %}
</ul>
</div>
{% endif %}
</div>
{% else %}
<div class="glow-army__body">
<div class="glow-army__block">
<h2 class="glow-army__heading">{{ how_heading }}</h2>
<ol class="glow-army__steps">
<li class="glow-army__step">
<p class="glow-army__number">01</p>
<h3 class="glow-army__card-title">{{ 'glow_army.steps.one_title' | t }}</h3>
<p class="glow-army__card-text">{{ 'glow_army.steps.one_text' | t }}</p>
</li>
<li class="glow-army__step">
<p class="glow-army__number">02</p>
<h3 class="glow-army__card-title">{{ 'glow_army.steps.two_title' | t }}</h3>
<p class="glow-army__card-text">{{ 'glow_army.steps.two_text' | t }}</p>
</li>
<li class="glow-army__step">
<p class="glow-army__number">03</p>
<h3 class="glow-army__card-title">{{ 'glow_army.steps.three_title' | t }}</h3>
<p class="glow-army__card-text">{{ 'glow_army.steps.three_text' | t }}</p>
</li>
</ol>
</div>
<div class="glow-army__block">
<h2 class="glow-army__heading">{{ earn_heading }}</h2>
<ul class="glow-army__cards">
<li class="glow-army__card">
<span class="glow-army__icon" aria-hidden="true"><svg width="32" height="32" viewBox="0 0 32 32" fill="none"><rect x="8" y="11" width="16" height="13" rx="2.2" stroke="currentColor" stroke-width="1.4"/><path d="M12.5 11V9.8a3.5 3.5 0 0 1 7 0V11" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/><path d="M16 16.2v3.2" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/></svg></span>
<h3 class="glow-army__card-title">{{ 'glow_army.earn_items.order_title' | t }}</h3>
<p class="glow-army__card-text">{{ 'glow_army.earn_items.order_text' | t }}</p>
</li>
<li class="glow-army__card">
<span class="glow-army__icon" aria-hidden="true"><svg width="32" height="32" viewBox="0 0 32 32" fill="none"><path d="M6 22.5h20v3.2a2.3 2.3 0 0 1-2.3 2.3H8.3A2.3 2.3 0 0 1 6 25.7v-3.2Z" stroke="currentColor" stroke-width="1.4"/><path d="M6.5 22.5c1.2-1.6 2.2-1.6 3.4 0s2.2 1.6 3.4 0 2.2-1.6 3.4 0 2.2 1.6 3.4 0 2.2-1.6 3.4 0" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/><path d="M16 14.2v8.3M16 8.2c.8 1.3.4 2.4-.6 3.1" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/></svg></span>
<h3 class="glow-army__card-title">{{ 'glow_army.earn_items.birthday_title' | t }}</h3>
<p class="glow-army__card-text">{{ 'glow_army.earn_items.birthday_text' | t }}</p>
</li>
<li class="glow-army__card">
<span class="glow-army__icon" aria-hidden="true"><svg width="32" height="32" viewBox="0 0 32 32" fill="none"><path d="M8.5 10.5h9.2a3 3 0 0 1 3 3v4.2a3 3 0 0 1-3 3H14l-3.2 2.6v-2.6H8.5a3 3 0 0 1-3-3v-4.2a3 3 0 0 1 3-3Z" stroke="currentColor" stroke-width="1.4"/><path d="M16.2 12.2h7.3a3 3 0 0 1 3 3v3.4a3 3 0 0 1-3 3h-.4" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/></svg></span>
<h3 class="glow-army__card-title">{{ 'glow_army.earn_items.review_title' | t }}</h3>
<p class="glow-army__card-text">{{ 'glow_army.earn_items.review_text' | t }}</p>
</li>
<li class="glow-army__card">
<span class="glow-army__icon" aria-hidden="true"><svg width="32" height="32" viewBox="0 0 32 32" fill="none"><rect x="8" y="6.5" width="16" height="19" rx="2" stroke="currentColor" stroke-width="1.4"/><path d="M12 12.5h8M12 16.5h8M12 20.5h5" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/></svg></span>
<h3 class="glow-army__card-title">{{ 'glow_army.earn_items.profile_title' | t }}</h3>
<p class="glow-army__card-text">{{ 'glow_army.earn_items.profile_text' | t }}</p>
</li>
</ul>
</div>
<div class="glow-army__block">
<h2 class="glow-army__heading">{{ redeem_heading }}</h2>
<ul class="glow-army__cards">
<li class="glow-army__card"><h3 class="glow-army__card-title">{{ 'glow_army.rewards.rate_title' | t }}</h3><p class="glow-army__card-text">{{ 'glow_army.rewards.rate_text' | t }}</p></li>
<li class="glow-army__card"><h3 class="glow-army__card-title">{{ 'glow_army.rewards.off_50_title' | t }}</h3><p class="glow-army__card-text">{{ 'glow_army.rewards.off_50_text' | t }}</p></li>
<li class="glow-army__card"><h3 class="glow-army__card-title">{{ 'glow_army.rewards.balm_title' | t }}</h3><p class="glow-army__card-text">{{ 'glow_army.rewards.balm_text' | t }}</p></li>
<li class="glow-army__card"><h3 class="glow-army__card-title">{{ 'glow_army.rewards.off_100_title' | t }}</h3><p class="glow-army__card-text">{{ 'glow_army.rewards.off_100_text' | t }}</p></li>
<li class="glow-army__card"><h3 class="glow-army__card-title">{{ 'glow_army.rewards.toner_title' | t }}</h3><p class="glow-army__card-text">{{ 'glow_army.rewards.toner_text' | t }}</p></li>
<li class="glow-army__card"><h3 class="glow-army__card-title">{{ 'glow_army.rewards.off_200_title' | t }}</h3><p class="glow-army__card-text">{{ 'glow_army.rewards.off_200_text' | t }}</p></li>
<li class="glow-army__card"><h3 class="glow-army__card-title">{{ 'glow_army.rewards.off_300_title' | t }}</h3><p class="glow-army__card-text">{{ 'glow_army.rewards.off_300_text' | t }}</p></li>
<li class="glow-army__card"><h3 class="glow-army__card-title">{{ 'glow_army.rewards.sunscreen_title' | t }}</h3><p class="glow-army__card-text">{{ 'glow_army.rewards.sunscreen_text' | t }}</p></li>
</ul>
</div>
</div>
{% endif %}
<div class="glow-army__referral">
<div class="glow-army__referral-copy">
<h2 class="glow-army__referral-title">{{ referral_heading }}</h2>
<p class="glow-army__intro">{{ referral_text }}</p>
<a class="glow-army__button glow-army__button--fill" href="{{ referral_url }}">{{ referral_button }}</a>
</div>
</div>
</section>
{% stylesheet %}
.glow-army {
box-sizing: border-box;
width: 100%;
padding: 24px 50px 88px;
background: #fff;
color: #111;
font-family: inherit;
}
.glow-army__hero,
.glow-army__referral {
display: flex;
align-items: flex-end;
min-height: 560px;
padding: 72px 64px;
border-radius: 8px;
background: linear-gradient(105deg, #f08a62 0%, #f6b89a 48%, #f8d5c8 100%);
color: #fff;
}
.glow-army__hero-copy,
.glow-army__referral-copy {
max-width: 560px;
}
.glow-army__title,
.glow-army__referral-title {
margin: 0;
font-size: 64px;
font-weight: 400;
line-height: 1.05;
letter-spacing: -0.02em;
}
.glow-army__referral-title {
font-size: 40px;
line-height: 1.15;
}
.glow-army__intro {
max-width: 460px;
margin: 18px 0 0;
font-size: 16px;
font-weight: 300;
line-height: 1.45;
}
.glow-army__actions {
display: flex;
flex-wrap: wrap;
gap: 12px;
margin-top: 28px;
}
.glow-army__button {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 160px;
height: 48px;
padding: 0 24px;
border-radius: 999px;
font-size: 16px;
font-weight: 500;
line-height: 1;
text-decoration: none;
}
.glow-army__button--fill {
background: #e36b4a;
color: #fff;
}
.glow-army__button--ghost {
background: #fff;
color: #e36b4a;
}
.glow-army__referral .glow-army__button {
margin-top: 28px;
}
.glow-army__body {
padding: 72px 0 24px;
}
.glow-army__block + .glow-army__block {
margin-top: 72px;
}
.glow-army__heading {
margin: 0 0 40px;
font-size: 36px;
font-weight: 400;
line-height: 1.2;
text-align: center;
}
.glow-army__steps,
.glow-army__cards {
display: grid;
gap: 20px;
margin: 0;
padding: 0;
list-style: none;
}
.glow-army__steps {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
.glow-army__cards {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
.glow-army__step,
.glow-army__card {
text-align: center;
}
.glow-army__card {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
min-height: 210px;
padding: 28px 20px;
border: 1px solid #ececec;
border-radius: 16px;
}
.glow-army__number {
margin: 0;
color: #e36b4a;
font-size: 64px;
font-weight: 400;
line-height: 1;
letter-spacing: 0.04em;
}
.glow-army__icon {
display: grid;
margin-bottom: 16px;
color: #e36b4a;
place-items: center;
}
.glow-army__reward-image {
width: 72px;
height: 72px;
margin-bottom: 12px;
object-fit: contain;
}
.glow-army__card-title {
margin: 14px 0 0;
font-size: 18px;
font-weight: 600;
line-height: 1.3;
}
.glow-army__step .glow-army__card-title {
margin-top: 18px;
}
.glow-army__card-text {
margin: 8px 0 0;
color: #5c5c5c;
font-size: 15px;
font-weight: 300;
line-height: 1.4;
}
.glow-army__referral {
min-height: 420px;
margin-top: 72px;
}
@media (max-width: 1024px) {
.glow-army {
padding: 16px 20px 64px;
}
.glow-army__hero,
.glow-army__referral {
min-height: 420px;
padding: 40px 24px;
}
.glow-army__title {
font-size: 48px;
}
.glow-army__referral-title,
.glow-army__heading {
font-size: 30px;
}
.glow-army__steps,
.glow-army__cards {
grid-template-columns: 1fr;
}
}
{% endstylesheet %}
+17
View File
@@ -10,7 +10,12 @@
{% liquid
assign variant = product.selected_or_first_available_variant
assign card_image = product.featured_image
assign hover_image = blank
assign image_alt = card_image.alt | default: product.title
for image in product.images offset: 1 limit: 1
assign hover_image = image
endfor
%}
<article class="hero__card">
@@ -26,6 +31,18 @@
class: 'hero__card-image',
loading: 'eager'
}}
{% if hover_image != blank %}
{{
hover_image
| image_url: width: 200
| image_tag:
alt: '',
widths: '100, 140, 200',
sizes: '(max-width: 1023px) 70px, 100px',
class: 'hero__card-image hero__card-image--hover',
loading: 'lazy'
}}
{% endif %}
{% endif %}
</a>
+13 -3
View File
@@ -1,3 +1,10 @@
{%- if settings.favicon != blank -%}
<link rel="icon" type="image/png" href="{{ settings.favicon | image_url: width: 192, height: 192 }}">
<link rel="apple-touch-icon" href="{{ settings.favicon | image_url: width: 180, height: 180 }}">
{%- else -%}
<link rel="icon" type="image/png" href="{{ 'favicon-seasons.png' | asset_url }}">
<link rel="apple-touch-icon" href="{{ 'favicon-seasons.png' | asset_url }}">
{%- endif -%}
<meta charset="utf-8">
{% render 'rocket-delay' %}
<meta http-equiv="X-UA-Compatible" content="IE=edge">
@@ -7,7 +14,7 @@
assign og_title = page_title | default: shop.name
assign og_url = canonical_url | default: request.origin
assign og_type = 'website'
assign og_description = page_description | default: shop.description | default: shop.name
assign og_description = page_description | default: settings.default_meta_description | default: shop.description | default: shop.name
if request.page_type == 'product'
assign og_type = 'product'
@@ -98,9 +105,12 @@
href="{{ canonical_url }}"
>
{% if page_description %}
{%- liquid
assign meta_description = page_description | default: settings.default_meta_description | default: shop.description
-%}
{% if meta_description != blank %}
<meta
name="description"
content="{{ page_description | escape }}"
content="{{ meta_description | strip_newlines | strip | truncate: 160 | escape }}"
>
{% endif %}
+3
View File
@@ -23,6 +23,9 @@
script.setAttribute('data-rocket-src', src);
script.removeAttribute('src');
}
// Keep ES modules as modules when they are released later (prevents
// "Cannot use import statement outside a module" on runtime-injected scripts).
if ((script.getAttribute('type') || '').toLowerCase() === 'module') script.setAttribute('data-rocket-type', 'module');
script.setAttribute('type', 'rocketlazyloadscript');
};
+61
View File
@@ -0,0 +1,61 @@
{%- comment -%}
WhatsApp Coupon Widget (Aitana) — rendered right before </body> in layout/theme.liquid.
Performance best practices baked in:
• preconnect + dns-prefetch → in <head> (layout/theme.liquid), warms TLS to the widget host
• First-interaction only → loads on first scroll/touch/click/key/mouse move (no timer)
• fetchpriority="low" → lets fonts/images/CSS win the network
• crossorigin="anonymous" → enables cacheable, CORS-safe fetch
IMPORTANT: this theme's rocket-delay snippet holds every <script> without a
`nolazy` attribute (including scripts injected later). Both the loader and the
injected widget script carry `nolazy` so they are not intercepted; the loader
already defers itself.
The modal open delay is controlled from the Aitana admin (Settings → Lead
capture → "Modal auto-open delay"), no theme redeploy needed.
Not loaded inside the theme editor so the modal doesn't interrupt editing.
{%- endcomment -%}
{%- unless request.design_mode -%}
<script nolazy>
(function () {
var SRC = "https://bpuemzaabpwmxvfcorjc.supabase.co/functions/v1/coupon-widget";
var EVENTS = ['scroll', 'touchstart', 'pointerdown', 'mousemove', 'keydown', 'wheel'];
var triggered = false;
function inject() {
var s = document.createElement('script');
s.src = SRC; s.defer = true; s.crossOrigin = 'anonymous';
s.setAttribute('fetchpriority', 'low');
s.setAttribute('nolazy', '');
document.body.appendChild(s);
}
// Loads ONLY on the visitor's first interaction (no timer): keeps the widget
// and Aitana's Lottie player out of the initial load / Lighthouse window.
// Interactions during page load count too; injection then waits for `load`.
function onFirstInteraction() {
if (triggered) return; triggered = true;
EVENTS.forEach(function (ev) { window.removeEventListener(ev, onFirstInteraction, { passive: true }); });
if (document.readyState === 'complete') inject();
else window.addEventListener('load', inject, { once: true });
}
EVENTS.forEach(function (ev) { window.addEventListener(ev, onFirstInteraction, { passive: true }); });
function clickAitana() {
var fab = document.getElementById('aitana-fab');
if (!fab) return false;
fab.click();
return true;
}
document.addEventListener('click', function (event) {
var trigger = event.target.closest('[data-open-aitana]');
if (!trigger) return;
if (clickAitana()) return;
if (!document.querySelector('script[src="' + SRC + '"]')) inject();
triggered = true;
var tries = 0;
var timer = window.setInterval(function () {
tries += 1;
if (clickAitana() || tries > 40) window.clearInterval(timer);
}, 150);
});
})();
</script>
{%- endunless -%}