Diff: STRATO-apps/wordpress_03/app/wp-content/themes/blocksy/static/bundle/173.f4af2fd1765e0b4f180f.js
Keine Baseline-Datei – Diff nur gegen leer.
1
-
1
+
"use strict";(globalThis.blocksyJsonP=globalThis.blocksyJsonP||[]).push([[173],{1173:function(e,t,n){n.r(t),n.d(t,{mount:function(){return g},rel:function(){return p}});var i=n(4705),r=n(3793),o=n(5687),s=n.n(o);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach(function(t){(0,i.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const c=function(e,t){return t*(100*(1-e))},u=function(e){let{el:t=null,speed:n=null,fitInsideContainer:i=null,isVisible:r=!1,shouldSetHeightToIncrease:o=!0,parallaxBehavior:a="desktop:tablet:mobile"}=e;if(n=n<=-5?-5:n>=5?5:n,i&&o){let e=0;e=n>0?c(.5,n):c(s()()/(i.clientHeight+s()()),n)-c(.5,n),e=2*Math.abs(e),r?t.parentNode.style.height=`calc(100% + ${e}px)`:t.parentNode.removeAttribute("style")}let{top:l,height:u}=h(i||t);return{parallaxBehavior:a,shouldSetHeightToIncrease:o,fitInsideContainer:i,el:t,top:pageYOffset+l,height:u,speed:n,isVisible:r}};function d(e){var t=e.getBoundingClientRect();return t.bottom>-450&&t.top-450<(s()()||document.documentElement.clientHeight)}function h(e){if(!e)return null;let{top:t,left:n,right:i,width:r,height:o}=e.getBoundingClientRect(),s=window.getComputedStyle(e).transform.split(/\(|,|\)/).slice(1,-1).map(function(e){return parseFloat(e)});if(6!=s.length)return e.getBoundingClientRect();var a=s;let l=a[0]*a[3]-a[1]*a[2];return{width:r/a[0],height:o/a[3],left:(n*a[3]-t*a[2]+a[2]*a[5]-a[4]*a[3])/l,right:(i*a[3]-t*a[2]+a[2]*a[5]-a[4]*a[3])/l,top:(-n*a[1]+t*a[0]+a[4]*a[1]-a[0]*a[5])/l}}n(6555);function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}let p=new class{constructor(){var e=this;this.blocks=[],this.oldPosY=!1,this.intersectionObserver=new IntersectionObserver(function(t){t.map(function(t){let{target:n,isIntersecting:i,intersectionRatio:o}=t,s=(e.blocks.filter(function(e){let{fitInsideContainer:t,el:i}=e;return i.closest("svg")?i.closest("svg")===n:t===n||i===n}),!1);e.blocks=e.blocks.map(function(e){return(e.el.closest("svg")?e.el.closest("svg")===n:e.fitInsideContainer===n||e.el===n)?(s=!0,u(l(l({},e),{},{isVisible:i&&e.parallaxBehavior.indexOf((0,r.U)({withTablet:!0}))>-1}))):e}),s&&(e.oldPosY=!1,e.animate())})},{rootMargin:"450px"}),this.update(),this.animate()}removeEl(e){let{el:t}=e;t.removeAttribute("style"),this.blocks=this.blocks.filter(function(e){let{el:n}=e;return n!==t})}addEl(e){let{el:t,speed:n,fitInsideContainer:i=null,shouldSetHeightToIncrease:o=!0,parallaxBehavior:s="desktop:tablet:mobile"}=e;i?this.intersectionObserver.observe(i):this.intersectionObserver.observe(t.closest("svg")?t.closest("svg"):t),this.blocks.push(u({el:t,speed:n,fitInsideContainer:i,isVisible:d(i||t)&&s.indexOf((0,r.U)({withTablet:!0}))>-1,shouldSetHeightToIncrease:o,parallaxBehavior:s}))}update(){this.oldPosY||0===this.oldPosY||this.animate(),this.setPosition()&&this.animate(),requestAnimationFrame(this.update.bind(this))}setPosition(){if(0===this.blocks.length)return!1;let e=this.oldPosY;return this.oldPosY=pageYOffset,e!=pageYOffset}animate(){this.blocks.map(function(e){if(!e.isVisible)return void e.el.removeAttribute("style");var t=(pageYOffset-e.top+s()())/(e.height+s()());let{top:n,height:i}=h(e.fitInsideContainer?e.fitInsideContainer:e.el);i||(i=(e.fitInsideContainer?e.fitInsideContainer:e.el).getBoundingClientRect().height);const r=1-(n+(e.el.dataset.percentage&&0===parseInt(e.el.dataset.percentage,10)?0:i/2))/s()();var o=c(e.fitInsideContainer?t:r,e.speed)-c(e.el.dataset.percentage?parseInt(e.el.dataset.percentage,10):.5,e.speed);e.el.style.transform=`translate3d(0, ${o}px, 0)`})}};const g=function(e){e.ctHasParallax&&e.querySelector("figure .ct-media-container > img")||(!e.matches("[data-parallax]")||e.dataset.parallax?(e.ctHasParallax=!0,e.querySelector("figure .ct-media-container > img")?setTimeout(function(){p.addEl(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach(function(t){(0,i.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({el:e.querySelector("figure .ct-media-container > img"),speed:-5,fitInsideContainer:e},e.dataset.parallax?{parallaxBehavior:e.dataset.parallax}:{}))},0):p.addEl({el:e,speed:+e.dataset.parallax,shouldSetHeightToIncrease:!1})):e.removeAttribute("data-parallax"))}},5687:function(e){e.exports=function(){if("undefined"==typeof window||"undefined"==typeof navigator)return function(){return 0};if(!navigator.userAgent.match(/iphone|ipod|ipad/i)&&!function(){const e=window.navigator.userAgent;if(e.indexOf("iPad")>-1)return!0;if(e.indexOf("Macintosh")>-1)try{return document.createEvent("TouchEvent"),!0}catch(e){}return!1}())return function(){return window.innerHeight};var e,t=Math.abs(window.orientation),n={w:0,h:0};return(e=document.createElement("div")).style.position="fixed",e.style.height="100vh",e.style.width=0,e.style.top=0,document.documentElement.appendChild(e),n.w=90===t?e.offsetHeight:window.innerWidth,n.h=90===t?window.innerWidth:e.offsetHeight,document.documentElement.removeChild(e),e=null,function(){return 90!==Math.abs(window.orientation)?n.h:n.w}}()}}]);