Repository URL to install this package:
|
Version:
1.8.76 ▾
|
jsarnowski/blocksy-companion-pro
/
premium
/
extensions
/
woocommerce-extra
/
static
/
bundle
/
floating-cart.js
|
|---|
!function(){"use strict";var t=window.ctFrontend;(0,t.registerDynamicChunk)("blocksy_ext_woo_extra_floating_cart",{mount:function(e,a){var o=a.state;"target-after-bottom"===o&&(e.classList.add("ct-active-start"),requestAnimationFrame((function(){e.classList.remove("ct-active-start"),e.classList.add("ct-active-end"),setTimeout((function(){e.classList.remove("ct-active-end"),e.classList.add("ct-active")}),200)}))),"target-after-bottom"!==o&&(e.classList.add("ct-active-start"),requestAnimationFrame((function(){e.classList.remove("ct-active")})));var r=e.querySelector(".button:not(.single_add_to_cart_button):not(.product_type_external)");r&&(r.hasClickListener||(r.hasClickListener=!0,r.addEventListener("click",(function(e){e.preventDefault();var a=window.scrollY,o=null,r=function e(r){o||(o=r);var i=r-o;if(document.querySelector(".single-product .single_add_to_cart_button").closest("form")){var n,c,s,l=document.querySelector(".single-product .single_add_to_cart_button").closest("form").getBoundingClientRect(),u=window.scrollY+l.top-(parseFloat(getComputedStyle(document.body).getPropertyValue("--header-sticky-height"))||0),d=Math.max((n=i,c=a,s=-a,(n/=350)<1?s/2*n*n+c:-s/2*(--n*(n-2)-1)+c),u);t.areWeDealingWithSafari?(scrollTo(0,d),i<700&&requestAnimationFrame(e)):scrollTo(0,u)}};t.areWeDealingWithSafari?requestAnimationFrame(r):r(0)}))))}})}();