(function() {
loadjQuery()
.then(() => {
var jQInf = jQuery.noConflict(true);
initialize(jQInf);
})
.catch((error) => console.error("Error loading jQuery:", error));
function loadjQuery() {
return new Promise((resolve, reject) => {
var loadScript = (src, integrity) => {
var script = document.createElement('script');
script.src = src;
if (integrity) {
script.integrity = integrity;
script.crossOrigin = 'anonymous';
}
script.onload = () => resolve(window.jQuery);
script.onerror = () => {
if (src === 'https://code.jquery.com/jquery-3.6.0.min.js') {
// Fallback to alternative source
loadScript('https://cdn.bootcss.com/jquery/3.1.1/jquery.min.js', 'sha384-3ceskX3iaEnIogmQchP8opvBy3Mi7Ce34nWjpBIwVTHfGYWQS9jwHDVRnpKKHJg7');
} else {
reject(new Error('Failed to load jQuery'));
}
};
document.head.appendChild(script);
};
loadScript('https://code.jquery.com/jquery-3.6.0.min.js', 'sha384-vtXRMe3mGCbOeY7l30aIg8H9p3GdeSe4IFlP6G8JMa7o7lXvnz3GFKzPxzJdPfGK');
});
}
function initialize($) {
console.log("%cLoad products while scrolling - Powered by Scrollify", "font-weight: bold; background-color: #fff; color: #000");
console.log("Get it here: https://apps.shopify.com/scrollify-infinite-scroll");
getData($)
.then(settings => {
var data = JSON.parse(settings.data[0].data);
var gif = settings.data[0].customGif;
var status = settings.data[0].status;
setupPage($, data,gif);
})
.catch(error => console.error("Error getting data:", error));
}
function getData($) {
var infinite = "/apps/infinite";
var cleverlink = Shopify.shop || "shopallthinge.myshopify.com";
return $.ajax({
type: "POST",
url: infinite,
data: { shop: cleverlink }
});
}
function setupPage($, data,gif) {
// Your code for setting up the page, themes, and listeners
// Refactor this part into smaller functions as needed
console.log(gif);
var status = data.checked;
var customgif = gif || 'https://media.tenor.com/uuEPRFM5xdcAAAAi/loader.gif';
if (data.showbutton === "No" || data.showbutton === "1") {
loaderMode = 1;
} else {
loaderMode = 2;
}
loadMoreBtnText = data.buttonText;
oncegoI = false;
specialTheme = 0;
gsLastUrl = '';
XMLHttpRequest.prototype.gsOpen = XMLHttpRequest.prototype.open;
XMLHttpRequest.prototype.gsSend = XMLHttpRequest.prototype.send;
$(window).ready(function() {
if (!oncegoI) {
specialTheme = 0;
$("body").append('');
if ($(".container-pushy-main").length > 0 && $("#category-sticky-parent").length > 0 && $(".pagination-buttons").length > 0) {
$("#category-sticky-parent").after($($(".pagination-buttons").get(0)));
}
// TESTAMENT
if (($("#product-loop .product-index").length > 0) && ($("#product-loop .first").length > 0)) {
$("body").append('');
specialTheme = 6;
}
// VENUE
if ($(".o-layout__item").length > 0) {
$("body").append("");
}
// ENVY
if ($("#Collection .indiv-product-wrapper").length > 0) {
specialTheme = 9;
}
// ICON
if ($("#bside #product-loop .product").length > 0) {
specialTheme = 8;
$("body").append('');
}
// TURBO
if (($(".columns .collection-matrix .one-third").length > 0) || ($(".columns .collection-matrix .four").length > 0) || ($(".columns .collection-matrix .eight").length > 0)) {
specialTheme = 2;
setInterval(function() {
$(".js-forms .viewed").removeClass("viewed");
}, 1000);
}
// PARALLAX
if (($("#shopify-section-collection-template .one-third").length > 0) || ($("#shopify-section-collection-template .four .product_image .image__container").length > 0) || ($("#shopify-section-collection-template .eight .product_image .image__container").length > 0)) {
$("html").css("opacity", '1');
$("body").append("");
specialTheme = 2;
}
// VANTAGE
if (($(".product-loop .medium_grid .product-index-inner .box-ratio").length > 0) || ($(".product-loop .large_grid .product-index-inner .box-ratio").length > 0)) {
specialTheme = 13;
$("body").append('');
}
// SPLIT
if ($(".site-box-container .box__collection").length > 0) {
$("body").append("");
specialTheme = 12;
}
if (($(".quickshop .quickshop-spinner").length > 0) && ($(".quick-shop-modal-trigger").length > 0)) {
specialTheme = 15;
}
// ATLANTIC
if ($(".product-list .product .product-card-figure").length > 0) {
specialTheme = 11;
}
// KINGDOM
if (($(".isotope-products .three .grid-item-image").length > 0)) {
$("body").append('');
specialTheme = 17;
}
// SHOWCASE
if (($(".wide-container .jiggly-split").length > 0)) {
specialTheme = 16;
}
// CASCADE
if (($(".collection-cascade .resp-img-wrapper .resp-img-placeholder").length > 0)) {
specialTheme = 18;
}
if (($('.collection-listing .product-crop-tall .product-list-item figure[data-rimg-template*="shopif"]').length > 0)) {
specialTheme = 33;
//$("body").append('');
}
// COLORS
if (($(".col-0 .inner .table .cell").length > 0)) {
specialTheme = 21;
$("body").append('');
}
setInterval(function() {
try {
$(".lazyloading").each(function() {
$(this).removeClass("lazyloading");
$(this).addClass("lazyloaded");
});
} catch (err) {}
}, 3000);
//console.debug("special theme " + specialTheme);
try {
$("#bc-sf-filter-top-pagination").remove();
} catch (error) {}
if ($(".pagination").length == 2) {
$($(".pagination").get(0)).remove();
}
gsLastUrl = window.location.href;
if (!(window.location.href.indexOf("/products/") > 0)) {
setInterval(function() {
try {
if (gsLastUrl.length > 5 && window.location.href !== gsLastUrl) {
var url = window.location.href;
if (url.includes("/collections") || url.includes("/search")) {
gsLastUrl = url;
window.location.reload();
}
}
} catch (err) {}
try {
$($('body').get(0)).find("img[src*='loader.gif']").each(function() {
if ($(this).hasClass("product_image--current")) {
$(this).attr("src", $(this).attr('data-src'));
}
});
} catch (err) {}
}, 1000);
}
$("body").append("");
oncegoI = true;
if ($("#wrapper1 #collection_sorted .product_listing_controls .products_count").length > 0) {
specialTheme = 1;
}
if (specialTheme == 1) {
setTimeout(function() {
gsscroller = new GSLoader();
}, 1000);
} else {
gsscroller = new GSLoader();
}
}
});
paginateSel = null;
paginateSelector = '';
collectionParent = '';
collectionPageNr = 1;
gsscroller = null;
containerPos = 1;
productsParentTmp = null;
function getUrlParamsGS(prop) {
var params = {};
var search = decodeURIComponent(window.location.href.slice(window.location.href.indexOf('?') + 1));
var definitions = search.split('&');
definitions.forEach(function(val, key) {
var parts = val.split('=', 2);
params[parts[0]] = parts[1];
});
return (prop && prop in params) ? params[prop] : null;
}
var fixThemeSpecial = function() {
if (specialTheme == 6) {
var gsProductsPerRow = 0;
var gsCntProductsInRow = 0;
if ($("#product-loop").find(".desktop-6").length > 0) {
gsProductsPerRow = 2;
}
if ($("#product-loop").find(".desktop-4").length > 0) {
gsProductsPerRow = 3;
}
if ($("#product-loop").find(".desktop-3").length > 0) {
gsProductsPerRow = 4;
}
if ($("#product-loop").find(".desktop-2").length > 0) {
gsProductsPerRow = 6;
}
if ($("#product-loop").find(".desktop-fifth").length > 0) {
gsProductsPerRow = 5;
}
if (gsProductsPerRow == 0) {
gsProductsPerRow = 4;
}
var gsCounterOdds = 1;
$("#product-loop .product-index").each(function(index) {
var loazyloaders = $(this).find(".lazyloading");
if (loazyloaders.length > 0) {
var mainlazyloader = $(loazyloaders.get(0));
mainlazyloader.removeClass("lazyloading");
mainlazyloader.addClass("lazyloaded");
}
$(this).removeClass("first");
$(this).removeClass("last");
if (gsCounterOdds == 1) {
$(this).addClass("first");
}
if (gsCounterOdds == gsProductsPerRow) {
$(this).addClass("last");
}
if (gsCounterOdds == gsProductsPerRow) {
gsCounterOdds = 0;
}
gsCounterOdds++;
});
}
if (specialTheme == 16) {
colCnt = 1;
$(".product-block").each(function(index) {
var cardImage = $($(this).find(".lazyloading").get(0));
cardImage.removeClass("lazyloading");
cardImage.addClass("lazyloaded");
var productBlockGS = $(".col-" + colCnt).find(".product-block").get(0);
$(productBlockGS).appendTo("#page-content");
colCnt++;
if (colCnt == 4) {
colCnt = 1;
}
});
$(".product-list .product-block").each(function(index) {
$(this).appendTo("#page-content");
});
colCnt = 1;
$(".product-block").each(function(index) {
$(".col-" + colCnt).append($(this));
colCnt++;
if (colCnt == 4) {
colCnt = 1;
}
});
}
if (specialTheme == 17) {
try {
$(".grid-item").each(function(index) {
$(this).addClass("loaded");
});
if (jQuery('.isotope-products').length > 0) {
jQuery('.isotope-products').each(function() {
window.KINGDOM.Grid.mount(jQuery(this))
});
}
} catch (err) {}
}
if (specialTheme == 18) {
try {
$("body").append($('script[src*="assets/theme.min.js"]').get(0).outerHTML.replace('defer="defer"', ''));
} catch (err) {}
}
if (specialTheme == 9) {
var gsNumberOfColumns = 0
if ($("#Collection").find(".six_columns").length > 0) {
gsNumberOfColumns = 6;
}
if ($("#Collection").find(".five_columns").length > 0) {
gsNumberOfColumns = 5;
}
if ($("#Collection").find(".four_columns").length > 0) {
gsNumberOfColumns = 4;
}
if ($("#Collection").find(".three_columns").length > 0) {
gsNumberOfColumns = 3;
}
if ($("#Collection").find(".two_columns").length > 0) {
gsNumberOfColumns = 2;
}
if (gsNumberOfColumns == 0) {
gsNumberOfColumns = 4;
}
$(".product_clear").remove();
var gsCounterOdds = 1;
var gsCounterThree = 1;
$("#Collection .indiv-product-wrapper").each(function(index) {
$(this).removeClass("alpha");
$(this).removeClass("omega");
$(this).removeClass("even");
$(this).removeClass("odd");
$(this).removeClass("tablet-clear");
$(this).removeClass("mobile-clear");
if (gsCounterOdds == 1) {
$(this).addClass("even");
$(this).addClass("tablet-clear");
$(this).addClass("mobile-clear");
} else {
$(this).addClass("odd");
}
if (gsCounterThree == 1) {
$(this).addClass("alpha");
}
if (gsCounterThree == gsNumberOfColumns) {
$(this).addClass("omega");
$(this).after('
');
}
if (gsCounterOdds == 2) {
gsCounterOdds = 0;
}
if (gsCounterThree == gsNumberOfColumns) {
gsCounterThree = 0;
}
gsCounterOdds++;
gsCounterThree++;
});
}
if (specialTheme == 12) {
$("#section-collection .site-box").each(function(index) {
$(this).addClass("active");
});
}
if (specialTheme == 13) {
var gsCounterOdds = 1;
var gsNumberOfColumns = 0
if ($($(".product-loop").get(0)).find(".desktop-6").length > 0) {
gsNumberOfColumns = 2;
}
if ($($(".product-loop").get(0)).find(".desktop-4").length > 0) {
gsNumberOfColumns = 3;
}
if ($($(".product-loop").get(0)).find(".desktop-3").length > 0) {
gsNumberOfColumns = 4;
}
if (gsNumberOfColumns == 0) {
gsNumberOfColumns = 3;
}
$(".product-loop .product-index").each(function(index) {
$(this).removeClass("first");
$(this).removeClass("last");
if (gsCounterOdds == 1) {
$(this).addClass("first");
}
if (gsCounterOdds == gsNumberOfColumns) {
$(this).addClass("last");
}
if (gsCounterOdds == gsNumberOfColumns) {
gsCounterOdds = 0;
}
gsCounterOdds++;
});
}
if (specialTheme == 8) {
var gsNumberOfColumns = 0
if ($("#product-loop").find(".desktop-6").length > 0) {
gsNumberOfColumns = 2;
}
if ($("#product-loop").find(".desktop-4").length > 0) {
gsNumberOfColumns = 3;
}
if ($("#product-loop").find(".desktop-3").length > 0) {
gsNumberOfColumns = 4;
}
if (gsNumberOfColumns == 0) {
gsNumberOfColumns = 4;
}
var gsCounterOdds = 1;
$("#product-loop .product").each(function(index) {
$(this).removeClass("first");
$(this).removeClass("last");
if (gsCounterOdds == 1) {
$(this).addClass("first");
}
if (gsCounterOdds == gsNumberOfColumns) {
$(this).addClass("last");
}
if (gsCounterOdds == gsNumberOfColumns) {
gsCounterOdds = 0;
}
gsCounterOdds++;
});
}
if (specialTheme == 2 || specialTheme == 10) {
$(".product_clear").remove();
var gsCounterOdds = 1;
var gsCounterThree = 1;
var gsNumberOfColumns = 3;
var GSproductQuery = '#shopify-section-collection-template .products .one-third';
if ($(".collection-matrix .columns").length > 0) {
GSproductQuery = '.collection-matrix .columns';
}
if ($("#shopify-section-collection-template .products .eight").length > 0) {
gsNumberOfColumns = 2;
GSproductQuery = '#shopify-section-collection-template .products .eight';
}
if ($("#shopify-section-collection-template .products .one-third").length > 0) {
gsNumberOfColumns = 3;
GSproductQuery = '#shopify-section-collection-template .products .one-third';
}
if ($("#shopify-section-collection-template .products .four").length > 0) {
gsNumberOfColumns = 4;
GSproductQuery = '#shopify-section-collection-template .products .four';
}
$(GSproductQuery).not(".modal_image").each(function(index) {
$(this).removeClass("alpha");
$(this).removeClass("omega");
$(this).removeClass("even");
$(this).removeClass("odd");
if (gsCounterOdds == 1) {
$(this).addClass("even");
} else {
$(this).addClass("odd");
}
if (gsCounterThree == 1) {
$(this).addClass("alpha");
}
if (gsCounterThree == gsNumberOfColumns) {
$(this).addClass("omega");
$(this).after('
');
}
if (gsCounterOdds == 2) {
gsCounterOdds = 0;
}
if (gsCounterThree == gsNumberOfColumns) {
gsCounterThree = 0;
}
gsCounterOdds++;
gsCounterThree++;
});
}
$(".lazyloading").each(function() {
$(this).removeClass("lazyloading");
$(this).addClass("lazyloaded");
});
try {
collection.init();
} catch (err) {}
}
var GSLoader = function() {
var url = window.location.href;
// Consolidate return conditions
if (url.indexOf("/products/") > 0 || url.indexOf("/blogs/") > 0 ||
(url.indexOf("/collections/") === -1 && url.indexOf("/search") === -1 && url.indexOf("/products/") === -1)) {
if (url.indexOf("/products/") > 0) {
try {
sessionStorage.setItem('gsproductviewed', '1');
} catch (err) {}
}
return;
}
// Check for specific hash in URL
if (window.location.hash === '#76dc') {
return;
}
try {
//if(sessionStorage.getItem('gscollectionurl') != window.location.href) {
if ((sessionStorage.getItem('gscollectionurl') != window.location.href) || ($(".medium-up--one-half, .medium-up--one-third").length > 1 && ($('.card').length > 0))) {
sessionStorage.setItem('gscollectionurl', window.location.href);
sessionStorage.setItem('gscollectioncontent', '');
sessionStorage.setItem('gspaginatecontent', '');
sessionStorage.setItem('gscollectionpagenr', '');
}
if (sessionStorage.getItem('gsproductviewed') == null || sessionStorage.getItem('gsproductviewed') == '0') {
sessionStorage.setItem('gscollectionurl', window.location.href);
sessionStorage.setItem('gscollectioncontent', '');
sessionStorage.setItem('gspaginatecontent', '');
sessionStorage.setItem('gscollectionpagenr', '');
}
sessionStorage.setItem('gsproductviewed', '0');
} catch (err) {}
paginateSelector = '.pagination';
collectionParent = '.products';
collectionParent = this.findCollectionParent();
if ($('.pagination').length == 0) {
paginateSelector = '';
var paginationNodes = $(collectionParent).find('*[class*="agination"]');
if (paginationNodes.length > 0) {
paginateSelector = '.' + $.trim(paginationNodes.first().attr("class")).replace(/\s\s+/g, ' ').replace(/ /gi, '.');
} else {
if ($('#pagination').length > 0) {
paginateSelector = '#pagination';
} else {
paginationNodes = $('*[id*="agination"]');
if (paginationNodes.length > 0) {
paginateSelector = '#' + paginationNodes.first().attr("id");
} else {
paginationNodes = $('*[class*="aginate"]');
if (paginationNodes.length > 0) {
paginateSelector = '.' + $.trim(paginationNodes.first().attr("class")).replace(/\s\s+/g, ' ').replace(/ /gi, '.');
} else {
paginationNodes = $('*[id*="aginate"]');
if (paginationNodes.length > 0) {
paginateSelector = '#' + paginationNodes.first().attr("id");
}
}
}
}
}
if (paginateSelector == '') {
var paginationNodes = $(collectionParent).parent().nextAll().find('*[class*="agination"]');
if (paginationNodes.length > 0) {
paginateSelector = '.' + $.trim(paginationNodes.first().attr("class")).replace(/\s\s+/g, ' ').replace(/ /gi, '.');
} else {
if ($('#pagination').length > 0) {
paginateSelector = '#pagination';
} else {
paginationNodes = $('*[id*="agination"]');
if (paginationNodes.length > 0) {
paginateSelector = '#' + paginationNodes.first().attr("id");
} else {
paginationNodes = $('*[class*="aginate"]');
if (paginationNodes.length > 0) {
paginateSelector = '.' + $.trim(paginationNodes.first().attr("class")).replace(/\s\s+/g, ' ').replace(/ /gi, '.');
} else {
paginationNodes = $('*[id*="aginate"]');
if (paginationNodes.length > 0) {
paginateSelector = '#' + paginationNodes.first().attr("id");
}
}
}
}
}
}
if (paginateSelector == '#modal-pagination-wrapper') {
paginateSelector = '';
}
if (paginateSelector == '') {
var paginationNodes = $('*[class*="agination"]');
if (paginationNodes.length > 0) {
paginateSelector = '.' + $.trim(paginationNodes.first().attr("class")).replace(/\s\s+/g, ' ').replace(/ /gi, '.');
} else {
if ($('#pagination').length > 0) {
paginateSelector = '#pagination';
} else {
paginationNodes = $('*[id*="agination"]');
if (paginationNodes.length > 0) {
paginateSelector = '#' + paginationNodes.first().attr("id");
} else {
paginationNodes = $('*[class*="aginate"]');
if (paginationNodes.length > 0) {
paginateSelector = '.' + $.trim(paginationNodes.first().attr("class")).replace(/\s\s+/g, ' ').replace(/ /gi, '.');
} else {
paginationNodes = $('*[id*="aginate"]');
if (paginationNodes.length > 0) {
paginateSelector = '#' + paginationNodes.first().attr("id");
}
}
}
}
}
}
}
if ($(".container-pushy-main").length > 0 && $("#category-sticky-parent").length > 0 && $(".pagination-buttons").length > 0) {
paginateSelector = '.pagination-buttons';
}
if (paginateSelector == '') {
if ($('#paging').length > 0) {
paginateSelector = '#paging';
}
}
if (($(".wide-container .jiggly-split").length > 0)) {
paginateSelector = ".pager-button, .pagination";
}
if (paginateSelector == '') {
if ($('.page_c').length > 0) {
paginateSelector = '.page_c';
collectionParent = collectionParent.replace('.animation-done', '');
$("body").append("");
}
}
if ($(".shopify-pagination").length > 0 && $(".pagination-gl_default").length > 0) {
paginateSelector = '.shopify-pagination';
$("body").append("");
}
if ($(".pull-right.pagination-btns").length > 0 && $(".product-listing").length > 0 && $(".filters-row__pagination").length > 0) {
$('