Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into card-section
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishekjani08 committed Nov 30, 2023
2 parents c8306eb + 770507e commit 3815f5d
Show file tree
Hide file tree
Showing 5 changed files with 425 additions and 164 deletions.
4 changes: 4 additions & 0 deletions assets/output.css
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,10 @@ video {
position: sticky;
}

.isolate {
isolation: isolate;
}

.mx-auto {
margin-left: auto;
margin-right: auto;
Expand Down
31 changes: 31 additions & 0 deletions sections/custom-liquid.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<div style="background-color: {{ section.settings.background_color }};">
{{ section.settings.custom_liquid }}
</div>

{% schema %}

Check notice on line 5 in sections/custom-liquid.liquid

View workflow job for this annotation

GitHub Actions / Theme Check Report

sections/custom-liquid.liquid#L5

[SchemaJsonFormat] JSON formatting could be improved
{
"name": "Custom Liquid",
"tag": "section",
"class": "section",
"settings": [
{
"type": "liquid",
"id": "custom_liquid",
"label": "Custom Liquid",
"info": "Add app snippets or other code to create advanced customizations. [Learn more](https://shopify.dev/docs/api/liquid)"
},
{
"type": "color",
"id": "background_color",
"label": "Background Color",
"info": "Choose a background color for the section."
}
],
"presets": [
{
"name": "Custom Liquid"
}
]
}

{% endschema %}
19 changes: 11 additions & 8 deletions sections/dev__featured-blogs.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% assign blog = blogs[blog_handle] %}

<div class="featured-blog">
<{{ section.settings.heading_size }} class="featured-blog-heading">
<{{ section.settings.heading_size }} class="featured-blog__heading">
{{ section.settings.heading }}
</{{ section.settings.heading_size }}>

Expand All @@ -13,24 +13,28 @@
{{ article.image | image_url: 'master' | image_tag: article.title }}
{% endif %}

<{{ section.settings.article_heading_size }}>{{ article.title }}</{{ section.settings.article_heading_size }}>
<{{ section.settings.article_heading_size }} class="blog-post__title">
{{- article.title -}}
</{{ section.settings.article_heading_size }}>

{% if section.settings.show_date %}
<p class="post-date">{{ article.published_at | date: section.settings.date_format }}</p>
<p class="blog-post__date">{{ article.published_at | date: section.settings.date_format }}</p>
{% endif %}

{% if section.settings.show_author %}
<p class="post-author">{{ article.author.name }}</p>
<p class="blog-post__author">{{ article.author.name }}</p>
{% endif %}

<p>{{ article.content | strip_html | truncatewords: section.settings.truncate_words }}</p>
<a href="{{ article.url }}">{{ section.settings.read_more_text }}</a>
<p class="blog-post__content">
{{ article.content | strip_html | truncatewords: section.settings.truncate_words }}
</p>
<a href="{{ article.url }}" class="blog-post__read-more">{{ section.settings.read_more_text }}</a>
</article>
{% endfor %}
</div>

{% if section.settings.show_view_all %}
<a href="{{ blog.url }}" class="view-all">{{ section.settings.view_all_text }}</a>
<a href="{{ blog.url }}" class="featured-blog__view-all">{{ section.settings.view_all_text }}</a>
{% endif %}
</div>

Expand Down Expand Up @@ -194,4 +198,3 @@
]
}
{% endschema %}

223 changes: 223 additions & 0 deletions sections/dev_collage.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,223 @@
{% assign section_id = section.id %}
{% assign section_classes = 'section-' | append: section_id | append: '-padding' %}

<div class="color-{{ section.settings.color_scheme }} gradient isolate">
<div class="page-width {{ section_classes }}">
{% if section.settings.heading != blank %}
<h2 class="collage-wrapper-title inline-richtext {{ section.settings.heading_size }}">
{{ section.settings.heading }}
</h2>
{% endif %}
<div class="collage{% if section.settings.mobile_layout == 'collage' %} collage--mobile{% endif %}">
{% for block in section.blocks %}
<div class="collage__item collage__item--{{ block.type }} collage__item--{{ section.settings.desktop_layout }}">
{% case block.type %}
{% when 'image' %}
<div class="collage-card">
<div class="media media--transparent ratio">
{{ block.settings.image | img_url: 'master' | img_tag: 'collage-image' }}

Check warning on line 18 in sections/dev_collage.liquid

View workflow job for this annotation

GitHub Actions / Theme Check Report

sections/dev_collage.liquid#L18

[DeprecatedFilter] Deprecated filter `img_url`, consider using `image_url`

Check warning on line 18 in sections/dev_collage.liquid

View workflow job for this annotation

GitHub Actions / Theme Check Report

sections/dev_collage.liquid#L18

[DeprecatedFilter] Deprecated filter `img_tag`, consider using an alternative: `image_tag`
</div>
</div>
{% when 'product' %}
<div class="collage-card product-card">
{% if block.settings.second_image %}
{{ block.settings.second_image | img_url: 'master' | img_tag: 'second-image' }}

Check warning on line 24 in sections/dev_collage.liquid

View workflow job for this annotation

GitHub Actions / Theme Check Report

sections/dev_collage.liquid#L24

[DeprecatedFilter] Deprecated filter `img_url`, consider using `image_url`

