Skip to content
- Choosing a selection results in a full page refresh.
window.routes = {
root_url: '/',
cart_url: '/cart',
cart_add_url: '/cart/add',
cart_change_url: '/cart/change',
cart_update_url: '/cart/update',
predictive_search_url: '/search/suggest'
};
window.cartStrings = {
error: `There was an error while updating your cart. Please try again.`,
quantityError: `You can only add [quantity] of this item to your cart.`
};
window.variantStrings = {
addToCart: `Add to cart`,
soldOut: `Sold out`,
unavailable: `Unavailable`,
preOrder: `Pre-order`
};
window.accessibilityStrings = {
imageAvailable: `Image [index] is now available in gallery view`
}
window.dateStrings = {
d: `D`,
day: `Day`,
days: `Days`,
hour: `Hour`,
hours: `Hours`,
minute: `Min`,
minutes: `Mins`,
second: `Sec`,
seconds: `Secs`
};
window.shopSettings = {
moneyFormat: "\u003cspan class=money\u003e${{amount}}\u003c\/span\u003e",
isoCode: "USD"
};class LazyImage extends HTMLElement {
constructor() {
super();
this.image = this.querySelector('img');
if (this.image) {
this.handleLazy();
const observer = new MutationObserver((changes) => {
changes.forEach((change) => {
if (change.attributeName.includes('src') || change.attributeName.includes('srcset')){
this.handleLazy();
}
});
});
observer.observe(this.image, {attributes : true});
}
}
handleLazy () {
if (!this.image.complete) {
this.parentNode.classList.add('loading');
this.image.addEventListener('load', () => {
this.parentNode.classList.remove('loading');
}, false);
}
}
}
customElements.define('lazy-image', LazyImage);(function() {
// Fixed: Largest Contentful Paint image was lazily loaded
const first_image = document.querySelector('#MainContent .shopify-section .media img');
if (first_image) first_image.setAttribute('loading', 'auto');
})();