Demas ajustes
This commit is contained in:
@@ -138,6 +138,7 @@
|
||||
type="button"
|
||||
data-wishlist
|
||||
data-product-id="{{ product.id }}"
|
||||
data-product-handle="{{ product.handle }}"
|
||||
aria-pressed="false"
|
||||
aria-label="{{ 'bestsellers.save' | t: product: product.title }}"
|
||||
data-label-save="{{ 'bestsellers.save' | t: product: product.title }}"
|
||||
|
||||
+13
-327
@@ -116,6 +116,7 @@
|
||||
type="button"
|
||||
data-wishlist
|
||||
data-product-id="{{ product.id }}"
|
||||
data-product-handle="{{ product.handle }}"
|
||||
aria-pressed="false"
|
||||
aria-label="{{ 'bestsellers.save' | t: product: product.title }}"
|
||||
data-label-save="{{ 'bestsellers.save' | t: product: product.title }}"
|
||||
@@ -174,330 +175,6 @@
|
||||
</div>
|
||||
</article>
|
||||
|
||||
{% stylesheet %}
|
||||
.collection-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 15px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.collection-card__media {
|
||||
position: relative;
|
||||
aspect-ratio: 1;
|
||||
overflow: hidden;
|
||||
border-radius: 10px;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.collection-card__link {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.collection-card__image {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.collection-card__image--hover {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
opacity: 0;
|
||||
transition: opacity 0.35s ease;
|
||||
}
|
||||
|
||||
.collection-card__media:hover .collection-card__image--hover,
|
||||
.collection-card__media:focus-within .collection-card__image--hover {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.collection-card__image--empty {
|
||||
background: #f3f3f3;
|
||||
}
|
||||
|
||||
.collection-card__badges {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
left: 10px;
|
||||
z-index: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.collection-card__badge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
padding: 3px 5px;
|
||||
border-radius: 2px;
|
||||
color: #000;
|
||||
font-size: 10px;
|
||||
font-weight: 300;
|
||||
line-height: normal;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.collection-card__badge--best {
|
||||
background: #bfffb2;
|
||||
}
|
||||
|
||||
.collection-card__badge--skin {
|
||||
background: #f7c585;
|
||||
}
|
||||
|
||||
.collection-card__wish {
|
||||
position: absolute;
|
||||
top: 16px;
|
||||
right: 16px;
|
||||
z-index: 2;
|
||||
display: grid;
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
place-items: center;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
background: transparent;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.collection-card__wish svg {
|
||||
display: block;
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
}
|
||||
|
||||
.collection-card__wish.is-active svg path {
|
||||
fill: #000;
|
||||
}
|
||||
|
||||
.collection-card__actions {
|
||||
position: absolute;
|
||||
right: 16px;
|
||||
bottom: 16px;
|
||||
left: 16px;
|
||||
z-index: 2;
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
margin: 0;
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
transition: opacity 0.25s ease;
|
||||
}
|
||||
|
||||
.collection-card__media:hover .collection-card__actions,
|
||||
.collection-card__media:focus-within .collection-card__actions {
|
||||
opacity: 1;
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
.collection-card__add,
|
||||
.collection-card__buy {
|
||||
flex: 1 1 0;
|
||||
height: 48px;
|
||||
border-radius: 60px;
|
||||
font: inherit;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
line-height: 1;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.collection-card__add {
|
||||
border: 1px solid #111;
|
||||
background: #fff;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.collection-card__buy {
|
||||
border: 0;
|
||||
background: #9dd6c7;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.collection-card__add:disabled,
|
||||
.collection-card__buy:disabled {
|
||||
cursor: default;
|
||||
opacity: 0.55;
|
||||
}
|
||||
|
||||
.collection-card__info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 5px;
|
||||
}
|
||||
|
||||
.collection-card__title {
|
||||
color: #000;
|
||||
font-size: 22px;
|
||||
font-weight: 700;
|
||||
line-height: normal;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.collection-card__subtitle,
|
||||
.collection-card__reviews,
|
||||
.collection-card__prices {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.collection-card__subtitle {
|
||||
color: #808181;
|
||||
font-size: 18px;
|
||||
font-weight: 300;
|
||||
line-height: normal;
|
||||
}
|
||||
|
||||
.collection-card__rating {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.collection-card__stars {
|
||||
display: flex;
|
||||
gap: 1px;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.collection-card__star {
|
||||
display: block;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
}
|
||||
|
||||
.collection-card__star.is-off {
|
||||
opacity: 0.25;
|
||||
}
|
||||
|
||||
.collection-card__reviews {
|
||||
color: #000;
|
||||
font-size: 14px;
|
||||
font-weight: 300;
|
||||
}
|
||||
|
||||
.collection-card__prices {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.collection-card__price,
|
||||
.collection-card__compare {
|
||||
font-size: 20px;
|
||||
line-height: normal;
|
||||
}
|
||||
|
||||
.collection-card__price {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.collection-card__compare {
|
||||
color: #808181;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.recent .collection-card__title {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.recent .collection-card__subtitle,
|
||||
.recent .collection-card__reviews {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.recent .collection-card__price,
|
||||
.recent .collection-card__compare {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.recent .collection-card__star {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.collection-card {
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.collection-card__media {
|
||||
aspect-ratio: auto;
|
||||
overflow: visible;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.collection-card__link {
|
||||
position: relative;
|
||||
aspect-ratio: 1;
|
||||
overflow: hidden;
|
||||
border-radius: 10px;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.collection-card__image {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
}
|
||||
|
||||
.collection-card__actions {
|
||||
position: static;
|
||||
opacity: 1;
|
||||
pointer-events: auto;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.collection-card__add,
|
||||
.collection-card__buy {
|
||||
height: 36px;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.collection-card__title,
|
||||
.recent .collection-card__title {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.collection-card__subtitle,
|
||||
.recent .collection-card__subtitle {
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.collection-card__price,
|
||||
.collection-card__compare,
|
||||
.recent .collection-card__price,
|
||||
.recent .collection-card__compare {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.collection-card__reviews,
|
||||
.recent .collection-card__reviews {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.collection-card__wish {
|
||||
top: 8px;
|
||||
right: 8px;
|
||||
}
|
||||
|
||||
.collection-card__wish svg {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.collection-card__image--hover,
|
||||
.collection-card__actions {
|
||||
transition: none;
|
||||
}
|
||||
}
|
||||
{% endstylesheet %}
|
||||
|
||||
{% javascript %}
|
||||
(() => {
|
||||
if (window.__seasonCollectionCard) return;
|
||||
@@ -508,14 +185,18 @@
|
||||
const readWishlist = () => {
|
||||
try {
|
||||
const stored = JSON.parse(window.localStorage.getItem(wishlistKey));
|
||||
return Array.isArray(stored) ? stored.map(String) : [];
|
||||
if (!Array.isArray(stored)) return [];
|
||||
return stored.map((item) => {
|
||||
if (item && typeof item === 'object') return { id: String(item.id || ''), handle: String(item.handle || '') };
|
||||
return { id: String(item), handle: '' };
|
||||
}).filter((item) => item.id);
|
||||
} catch (error) {
|
||||
return [];
|
||||
}
|
||||
};
|
||||
|
||||
const applyWishlist = () => {
|
||||
const saved = readWishlist();
|
||||
const saved = readWishlist().map((item) => item.id);
|
||||
document.querySelectorAll('.collection-card [data-wishlist]').forEach((button) => {
|
||||
const active = saved.includes(String(button.dataset.productId));
|
||||
button.classList.toggle('is-active', active);
|
||||
@@ -526,15 +207,20 @@
|
||||
};
|
||||
|
||||
applyWishlist();
|
||||
document.addEventListener('seasons:wishlist', applyWishlist);
|
||||
|
||||
document.addEventListener('click', (event) => {
|
||||
const wish = event.target.closest('.collection-card [data-wishlist]');
|
||||
if (!wish) return;
|
||||
const id = String(wish.dataset.productId || '');
|
||||
const handle = String(wish.dataset.productHandle || '');
|
||||
if (!id) return;
|
||||
const saved = readWishlist();
|
||||
const next = saved.includes(id) ? saved.filter((item) => item !== id) : saved.concat(id);
|
||||
const next = saved.some((item) => item.id === id)
|
||||
? saved.filter((item) => item.id !== id)
|
||||
: saved.concat({ id, handle });
|
||||
window.localStorage.setItem(wishlistKey, JSON.stringify(next));
|
||||
document.dispatchEvent(new CustomEvent('seasons:wishlist'));
|
||||
applyWishlist();
|
||||
});
|
||||
|
||||
|
||||
@@ -9,10 +9,16 @@
|
||||
{% render 'delay-header-scripts', html: shopify_header %}
|
||||
{% enddoc %}
|
||||
|
||||
{% capture blocking_style %}rel="stylesheet" media="screen"{% endcapture %}
|
||||
{% capture deferred_style %}rel="stylesheet" media="print" onload="this.media='all'"{% endcapture %}
|
||||
|
||||
{% liquid
|
||||
if request.design_mode or html == blank
|
||||
echo html
|
||||
else
|
||||
assign blocking_style = blocking_style | strip
|
||||
assign deferred_style = deferred_style | strip
|
||||
assign html = html | replace: 'media="screen"', 'media="print" onload="this.media='all'"'
|
||||
assign chunks = html | split: '<script'
|
||||
for chunk in chunks
|
||||
if forloop.first
|
||||
|
||||
@@ -8,34 +8,38 @@
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: Archivo;
|
||||
src: url('{{ 'archivo-light.ttf' | asset_url }}') format('truetype');
|
||||
src: url('{{ 'archivo-light.woff2' | asset_url }}') format('woff2');
|
||||
font-weight: 300;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: Archivo;
|
||||
src: url('{{ 'archivo-regular.ttf' | asset_url }}') format('truetype');
|
||||
src: url('{{ 'archivo-regular.woff2' | asset_url }}') format('woff2');
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: Archivo;
|
||||
src: url('{{ 'archivo-medium.ttf' | asset_url }}') format('truetype');
|
||||
src: url('{{ 'archivo-medium.woff2' | asset_url }}') format('woff2');
|
||||
font-weight: 500;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: Archivo;
|
||||
src: url('{{ 'archivo-bold.ttf' | asset_url }}') format('truetype');
|
||||
src: url('{{ 'archivo-bold.woff2' | asset_url }}') format('woff2');
|
||||
font-weight: 700;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
|
||||
body {
|
||||
|
||||
@@ -243,209 +243,5 @@
|
||||
</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 %}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
@param {string} url - Link URL
|
||||
@param {link[]} [child_links] - Nested links from a menu
|
||||
@param {string} [child_menu] - Fallback items as `Label::/url`, separated by `|`
|
||||
@param {string} [image_set] - Card images: categories, routine, skin or concern
|
||||
@param {boolean} [show_caret] - Shows a decorative caret when there are no child links
|
||||
|
||||
@example
|
||||
@@ -24,6 +25,80 @@
|
||||
assign manual_items = child_menu | strip | split: '|'
|
||||
assign child_count = manual_items.size
|
||||
endif
|
||||
|
||||
assign cards = false
|
||||
if child_menu contains '/collections/1-limpia'
|
||||
assign cards = true
|
||||
endif
|
||||
if child_menu contains '/collections/2-trata'
|
||||
assign cards = true
|
||||
endif
|
||||
if child_menu contains '/collections/3-hidrata'
|
||||
assign cards = true
|
||||
endif
|
||||
if child_menu contains '/collections/4-protege-bloqueadores-solares'
|
||||
assign cards = true
|
||||
endif
|
||||
if child_menu contains '/collections/kits-skincare-facial'
|
||||
assign cards = true
|
||||
endif
|
||||
if child_menu contains '/collections/piel-mixta-grasa'
|
||||
assign cards = true
|
||||
endif
|
||||
if child_menu contains '/collections/piel-grasa'
|
||||
assign cards = true
|
||||
endif
|
||||
if child_menu contains '/collections/piel-seca-1'
|
||||
assign cards = true
|
||||
endif
|
||||
if child_links != blank
|
||||
for child in child_links
|
||||
if child.url contains '/collections/1-limpia'
|
||||
assign cards = true
|
||||
endif
|
||||
if child.url contains '/collections/2-trata'
|
||||
assign cards = true
|
||||
endif
|
||||
if child.url contains '/collections/3-hidrata'
|
||||
assign cards = true
|
||||
endif
|
||||
if child.url contains '/collections/4-protege-bloqueadores-solares'
|
||||
assign cards = true
|
||||
endif
|
||||
if child.url contains '/collections/kits-skincare-facial'
|
||||
assign cards = true
|
||||
endif
|
||||
if child.url contains '/collections/piel-mixta-grasa'
|
||||
assign cards = true
|
||||
endif
|
||||
if child.url contains '/collections/piel-grasa'
|
||||
assign cards = true
|
||||
endif
|
||||
if child.url contains '/collections/piel-seca-1'
|
||||
assign cards = true
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
|
||||
if image_set == blank
|
||||
assign title_key = title | handleize
|
||||
if title_key == 'categorias'
|
||||
assign image_set = 'categories'
|
||||
endif
|
||||
if title_key == 'preocupacion'
|
||||
assign image_set = 'concern'
|
||||
endif
|
||||
if title_key == 'rutina'
|
||||
assign image_set = 'routine'
|
||||
endif
|
||||
if title_key == 'tipo-de-piel'
|
||||
assign image_set = 'skin'
|
||||
endif
|
||||
endif
|
||||
|
||||
if image_set != blank
|
||||
assign cards = true
|
||||
endif
|
||||
%}
|
||||
|
||||
<li class="header__item relative flex items-center self-stretch gap-2.5" data-menu-item>
|
||||
@@ -46,15 +121,89 @@
|
||||
{{ 'icon-caret-down.svg' | inline_asset_content }}
|
||||
</span>
|
||||
</button>
|
||||
<ul class="header__submenu absolute left-0 top-full z-30 m-0 hidden min-w-[260px] list-none bg-white px-5 py-4 shadow-[0_12px_40px_rgba(0,0,0,0.08)]">
|
||||
<ul class="header__submenu{% if cards %} header__submenu--cards{% endif %} absolute left-0 top-full z-30 m-0 hidden list-none{% unless cards %} min-w-[260px] bg-white px-5 py-4 shadow-[0_12px_40px_rgba(0,0,0,0.08)]{% endunless %}">
|
||||
{% if child_links != blank and child_links.size > 0 %}
|
||||
{% for child in child_links %}
|
||||
<li>
|
||||
{% liquid
|
||||
assign item_title = child.title
|
||||
assign item_url = child.url
|
||||
assign item_handle = item_url | split: '/collections/' | last | split: '?' | first | split: '/' | first
|
||||
assign card_image = blank
|
||||
if image_set == 'categories'
|
||||
case item_handle
|
||||
when 'all-products'
|
||||
assign card_image = 'menu-categoria-todos.webp'
|
||||
when 'proteccion-solar-1'
|
||||
assign card_image = 'menu-categoria-bloqueadores.webp'
|
||||
when 'hidratantes'
|
||||
assign card_image = 'menu-categoria-hidratantes.webp'
|
||||
when 'limpiadores'
|
||||
assign card_image = 'menu-categoria-limpiadores.webp'
|
||||
when 'mascarillas'
|
||||
assign card_image = 'menu-categoria-mascarillas.webp'
|
||||
when 'serum'
|
||||
assign card_image = 'menu-categoria-serums.webp'
|
||||
endcase
|
||||
endif
|
||||
if image_set == 'concern'
|
||||
case item_handle
|
||||
when 'proteccion-solar-1'
|
||||
assign card_image = 'menu-preocupacion-solar.webp'
|
||||
when 'control-grasa'
|
||||
assign card_image = 'menu-preocupacion-grasa.webp'
|
||||
when 'acne-1'
|
||||
assign card_image = 'menu-preocupacion-acne.webp'
|
||||
when 'hidratacion'
|
||||
assign card_image = 'menu-preocupacion-hidratacion.webp'
|
||||
when 'antiedad-1'
|
||||
assign card_image = 'menu-preocupacion-antiedad.webp'
|
||||
when 'aclarar'
|
||||
assign card_image = 'menu-preocupacion-manchas.webp'
|
||||
endcase
|
||||
endif
|
||||
if card_image == blank
|
||||
case item_handle
|
||||
when '1-limpia'
|
||||
assign card_image = 'menu-rutina-limpia.webp'
|
||||
when '2-trata'
|
||||
assign card_image = 'menu-rutina-trata.webp'
|
||||
when '3-hidrata'
|
||||
assign card_image = 'menu-rutina-hidrata.webp'
|
||||
when '4-protege-bloqueadores-solares'
|
||||
assign card_image = 'menu-rutina-protege.webp'
|
||||
when 'kits-skincare-facial'
|
||||
assign card_image = 'menu-rutina-kits.webp'
|
||||
when 'piel-mixta-grasa'
|
||||
assign card_image = 'menu-piel-mixta.webp'
|
||||
when 'piel-grasa'
|
||||
assign card_image = 'menu-piel-grasa.webp'
|
||||
when 'piel-seca-1'
|
||||
assign card_image = 'menu-piel-seca.webp'
|
||||
endcase
|
||||
endif
|
||||
%}
|
||||
<li{% if cards %} class="header__card"{% endif %}>
|
||||
<a
|
||||
class="block py-2 text-[14px] font-medium uppercase leading-none text-black no-underline hover:text-brand-ink focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-black"
|
||||
href="{{ child.url }}"
|
||||
class="{% if cards %}header__card-link{% else %}block py-2 text-[14px] font-medium uppercase leading-none text-black no-underline hover:text-brand-ink focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-black{% endif %}"
|
||||
href="{{ item_url }}"
|
||||
>
|
||||
{{ child.title }}
|
||||
{% if cards and card_image != blank %}
|
||||
<span class="header__card-media">
|
||||
<img
|
||||
class="header__card-image"
|
||||
src="{{ card_image | asset_url }}"
|
||||
alt=""
|
||||
width="180"
|
||||
height="180"
|
||||
loading="lazy"
|
||||
>
|
||||
</span>
|
||||
{% endif %}
|
||||
{% if cards %}
|
||||
<span class="header__card-label">{{ item_title }}</span>
|
||||
{% else %}
|
||||
{{ item_title }}
|
||||
{% endif %}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
@@ -64,14 +213,84 @@
|
||||
assign item_parts = item | split: '::'
|
||||
assign item_title = item_parts[0] | strip
|
||||
assign item_url = item_parts[1] | strip
|
||||
assign item_handle = item_url | split: '/collections/' | last | split: '?' | first | split: '/' | first
|
||||
assign card_image = blank
|
||||
if image_set == 'categories'
|
||||
case item_handle
|
||||
when 'all-products'
|
||||
assign card_image = 'menu-categoria-todos.webp'
|
||||
when 'proteccion-solar-1'
|
||||
assign card_image = 'menu-categoria-bloqueadores.webp'
|
||||
when 'hidratantes'
|
||||
assign card_image = 'menu-categoria-hidratantes.webp'
|
||||
when 'limpiadores'
|
||||
assign card_image = 'menu-categoria-limpiadores.webp'
|
||||
when 'mascarillas'
|
||||
assign card_image = 'menu-categoria-mascarillas.webp'
|
||||
when 'serum'
|
||||
assign card_image = 'menu-categoria-serums.webp'
|
||||
endcase
|
||||
endif
|
||||
if image_set == 'concern'
|
||||
case item_handle
|
||||
when 'proteccion-solar-1'
|
||||
assign card_image = 'menu-preocupacion-solar.webp'
|
||||
when 'control-grasa'
|
||||
assign card_image = 'menu-preocupacion-grasa.webp'
|
||||
when 'acne-1'
|
||||
assign card_image = 'menu-preocupacion-acne.webp'
|
||||
when 'hidratacion'
|
||||
assign card_image = 'menu-preocupacion-hidratacion.webp'
|
||||
when 'antiedad-1'
|
||||
assign card_image = 'menu-preocupacion-antiedad.webp'
|
||||
when 'aclarar'
|
||||
assign card_image = 'menu-preocupacion-manchas.webp'
|
||||
endcase
|
||||
endif
|
||||
if card_image == blank
|
||||
case item_handle
|
||||
when '1-limpia'
|
||||
assign card_image = 'menu-rutina-limpia.webp'
|
||||
when '2-trata'
|
||||
assign card_image = 'menu-rutina-trata.webp'
|
||||
when '3-hidrata'
|
||||
assign card_image = 'menu-rutina-hidrata.webp'
|
||||
when '4-protege-bloqueadores-solares'
|
||||
assign card_image = 'menu-rutina-protege.webp'
|
||||
when 'kits-skincare-facial'
|
||||
assign card_image = 'menu-rutina-kits.webp'
|
||||
when 'piel-mixta-grasa'
|
||||
assign card_image = 'menu-piel-mixta.webp'
|
||||
when 'piel-grasa'
|
||||
assign card_image = 'menu-piel-grasa.webp'
|
||||
when 'piel-seca-1'
|
||||
assign card_image = 'menu-piel-seca.webp'
|
||||
endcase
|
||||
endif
|
||||
%}
|
||||
{% if item_title != blank %}
|
||||
<li>
|
||||
<li{% if cards %} class="header__card"{% endif %}>
|
||||
<a
|
||||
class="block py-2 text-[14px] font-medium uppercase leading-none text-black no-underline focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-black"
|
||||
class="{% if cards %}header__card-link{% else %}block py-2 text-[14px] font-medium uppercase leading-none text-black no-underline focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-black{% endif %}"
|
||||
href="{{ item_url }}"
|
||||
>
|
||||
{{ item_title }}
|
||||
{% if cards and card_image != blank %}
|
||||
<span class="header__card-media">
|
||||
<img
|
||||
class="header__card-image"
|
||||
src="{{ card_image | asset_url }}"
|
||||
alt=""
|
||||
width="180"
|
||||
height="180"
|
||||
loading="lazy"
|
||||
>
|
||||
</span>
|
||||
{% endif %}
|
||||
{% if cards %}
|
||||
<span class="header__card-label">{{ item_title }}</span>
|
||||
{% else %}
|
||||
{{ item_title }}
|
||||
{% endif %}
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
@@ -48,17 +48,4 @@
|
||||
{{ image | image_url: width: width, height: height, crop: crop | image_tag }}
|
||||
</{{ wrapper }}>
|
||||
|
||||
{% stylesheet %}
|
||||
.image {
|
||||
display: block;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.image > img {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
{% endstylesheet %}
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user