PageSourceSearch

https://pust.si/dmxAppConnect/dmxImageParallax/dmxImageParallax.js

js pust.si collected 2026-10-08 06:19:26 UTC 2,606 bytes, 8 lines download raw bytes

1/*!
2 App Connect Image Parallax
3 Version: 2.0.1
4 (c) 2024 Wappler.io
5 @build 2024-07-05 14:22:21
6 */
7dmx.imageParallax={running:!1,elements:new Set,lastPosition:-1,start:function(e){dmx.imageParallax.elements.add(e);var a=e.dmxImageParallax;a.container=e,a.overflow||(a.container=dmx.imageParallax.wrap(e),e.style.setProperty("transform",`scale(${a.scale})`)),a.delay>0&&e.style.setProperty("transition",`transform ${a.delay}s ${a.transition}`),e.style.setProperty("will-change","transform"),dmx.imageParallax.running||(dmx.imageParallax.running=!0,requestAnimationFrame(dmx.imageParallax.animate))},stop:function(e){dmx.imageParallax.elements.delete(e),0===dmx.imageParallax.elements.size&&(dmx.imageParallax.running=!1)},animate:function(){dmx.imageParallax.running&&(dmx.imageParallax.elements.forEach((function(e){dmx.imageParallax.updateElement(e)})),requestAnimationFrame(dmx.imageParallax.animate))},wrap:function(e){var a=document.createElement("div");return a.className=e.className,a.style.setProperty("display","inline-block"),a.style.setProperty("overflow","hidden"),e.parentNode.insertBefore(a,e),a.appendChild(e),a},updateElement:function(e){if(e.offsetParent){var a=e.dmxImageParallax,t=a.container.getBoundingClientRect();if(0!==t.width&&0!==t.height){var r=dmx.imageParallax.getScrollParent(e);if(r==window)var n={top:0,left:0,right:window.innerWidth,bottom:window.innerHeight,width:window.innerWidth,height:window.innerHeight};else n=r.getBoundingClientRect();if(!(t.bottom<n.top||t.top>n.bottom)){var i=(n.bottom-t.top)/(n.height+t.height),l=e.clientHeight*a.scale-e.clientHeight,o=~~(i*l-l/2),m=0,d=0;-1!=a.orientation.indexOf("left")&&(m=-o),-1!=a.orientation.indexOf("right")&&(m=o),-1!=a.orientation.indexOf("up")&&(d=-o),-1!=a.orientation.indexOf("down")&&(d=o);var s=`translate3d(${m}px, ${d}px, 0)`;a.overflow||(s+=` scale(${a.scale})`),e.style.getPropertyValue("transform")!=s&&e.style.setProperty("transform",s)}}}},isScrollParent:function(e){try{var a=window.getComputedStyle(e);return/(auto|scroll)/.test(a.overflow+a.overflowX+a.overflowY)}catch(e){return!1}},getScrollParent:function(e){return e?dmx.imageParallax.isScrollParent(e)?e:dmx.imageParallax.getScrollParent(e.parentNode):window}},dmx.Attribute("image-parallax","mounted",(function(e,a){return e.dmxImageParallax={scale:a.modifiers.scale?a.modifiers.scale/100:1.3,delay:a.modifiers.delay?a.modifiers.delay/1e3:.4,overflow:!!a.modifiers.overflow,transition:"cubic-bezier(0,0,0,1)",orientation:a.value||"up"},dmx.imageParallax.start(e),()=>{dmx.imageParallax.stop(e)}}));
8//# sourceMappingURL=dmxImageParallax.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.