-
Notifications
You must be signed in to change notification settings - Fork 0
/
collection-grid-item.liquid
42 lines (40 loc) · 1.73 KB
/
collection-grid-item.liquid
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{% if collection.image %}
{%- assign collection_image = collection.image -%}
{% elsif collection.products.first and collection.products.first.images != empty %}
{%- assign collection_image = collection.products.first.featured_image -%}
{% else %}
{% assign collection_image = blank %}
{% endif %}
<div class="collection-grid-item">
<a href="{% if collection.products == empty %}#{% else %}{{ collection.url }}{% endif %}" class="collection-grid-item__link">
{% unless collection_image == blank %}
<div class="collection-grid-item__overlay box ratio-container lazyload js"
data-bgset="{% include 'bgset', image: collection_image %}"
data-sizes="auto"
data-parent-fit="cover"
style="background-image: url('{{ collection_image | img_url: '300x300' }}')">
</div>
<noscript>
<div class="collection-grid-item__overlay" style="background-image: url('{{ collection_image | img_url: '1024x1024' }}')"></div>
</noscript>
{% else %}
{% if collection == empty %}
<div class="collection-grid-item__overlay">
{% capture current %}{% cycle 1, 2, 3 %}{% endcapture %}
{{ 'collection-' | append: current | placeholder_svg_tag: 'placeholder-svg' }}
</div>
{% else %}
<div class="collection-grid-item__overlay" style="background-image: url('{{ collection_image | img_url: '1024x1024' }}')"></div>
{% endif %}
{% endunless %}
<div class="collection-grid-item__title-wrapper">
<div class="collection-grid-item__title h3">
{% if collection.title == blank %}
{{ 'homepage.onboarding.collection_title' | t }}
{% else %}
{{ collection.title }}
{% endif %}
</div>
</div>
</a>
</div>