wp-productzilla/wp-content/themes/blocksy/static/bundle/466.b14bc89d4788be9732dc.js
rizal.productzilla e38e8b231d templating
2024-04-01 16:08:46 +07:00

1 line
1.0 KiB
JavaScript

"use strict";(self.blocksyJsonP=self.blocksyJsonP||[]).push([[466],{2466:function(t,n,o){o.r(n),o.d(n,{mount:function(){return r}});o(1601);var e=o(3409),s=o(2248);let i="idle",l=null;const r=function(t){if(t.hasListener)return;t.hasListener=!0;const n=function(){var t=document.querySelector(".ct-back-to-top");t&&(window.scrollY>300?("loaded"===i&&t.classList.add("ct-show"),"idle"===i&&(i="loading",(0,s.Xr)(ct_localizations.dynamic_styles.back_to_top).then((function(){t.removeAttribute("hidden"),i="loaded",t.classList.add("ct-show")})))):t.classList.remove("ct-show"))},o=function(){null!==l&&window.scrollY===l||(l=window.scrollY,n()),requestAnimationFrame(o)};requestAnimationFrame(o),n(),t.addEventListener("click",(function(t){t.preventDefault();var n=window.scrollY,o=null;const s=function(t){o||(o=t);var e=t-o;var i,l,r,a=Math.max((i=e,l=n,r=-n,(i/=700/2)<1?r/2*i*i+l:-r/2*(--i*(i-2)-1)+l),0);scrollTo(0,a),e<700&&requestAnimationFrame(s)};e.areWeDealingWithSafari?requestAnimationFrame(s):scrollTo(0,0)}))}}}]);