This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% if collection.image %} | |
<a href="{{ collection.url }}" class="collection__image" style="background-image: url('{{ collection.image | img_url: 'grande' }}');"> | |
<div class="collection__image__inner"></div> | |
{% else %} | |
{% if collection.products_count > 0 %} | |
{% assign collection_no_images = false %} | |
{% for product in collection.products %} | |
{% if product.featured_image %} | |
{% assign collection_fallback_img = product.featured_image %} | |
{% break %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% unless filter_options %} | |
{% capture _filter_options %} | |
{% for tag in collection.all_tags %}{% if tag contains 'filter-' %}{{ tag | remove: 'filter-' | strip }} {%endif%}{%endfor%} | |
{% endcapture %} | |
{% assign filter_options = _filter_options | split: ' ' %} | |
{% endunless %} | |
{% assign current_option = 'none' %} | |
{% capture _filters %} | |
{% for tag in filter_options %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function delay(callback, ms){ | |
var _timer = null; | |
return function(){ | |
clearTimeout(_timer); | |
_timer = setTimeout(callback, ms); | |
}; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// require() some stuff from npm (like you were using browserify) | |
// and then hit Run Code to run it on the right | |
var observable = require('lookoutjs'); | |
function on(event, element, observable, property, callback){ | |
element.addEventListener(event, function(e){ | |
observable[property] = e.target.value; | |
callback(observable[property]) | |
}, false); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// require() some stuff from npm (like you were using browserify) | |
// and then hit Run Code to run it on the right | |
var observable = require('lookoutjs'); | |
function on(event, element, observable, property, callback){ | |
element.addEventListener(event, function(e){ | |
observable[property] = e.target.value; | |
callback(observable[property]) | |
}, false); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default function(el){ | |
const input = el.querySelector('.js-counter-input') | |
const buttons = Array.prototype.slice.call(el.querySelectorAll('button')) | |
const state = { | |
min: parseInt(input.getAttribute('min'),10) || 0, | |
max: parseInt(input.getAttribute('max'),10) || 9999, | |
store: { | |
value: parseInt(input.value,10) | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jss from 'jss-browserify' | |
import stockpile from 'stockpile.js' | |
const storage = stockpile('GV') | |
window.STORE = storage | |
/** | |
* requestAnimationFrame polyfill | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import delegate from 'delegate' | |
const checkTouch = (root) => { | |
let select = root.querySelector('.js-select-outer') | |
let dropdown = root.querySelector('.js-dropdown') | |
if (!select) return | |
if (!window.feature.touch){ | |
dropdown.style.display = 'inline-block' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="{{form_outer_id}}" class="address__form relative w1 {{form_classes}}" style="display: none;"> | |
{% form 'customer_address', form_action %} | |
{% assign form_id = form.id %} | |
{% capture form_script %}{% if form_id == 'new' %}barrel.toggleNewForm(event){% else %}barrel.toggleForm(event, {{form_id}}){% endif %}{% endcapture %} | |
{% capture form_suffix %}{% if form_id and form_id != 'new' %}_{{form_id}}{% endif %}{% endcapture %} | |
{% capture form_city_id %}{% if form_id == 'new' %}AddressCityNew{% else %}AddressCity{% endif %}{% endcapture%} | |
{% capture form_country_id %}{% if form_id == 'new' %}AddressCountryNew{% else %}AddressCountry{% endif %}{% endcapture%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const objectFit = document.documentElement.style.hasOwnProperty('objectFit') | |
const images = Layzr({ threshold: 90 }) | |
images.on('src:after', img => { | |
let parent = img.parentNode | |
// optional, to style loaded state | |
parent.setAttribute('data-lazy', 'is-loaded') |
OlderNewer