Demas ajustes
This commit is contained in:
+118
-442
@@ -14,6 +14,42 @@
|
||||
assign banner_title = collection.title
|
||||
endif
|
||||
|
||||
assign banner_asset = blank
|
||||
case collection.handle
|
||||
when 'all-products'
|
||||
assign banner_asset = 'banner-todos-productos.avif'
|
||||
when 'proteccion-solar-1'
|
||||
assign banner_asset = 'banner-proteccion-solar.avif'
|
||||
when '4-protege-bloqueadores-solares'
|
||||
assign banner_asset = 'banner-protectores.avif'
|
||||
when 'hidratantes'
|
||||
assign banner_asset = 'banner-hidratantes.avif'
|
||||
when 'limpiadores'
|
||||
assign banner_asset = 'banner-limpiadores.avif'
|
||||
when 'mascarillas'
|
||||
assign banner_asset = 'banner-mascarillas.avif'
|
||||
when 'serum'
|
||||
assign banner_asset = 'banner-serums.avif'
|
||||
when 'kits-skincare-facial'
|
||||
assign banner_asset = 'banner-kits.avif'
|
||||
when 'piel-mixta-grasa'
|
||||
assign banner_asset = 'banner-piel-mixta-grasa.avif'
|
||||
when 'piel-grasa'
|
||||
assign banner_asset = 'banner-piel-grasa.avif'
|
||||
when 'piel-seca-1'
|
||||
assign banner_asset = 'banner-piel-seca.avif'
|
||||
when 'control-grasa'
|
||||
assign banner_asset = 'banner-control-grasa.avif'
|
||||
when 'acne-1'
|
||||
assign banner_asset = 'banner-preocupacion-acne.avif'
|
||||
when 'hidratacion'
|
||||
assign banner_asset = 'banner-preocupacion-hidratacion.avif'
|
||||
when 'antiedad-1'
|
||||
assign banner_asset = 'banner-antiedad.avif'
|
||||
when 'aclarar'
|
||||
assign banner_asset = 'banner-manchas.avif'
|
||||
endcase
|
||||
|
||||
assign banner_text = collection.metafields.custom.banner_texto.value | default: collection.metafields.custom.banner_text.value
|
||||
assign banner_text_is_html = false
|
||||
if banner_text == blank
|
||||
@@ -35,6 +71,10 @@
|
||||
assign show_hero = true
|
||||
endif
|
||||
|
||||
if banner_asset != blank
|
||||
assign show_hero = true
|
||||
endif
|
||||
|
||||
if show_grid_banner and grid_image == blank
|
||||
assign grid_image = collection.metafields.custom.banner_imagen.value | default: collection.metafields.custom.banner_image.value
|
||||
endif
|
||||
@@ -65,14 +105,28 @@
|
||||
data-cart-add-url="{{ routes.cart_add_url }}.js"
|
||||
>
|
||||
{% if show_hero %}
|
||||
<div class="collection__banner{% if banner_image == blank %} collection__banner--text{% endif %}">
|
||||
{% if banner_image != blank %}
|
||||
<div class="collection__banner{% if banner_asset == blank and banner_image == blank %} collection__banner--text{% endif %}">
|
||||
{% if banner_asset != blank %}
|
||||
<div class="collection__banner-media">
|
||||
<img
|
||||
class="collection__banner-image"
|
||||
src="{{ banner_asset | asset_url }}"
|
||||
alt="{{ banner_title | escape }}"
|
||||
width="1600"
|
||||
height="667"
|
||||
fetchpriority="high"
|
||||
loading="eager"
|
||||
decoding="async"
|
||||
>
|
||||
</div>
|
||||
{% elsif banner_image != blank %}
|
||||
<div class="collection__banner-media">
|
||||
{{
|
||||
banner_image
|
||||
| image_url: width: 1600
|
||||
| image_tag:
|
||||
alt: banner_title,
|
||||
fetchpriority: 'high',
|
||||
widths: '600, 960, 1400',
|
||||
sizes: '(max-width: 767px) 100vw, 50vw',
|
||||
class: 'collection__banner-image',
|
||||
@@ -125,8 +179,17 @@
|
||||
<p class="collection__count">{{ 'collection_page.products' | t: count: collection.products_count }}</p>
|
||||
</div>
|
||||
|
||||
<div class="collection__panel" id="collection-filters" data-filter-panel>
|
||||
<div class="collection__panel-inner">
|
||||
<div class="collection__drawer" id="collection-filters" data-filter-panel aria-hidden="true">
|
||||
<button class="collection__drawer-backdrop" type="button" data-filter-close tabindex="-1" aria-label="{{ 'collection_page.close_filters' | t }}"></button>
|
||||
<div class="collection__drawer-panel" role="dialog" aria-modal="true" aria-labelledby="collection-filters-title">
|
||||
<div class="collection__drawer-head">
|
||||
<h2 id="collection-filters-title" class="collection__drawer-title">{{ 'collection_page.filters' | t }}</h2>
|
||||
<button class="collection__drawer-close" type="button" data-filter-close aria-label="{{ 'collection_page.close_filters' | t }}">
|
||||
<svg width="14" height="14" viewBox="0 0 14 14" aria-hidden="true" focusable="false">
|
||||
<path d="M2 2l10 10M12 2L2 12" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
{% if collection.filters.size > 0 %}
|
||||
<form class="collection__filter-form" action="{{ collection.url }}" method="get">
|
||||
{% if current_sort != blank %}
|
||||
@@ -184,8 +247,17 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="collection__panel" id="collection-sort" data-sort-panel>
|
||||
<div class="collection__panel-inner">
|
||||
<div class="collection__drawer" id="collection-sort" data-sort-panel aria-hidden="true">
|
||||
<button class="collection__drawer-backdrop" type="button" data-sort-close tabindex="-1" aria-label="{{ 'collection_page.close_sort' | t }}"></button>
|
||||
<div class="collection__drawer-panel" role="dialog" aria-modal="true" aria-labelledby="collection-sort-title">
|
||||
<div class="collection__drawer-head">
|
||||
<h2 id="collection-sort-title" class="collection__drawer-title">{{ 'collection_page.sort_title' | t }}</h2>
|
||||
<button class="collection__drawer-close" type="button" data-sort-close aria-label="{{ 'collection_page.close_sort' | t }}">
|
||||
<svg width="14" height="14" viewBox="0 0 14 14" aria-hidden="true" focusable="false">
|
||||
<path d="M2 2l10 10M12 2L2 12" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
<form class="collection__sort-form" action="{{ collection.url }}" method="get">
|
||||
{% for filter in collection.filters %}
|
||||
{% if filter.type == 'price_range' %}
|
||||
@@ -275,463 +347,67 @@
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{% stylesheet %}
|
||||
.collection {
|
||||
background: #f9f9fa;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.collection__banner {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
min-height: 380px;
|
||||
background: #f7c585;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.collection__banner--text {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.collection__banner-media {
|
||||
height: 100%;
|
||||
min-height: 380px;
|
||||
max-height: 380px;
|
||||
}
|
||||
|
||||
.collection__banner-image {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
min-height: 380px;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.collection__banner-copy {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
gap: 22px;
|
||||
padding: 48px 180px 48px 70px;
|
||||
}
|
||||
|
||||
.collection__banner-title,
|
||||
.collection__fallback-title {
|
||||
margin: 0;
|
||||
font-size: 32px;
|
||||
font-weight: 700;
|
||||
line-height: normal;
|
||||
}
|
||||
|
||||
.collection__fallback-title {
|
||||
padding: 40px 100px 0;
|
||||
}
|
||||
|
||||
.collection__banner-text {
|
||||
max-width: 570px;
|
||||
font-size: 18px;
|
||||
font-weight: 300;
|
||||
line-height: 1.4;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.collection__banner-text p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.collection__banner-blob {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: 48px;
|
||||
width: 185px;
|
||||
height: auto;
|
||||
opacity: 0.8;
|
||||
pointer-events: none;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
|
||||
.collection__body {
|
||||
padding: 28px 100px 80px;
|
||||
}
|
||||
|
||||
.collection__bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 20px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.collection__tools {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.collection__tool {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 10px;
|
||||
height: 50px;
|
||||
padding: 0 18px;
|
||||
border: 1px solid #808181;
|
||||
border-radius: 60px;
|
||||
background: transparent;
|
||||
color: #000;
|
||||
font: inherit;
|
||||
font-size: 16px;
|
||||
font-weight: 300;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.collection__tool svg {
|
||||
display: block;
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
.collection__count,
|
||||
.collection__empty,
|
||||
.collection__none {
|
||||
margin: 0;
|
||||
font-size: 16px;
|
||||
font-weight: 300;
|
||||
}
|
||||
|
||||
.collection__panel {
|
||||
display: grid;
|
||||
grid-template-rows: 0fr;
|
||||
transition: grid-template-rows 0.28s ease;
|
||||
}
|
||||
|
||||
.collection__panel.is-open {
|
||||
grid-template-rows: 1fr;
|
||||
}
|
||||
|
||||
.collection__panel-inner {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.collection__filter-form,
|
||||
.collection__sort-form {
|
||||
padding: 22px 0 8px;
|
||||
}
|
||||
|
||||
.collection__filter-groups {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 28px 48px;
|
||||
}
|
||||
|
||||
.collection__filter {
|
||||
min-width: 180px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.collection__filter legend {
|
||||
margin-bottom: 10px;
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.04em;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.collection__options {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.collection__option {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
font-size: 15px;
|
||||
font-weight: 300;
|
||||
}
|
||||
|
||||
.collection__price {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.collection__price input {
|
||||
width: 110px;
|
||||
height: 40px;
|
||||
padding: 0 10px;
|
||||
border: 1px solid #d0d0d0;
|
||||
border-radius: 8px;
|
||||
background: #fff;
|
||||
font: inherit;
|
||||
}
|
||||
|
||||
.collection__filter-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
margin-top: 22px;
|
||||
}
|
||||
|
||||
.collection__apply {
|
||||
height: 44px;
|
||||
padding: 0 22px;
|
||||
border: 0;
|
||||
border-radius: 60px;
|
||||
background: #9dd6c7;
|
||||
color: #000;
|
||||
font: inherit;
|
||||
font-size: 15px;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.collection__clear {
|
||||
color: #000;
|
||||
font-size: 15px;
|
||||
font-weight: 300;
|
||||
}
|
||||
|
||||
.collection__sort-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.collection__sort-option {
|
||||
padding: 6px 0;
|
||||
border: 0;
|
||||
background: transparent;
|
||||
color: #000;
|
||||
font: inherit;
|
||||
font-size: 16px;
|
||||
font-weight: 300;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.collection__sort-option.is-current {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.collection__grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
gap: 28px 20px;
|
||||
margin-top: 28px;
|
||||
}
|
||||
|
||||
.collection__promo {
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
border-radius: 10px;
|
||||
aspect-ratio: 1;
|
||||
}
|
||||
|
||||
.collection__promo img {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.collection__empty {
|
||||
margin-top: 40px;
|
||||
}
|
||||
|
||||
.collection__pages {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 15px;
|
||||
margin-top: 48px;
|
||||
}
|
||||
|
||||
.collection__page,
|
||||
.collection__next {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border-radius: 25px;
|
||||
color: #000;
|
||||
font-size: 16px;
|
||||
font-weight: 300;
|
||||
line-height: 1;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.collection__page.is-current {
|
||||
background: #000;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.collection__next {
|
||||
background: #c9c9c9;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.collection__next svg {
|
||||
display: block;
|
||||
}
|
||||
|
||||
@media (max-width: 1119px) {
|
||||
.collection__banner-copy {
|
||||
padding: 36px 40px;
|
||||
}
|
||||
|
||||
.collection__banner-blob {
|
||||
width: 120px;
|
||||
right: 16px;
|
||||
}
|
||||
|
||||
.collection__body,
|
||||
.collection__fallback-title {
|
||||
padding-right: 24px;
|
||||
padding-left: 24px;
|
||||
}
|
||||
|
||||
.collection__grid {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.collection__banner {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 0;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.collection__banner-media {
|
||||
position: static;
|
||||
width: 100%;
|
||||
height: 250px;
|
||||
min-height: 250px;
|
||||
max-height: 250px;
|
||||
}
|
||||
|
||||
.collection__banner-image {
|
||||
width: 100%;
|
||||
height: 250px;
|
||||
min-height: 250px;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.collection__banner-copy {
|
||||
position: relative;
|
||||
justify-content: flex-start;
|
||||
gap: 15px;
|
||||
min-height: 250px;
|
||||
padding: 77px 20px 40px;
|
||||
overflow: hidden;
|
||||
background: #f7c585;
|
||||
}
|
||||
|
||||
.collection__banner-title {
|
||||
font-size: 25px;
|
||||
}
|
||||
|
||||
.collection__banner-text {
|
||||
font-size: 14px;
|
||||
line-height: 18px;
|
||||
}
|
||||
|
||||
.collection__banner-blob {
|
||||
display: block;
|
||||
top: 4px;
|
||||
right: 20px;
|
||||
width: 153px;
|
||||
transform: none;
|
||||
}
|
||||
|
||||
.collection__body {
|
||||
padding: 18px 10px 48px;
|
||||
}
|
||||
|
||||
.collection__fallback-title {
|
||||
padding: 24px 16px 0;
|
||||
font-size: 25px;
|
||||
}
|
||||
|
||||
.collection__bar {
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.collection__tools {
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.collection__tool {
|
||||
height: 40px;
|
||||
padding: 0 12px;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.collection__count {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.collection__grid {
|
||||
gap: 20px 10px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.collection__panel {
|
||||
transition: none;
|
||||
}
|
||||
}
|
||||
{% endstylesheet %}
|
||||
|
||||
{% javascript %}
|
||||
(() => {
|
||||
if (window.__seasonCollection) return;
|
||||
window.__seasonCollection = true;
|
||||
|
||||
const closePanels = (root) => {
|
||||
root.querySelectorAll('[data-filter-panel], [data-sort-panel]').forEach((panel) => {
|
||||
panel.classList.remove('is-open');
|
||||
});
|
||||
root.querySelectorAll('[data-filter-toggle], [data-sort-toggle]').forEach((button) => {
|
||||
button.setAttribute('aria-expanded', 'false');
|
||||
});
|
||||
};
|
||||
|
||||
const togglePanel = (root, name) => {
|
||||
const setPanel = (root, name, open) => {
|
||||
const panel = root.querySelector(`[data-${name}-panel]`);
|
||||
const button = root.querySelector(`[data-${name}-toggle]`);
|
||||
if (!panel || !button) return;
|
||||
const willOpen = !panel.classList.contains('is-open');
|
||||
closePanels(root);
|
||||
if (willOpen) {
|
||||
panel.classList.add('is-open');
|
||||
button.setAttribute('aria-expanded', 'true');
|
||||
}
|
||||
panel.classList.toggle('is-open', open);
|
||||
button.setAttribute('aria-expanded', open ? 'true' : 'false');
|
||||
if (!panel.classList.contains('collection__drawer')) return;
|
||||
panel.setAttribute('aria-hidden', open ? 'false' : 'true');
|
||||
const anyOpen = root.querySelector('.collection__drawer.is-open');
|
||||
document.documentElement.classList.toggle('overflow-hidden', Boolean(anyOpen));
|
||||
if (open) panel.querySelector('.collection__drawer-close')?.focus();
|
||||
};
|
||||
|
||||
document.addEventListener('click', (event) => {
|
||||
const root = event.target.closest('[data-collection]') || document.querySelector('[data-collection]');
|
||||
const root = event.target.closest('[data-collection]');
|
||||
if (!root) return;
|
||||
|
||||
if (event.target.closest('[data-filter-close]')) {
|
||||
setPanel(root, 'filter', false);
|
||||
root.querySelector('[data-filter-toggle]')?.focus();
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.target.closest('[data-sort-close]')) {
|
||||
setPanel(root, 'sort', false);
|
||||
root.querySelector('[data-sort-toggle]')?.focus();
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.target.closest('[data-filter-toggle]')) {
|
||||
togglePanel(root, 'filter');
|
||||
const panel = root.querySelector('[data-filter-panel]');
|
||||
const willOpen = !panel.classList.contains('is-open');
|
||||
setPanel(root, 'sort', false);
|
||||
setPanel(root, 'filter', willOpen);
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.target.closest('[data-sort-toggle]')) {
|
||||
togglePanel(root, 'sort');
|
||||
const panel = root.querySelector('[data-sort-panel]');
|
||||
const willOpen = !panel.classList.contains('is-open');
|
||||
setPanel(root, 'filter', false);
|
||||
setPanel(root, 'sort', willOpen);
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
if (!event.target.closest('[data-filter-panel], [data-sort-panel]')) {
|
||||
closePanels(root);
|
||||
}
|
||||
document.addEventListener('keydown', (event) => {
|
||||
if (event.key !== 'Escape') return;
|
||||
document.querySelectorAll('[data-collection]').forEach((root) => {
|
||||
const filtersOpen = root.querySelector('[data-filter-panel]')?.classList.contains('is-open');
|
||||
const sortOpen = root.querySelector('[data-sort-panel]')?.classList.contains('is-open');
|
||||
setPanel(root, 'filter', false);
|
||||
setPanel(root, 'sort', false);
|
||||
if (filtersOpen) root.querySelector('[data-filter-toggle]')?.focus();
|
||||
if (sortOpen) root.querySelector('[data-sort-toggle]')?.focus();
|
||||
});
|
||||
});
|
||||
})();
|
||||
{% endjavascript %}
|
||||
|
||||
Reference in New Issue
Block a user