Skip to content

Commit

Permalink
Update from Shopify for theme sneakerlab/trunk
Browse files Browse the repository at this point in the history
Committed from shop: Sneaker Lab 2022
  • Loading branch information
shopify[bot] authored Aug 27, 2024
1 parent 6ef56dc commit 8a1028a
Show file tree
Hide file tree
Showing 17 changed files with 138 additions and 68 deletions.
1 change: 1 addition & 0 deletions layout/blank-layout.liquid
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{% include 'shogun-content-handler' %}
<!doctype html>
<html class="no-js" lang="{{ request.locale.iso_code }}">
<head>
Expand Down
1 change: 1 addition & 0 deletions layout/old-layout.liquid
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{% include 'shogun-content-handler' %}
<!doctype html>
<html class="no-js" lang="{{ request.locale.iso_code }}">
<head>
Expand Down
1 change: 1 addition & 0 deletions layout/password.liquid
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{% include 'shogun-content-handler' %}
<!doctype html>
<html class="no-js full-height" lang="{{ request.locale.iso_code }}">
<head>
Expand Down
1 change: 1 addition & 0 deletions layout/product.liquid
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{% include 'shogun-content-handler' %}
<!doctype html>
<html class="no-js" lang="{{ request.locale.iso_code }}">
<head>
Expand Down
1 change: 1 addition & 0 deletions layout/test-theme.liquid
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{% include 'shogun-content-handler' %}
<!doctype html>
<html class="no-js" lang="{{ request.locale.iso_code }}">
<head>
Expand Down
1 change: 1 addition & 0 deletions layout/theme.liquid
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{% include 'shogun-content-handler' %}
<!doctype html>
<html class="no-js" lang="{{ request.locale.iso_code }}">
<head>
Expand Down
1 change: 1 addition & 0 deletions layout/theme.maintenance.liquid
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{% include 'shogun-content-handler' %}
<!doctype html>
<html class="no-js" lang="{{ request.locale.iso_code }}">
<head>
Expand Down
67 changes: 1 addition & 66 deletions layout/theme.shogun.landing.liquid
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{% include 'shogun-content-handler' %}

Check warning on line 1 in layout/theme.shogun.landing.liquid

View workflow job for this annotation

GitHub Actions / Theme Check Report

layout/theme.shogun.landing.liquid#L1

[ConvertIncludeToRender] `include` is deprecated - convert it to `render`
{% comment %}
Auto-generated by Shogun.
This file can be re-written at any time.
Expand Down Expand Up @@ -85,72 +86,6 @@ This file can be re-written at any time.
{{ content_for_layout }}

<script>
const Marquee = () => {
const elements = document.querySelectorAll('.marquee')
const lastScrollPos = 0
let speed = 3
let timer
elements.forEach(function (el) {
const marqueeWrapper = el.parentNode;
const container = el.querySelector('.inner')
const content = el.querySelector('.inner > *')
const style = window.getComputedStyle(el.querySelector('.inner > p'));
const elWidth = container.offsetWidth;
const clone = content.cloneNode(true)
container.appendChild(clone)
let progress = 1
let isPlaying = false;
function loop () {
progress = progress - speed
if (progress <= elWidth * -1) {
progress = 0
}
container.style.transform = 'translateX(' + progress + 'px)'
container.style.transform += 'skewX(' + speed * 0.4 + 'deg)'
// window.requestAnimationFrame(loop)
if (isPlaying === true) requestAnimationFrame(loop);
}
marqueeWrapper.addEventListener('mouseenter', function () {
isPlaying = true;
loop();
});
marqueeWrapper.addEventListener('mouseleave', function () {
isPlaying = false;
loop();
});
loop()
})
//window.addEventListener('scroll', function () {
//const maxScrollValue = 12
//const newScrollPos = window.scrollY
//let scrollValue = newScrollPos - lastScrollPos
//if (scrollValue > maxScrollValue) scrollValue = maxScrollValue
//else if (scrollValue < -maxScrollValue) scrollValue = -maxScrollValue
//speed = 0
//clearTimeout(timer)
//timer = setTimeout(handleSpeedClear, 10)
//})
//function handleSpeedClear () {
//speed = 2
//}
}
window.addEventListener('load', () => {
Marquee();
});
// Marquee()
</script>
<script>
window.shopUrl = '{{ request.origin }}';
Expand Down
20 changes: 20 additions & 0 deletions sections/shogun-optimizer.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{% comment %}
Auto-generated by Shogun.
This file can be re-written at any time.
{% endcomment %}

