', }); feed.run(); } whenAvailable('$',function(t){ if($('.homepage-your-oc__content-block-1').length) { $(function () { const contentBlock = $('.homepage-your-oc__content-block-1'); const viewportHeight = $(window).innerHeight(); const yourOcHeight = $('.homepage-your-oc').innerHeight(); const yourOcTop = $('.homepage-your-oc').position().top; $(document).scroll(function () { const currentScroll = $(document).scrollTop(); const currentContentTop = contentBlock.position().top; let distance = (currentScroll + viewportHeight) - currentContentTop; let offset = (distance - viewportHeight * 0.8); let opacity = (distance - viewportHeight * 0.8); $('.homepage-your-oc__content-block-2').get(0).style .setProperty('--left-offset', (offset < 0 ? offset : 0) + 'px'); $('.homepage-your-oc__content-block-2').get(0).style .setProperty('--left-opacity', (opacity < 1 ? (1 + opacity / 1000) : 1)); }); }); } if($(".homepage__selection-section").length) { $(".homepage__selection-section").scroll(function() { if($(this).scrollTop() + $(this).innerHeight() >= $(this)[0].scrollHeight) { $(".homepage-selection__product img").show(); } else { $(".homepage-selection__product img").hide(); } }); } if($(".homepage__section-title").length) { $(window).scroll(function() { var top_of_title = $(".homepage__section-title").offset().top; var bottom_of_title = $(".homepage__section-title").offset().top + $(".homepage__section-title").outerHeight(); var bottom_of_screen = $(window).scrollTop() + $(window).innerHeight(); var top_of_screen = $(window).scrollTop(); }); } if($("#instafeed").length) { $(function () { instaCarousel(); }); } });