Check warning on line 24 in sections/dev_collage.liquid

View workflow job for this annotation

GitHub Actions / Theme Check Report

sections/dev_collage.liquid#L24

[DeprecatedFilter] Deprecated filter `img_tag`, consider using an alternative: `image_tag`
{% else %}
<div class="product">
<h3 class="product__title">{{ block.settings.product.title }}</h3>
<p class="product__description">{{ block.settings.product.description }}</p>
<p class="product__price">Price: {{ block.settings.product.price | money }}</p>
<p class="product__sku">SKU: {{ block.settings.product.sku }}</p>
<!-- Add more product details as needed -->
<a href="{{ block.settings.product.url }}" class="btn btn-primary">Shop Now</a>
</div>
{% endif %}
</div>
{% when 'collection' %}
<div class="collage-card collection-card">
<div class="collection">
<h3 class="collection__title">{{ block.settings.collection.title }}</h3>
<p class="collection__description">{{ block.settings.collection.description }}</p>
<!-- Display collection items or details as needed -->
<a href="{{ block.settings.collection.url }}" class="btn btn-secondary">{{ block.settings.collection_text | default: block.settings.collection.title }}</a>
</div>
</div>
{% when 'video' %}
<div class="collage-card video-card">
<div class="media media--transparent ratio">
{{ block.settings.cover_image | img_url: 'master' | img_tag: 'video-cover' }}

Check warning on line 48 in sections/dev_collage.liquid

View workflow job for this annotation

GitHub Actions / Theme Check Report

sections/dev_collage.liquid#L48

[DeprecatedFilter] Deprecated filter `img_url`, consider using `image_url`

Check warning on line 48 in sections/dev_collage.liquid

View workflow job for this annotation

GitHub Actions / Theme Check Report

sections/dev_collage.liquid#L48

[DeprecatedFilter] Deprecated filter `img_tag`, consider using an alternative: `image_tag`
</div>
<a href="{{ block.settings.video_url }}" class="collage-card__link"></a>
</div>
{% endcase %}
</div>
{% endfor %}
</div>
</div>
</div>

{% schema %}

Check notice on line 59 in sections/dev_collage.liquid

View workflow job for this annotation

GitHub Actions / Theme Check Report

sections/dev_collage.liquid#L59

[SchemaJsonFormat] JSON formatting could be improved
{
"name": "Custom Collage",
"tag": "section",
"class": "section",
"settings": [
{
"type": "inline_richtext",
"id": "heading",
"default": "Multimedia Collage",
"label": "Heading"
},
{
"type": "select",
"id": "heading_size",
"options": [
{ "value": "h2", "label": "H2" },
{ "value": "h1", "label": "H1" },
{ "value": "h0", "label": "H0" }
],
"default": "h1",
"label": "Heading Size"
},
{
"type": "select",
"id": "desktop_layout",
"options": [
{ "value": "left", "label": "Left" },
{ "value": "right", "label": "Right" }
],
"default": "left",
"label": "Desktop Layout"
},
{
"type": "select",
"id": "mobile_layout",
"options": [
{ "value": "collage", "label": "Collage" },
{ "value": "column", "label": "Column" }
],
"default": "column",
"label": "Mobile Layout"
},
{
"type": "select",
"id": "card_styles",
"options": [
{ "value": "none", "label": "None" },
{ "value": "product-card-wrapper", "label": "Product Card Wrapper" }
],
"default": "product-card-wrapper",
"label": "Card Styles"
},
{
"type": "color_scheme",
"id": "color_scheme",
"label": "Color Scheme",
"default": "scheme-1"
},
{
"type": "range",
"id": "padding_top",
"min": 0,
"max": 100,
"step": 4,
"unit": "px",
"label": "Padding Top",
"default": 36
},
{
"type": "range",
"id": "padding_bottom",
"min": 0,
"max": 100,
"step": 4,
"unit": "px",
"label": "Padding Bottom",
"default": 36
}
],
"blocks": [
{
"type": "image",
"name": "Image",
"settings": [
{
"type": "image_picker",
"id": "image",
"label": "Image"
}
]
},
{
"type": "product",
"name": "Product",
"settings": [
{
"type": "product",
"id": "product",
"label": "Product"
},
{
"type": "checkbox",
"id": "second_image",
"default": false,
"label": "Second Image"
}
]
},
{
"type": "collection",
"name": "Collection",
"settings": [
{
"type": "collection",
"id": "collection",
"label": "Collection"
},
{
"type": "text",
"id": "collection_text",
"label": "Collection Display Text",
"info": "Defaults to collection name if empty"
}
]
},
{
"type": "video",
"name": "Video",
"settings": [
{
"type": "image_picker",
"id": "cover_image",
"label": "Video Cover Image"
},
{
"type": "video_url",
"id": "video_url",
"accept": ["youtube", "vimeo"],
"default": "https://www.youtube.com/watch?v=_9VUPq3SxOc",
"label": "Video URL",
"info": "Enter the video URL"
}
]
}
],
"max_blocks": 3,
"presets": [
{
"name": "Custom Collage",
"blocks": [
{
"type": "image"
},
{
"type": "product"
},
{
"type": "collection"
}
]
}
]
}
{% endschema %}
Loading

0 comments on commit 3815f5d

Please sign in to comment.