{% if article %}
{% assign content = article %}
{% elsif page %}
{% assign content = page %}
{% elsif product %}
{% assign content = product %}
{% elsif collection %}
{% assign content = collection %}
{% endif %}
{{content.metafields.shogun.optimizer}}
{% schema %}
{
"name": "Shogun Optimizer"
}
{% endschema %}
62 changes: 62 additions & 0 deletions snippets/shogun-content-handler.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{% comment %}
Auto-generated by Shogun.
This file can be re-written at any time.
{% endcomment %}

{% assign template_suffix = template.suffix %}

{% if article %}
{% assign content = article %}
{% elsif page %}
{% assign content = page %}
{% elsif product %}
{% assign content = product %}
{% elsif collection %}
{% assign content = collection %}

{% endif %}

{% capture content_for_header %}
{{ content_for_header }}
{% render 'shogun-products', content: content %}
{% endcapture %}

{% if content.metafields.shogun.json_template_snippets %}
{% capture content_for_header %}
{{ content_for_header }}
{{ content.metafields.shogun.json_template_snippets.value['head'][template_suffix] }}
{% endcapture %}

{% capture content_for_body %}
{{ content_for_layout }}
{{ content.metafields.shogun.json_template_snippets.value['body'][template_suffix] }}
{% endcapture %}
{% endif %}

{% if content.metafields.shogun.json_template_html_wrapper %}
{% assign json_template_config = content.metafields.shogun.json_template_html_wrapper.value %}
{% capture content_for_layout %}
{{
json_template_config.html
| replace: json_template_config.content_for_layout_placeholder, content_for_layout
| replace: json_template_config.page_variant_id_placeholder, json_template_config.template_suffix_to_variant_id_map[template_suffix]
}}
{% endcapture %}
{% endif %}

{% if content.metafields.shogun.json_template_optimizer %}
{% capture content_for_header %}
<template id="shogun-variant-head">
{{ content_for_header }}
</template>
{{ content.metafields.shogun.json_template_optimizer.value['head'] }}
{% endcapture %}

{% capture content_for_layout %}
<template id="shogun-variant-body">
{{ content_for_layout }}
</template>
{{ content.metafields.shogun.json_template_optimizer.value['body'] }}
{% endcapture %}
{% endif %}

17 changes: 16 additions & 1 deletion templates/article.collaborations.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/*
* ------------------------------------------------------------
* IMPORTANT: The contents of this file are auto-generated.
*
* This file may be updated by the Shopify admin theme editor
* or related systems. Please exercise caution as any changes
* made to this file may be overwritten.
* ------------------------------------------------------------
*/
{
"sections": {
"main": {
Expand Down Expand Up @@ -100,11 +109,17 @@
"type": "shogun-helper",
"settings": {
}
},
"shogun-optimizer": {
"type": "shogun-optimizer",
"settings": {
}
}
},
"order": [
"shogun-helper",
"main",
"featured-stories"
"featured-stories",
"shogun-optimizer"
]
}
7 changes: 7 additions & 0 deletions templates/article.shogun.custom.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{% comment %}
Auto-generated by Shogun.
This file can be re-written at any time.
{% endcomment %}

{% render 'shogun-products', content: page %}
{{ article.content }}
17 changes: 16 additions & 1 deletion templates/article.test.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/*
* ------------------------------------------------------------
* IMPORTANT: The contents of this file are auto-generated.
*
* This file may be updated by the Shopify admin theme editor
* or related systems. Please exercise caution as any changes
* made to this file may be overwritten.
* ------------------------------------------------------------
*/
{
"sections": {
"main": {
Expand Down Expand Up @@ -45,11 +54,17 @@
"type": "shogun-helper",
"settings": {
}
},
"shogun-optimizer": {
"type": "shogun-optimizer",
"settings": {
}
}
},
"order": [
"shogun-helper",
"main",
"featured-stories"
"featured-stories",
"shogun-optimizer"
]
}
6 changes: 6 additions & 0 deletions templates/collection.shogun.custom.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{% comment %}
Auto-generated by Shogun.
This file can be re-written at any time.
{% endcomment %}

{{ collection.description }}
1 change: 1 addition & 0 deletions templates/page.shogun.default.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ This file can be re-written at any time.
{% render 'shogun-products', content: page %}
<div class="shg-clearfix"></div>
{{ page.content }}
{{ page.metafields.shogun.optimizer }}
1 change: 1 addition & 0 deletions templates/page.shogun.landing.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ This file can be re-written at any time.
{% render 'shogun-products', content: page %}
{% layout 'theme.shogun.landing' %}
{{ page.content }}
{{ page.metafields.shogun.optimizer }}
1 change: 1 addition & 0 deletions templates/product.shogun.custom.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ This file can be re-written at any time.

{% render 'shogun-products', content: product %}
{{product.metafields.shogun.main}}
{{ product.metafields.shogun.optimizer }}

0 comments on commit 8a1028a

Please sign in to comment.