{"version":3,"sources":["core/animate.js","components/animate.js","attributes/animateInview.js","attributes/animateOutview.js","attributes/animateEnter.js","attributes/animateLeave.js","attributes/animateMove.js"],"names":["dmx","animate","node","effect","duration","delay","cancelAnimate","clear","Promise","resolve","reject","className","complete","event","stopPropagation","removeEventListener","style","setProperty","classList","add","addEventListener","once","removeProperty","remove","effects","map","observer","IntersectionObserver","entries","forEach","entry","inview","outview","target","ratio","intersectionRatio","animateVisible","animating","then","catch","threshold","Component","initialData","visible","attributes","showeffect","type","String","default","hideeffect","showduration","Number","hideduration","showdelay","hidedelay","Boolean","methods","this","props","$node","init","performUpdate","updatedProps","has","set","console","log","Attribute","attr","value","modifiers","parseInt","argument","observe","unobserve","random","Math","data","$index","preventDefault","pos","top","offsetTop","left","offsetLeft","width","offsetWidth","height","offsetHeight","requestAnimationFrame","offsetParent","appendChild","warn","parent","key","easing","find","repeater","updateHandler","getBoundingClientRect","updatedHandler"],"mappings":";;;;;;AAAAA,IAAAC,QAAA,SAAAC,EAAAC,EAAAC,EAAAC,GAKA,OAJAH,EAAAI,eAAAJ,EAAAI,gBAEAN,IAAAC,QAAAM,MAAAL,GAEA,IAAAM,SAAA,CAAAC,EAAAC,KACA,MAAAC,EAAA,YAAAR,IACAS,EAAAC,IACAX,EAAAI,cAAA,KACAO,EAAAC,kBACAd,IAAAC,QAAAM,MAAAL,GACAO,GAAA,EAGAP,EAAAI,cAAA,KACAJ,EAAAa,oBAAA,eAAAH,GACAZ,IAAAC,QAAAM,MAAAL,GACAQ,GAAA,EAGAL,GAAAH,EAAAc,MAAAC,YAAA,kBAAAZ,EAAA,MACAD,GAAAF,EAAAc,MAAAC,YAAA,qBAAAb,EAAA,MAEAF,EAAAgB,UAAAC,IAAA,oBAAAR,GAEAT,EAAAkB,iBAAA,eAAAR,EAAA,CAAAS,MAAA,GAAA,GAEA,EAEArB,IAAAC,QAAAM,MAAA,SAAAL,GACAA,EAAAc,MAAAM,eAAA,mBACApB,EAAAc,MAAAM,eAAA,s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A,KACAvF,EAAAc,MAAAC,YAAA,aAAA,aAAAb,GAAA,SAAA2F,GAAA,UAAA1F,GAAAsE,EAAA,GAAAC,KAAAD,SAAAlB,KAAAoB,KAAAC,QAAAzE,EAAA,OACAH,EAAAc,MAAAM,eAAA,YAAA,GACA,IAEA,EAMA,OAHA2E,EAAA7E,iBAAA,SAAA8E,GACAD,EAAA7E,iBAAA,UAAAgF,GAEA,KACAH,EAAAlF,oBAAA,SAAAmF,GACAD,EAAAlF,oBAAA,UAAAqF,EAAA,CAEA","file":"dmxAnimateCSS.js","sourcesContent":["dmx.animate = function (node, effect, duration, delay) {\r\n if (node.cancelAnimate) node.cancelAnimate();\r\n\r\n dmx.animate.clear(node);\r\n\r\n return new Promise((resolve, reject) => {\r\n const className = `animate__${effect}`;\r\n const complete = (event) => {\r\n node.cancelAnimate = null;\r\n event.stopPropagation();\r\n dmx.animate.clear(node);\r\n resolve();\r\n }\r\n\r\n node.cancelAnimate = () => {\r\n node.removeEventListener('animationend', complete);\r\n dmx.animate.clear(node);\r\n reject();\r\n };\r\n \r\n if (delay) node.style.setProperty('--animate-delay', delay + 'ms');\r\n if (duration) node.style.setProperty('--animate-duration', duration + 'ms');\r\n\r\n node.classList.add('animate__animated', className);\r\n\r\n node.addEventListener('animationend', complete, { once: true });\r\n });\r\n};\r\n\r\ndmx.animate.clear = function (node) {\r\n node.style.removeProperty('--animate-delay');\r\n node.style.removeProperty('--animate-duration');\r\n node.classList.remove('animate__animated', ...dmx.animate.effects.map(effect => 'animate__' + effect));\r\n};\r\n\r\ndmx.animate.effects = [\r\n // Attension seekers\r\n 'bounce', 'flash', 'pulse', 'rubberBand', 'shakeX', 'shakeY', 'headShake', 'swing', 'tada', 'wobble', 'jello', 'heartBeat',\r\n // Back entrances\r\n 'backInDown', 'backInLeft', 'backInRight', 'backInUp',\r\n // Back exits\r\n 'backOutDown', 'backOutLeft', 'backOutRight', 'backOutUp',\r\n // Bouncing entrances\r\n 'bounceIn', 'bounceInDown', 'bounceInLeft', 'bounceInRight', 'bounceInUp',\r\n // Bouncing exits\r\n 'bounceOut', 'bounceOutDown', 'bounceOutLeft', 'bounceOutRight', 'bounceOutUp',\r\n // Fading entrances\r\n 'fadeIn', 'fadeInDown', 'fadeInDownBig', 'fadeInLeft', 'fadeInLeftBig', 'fadeInRight', 'fadeInRightBig',\r\n 'fadeInUp', 'fadeInUpBig', 'fadeInTopLeft', 'fadeInTopRight', 'fadeInBottomLeft', 'fadeInBottomRight',\r\n // Fading exits\r\n 'fadeOut', 'fadeOutDown', 'fadeOutDownBig', 'fadeOutLeft', 'fadeOutLeftBig', 'fadeOutRight', 'fadeOutRightBig',\r\n 'fadeOutUp', 'fadeOutUpBig', 'fadeOutTopLeft', 'fadeOutTopRight', 'fadeOutBottomLeft', 'fadeOutBottomRight',\r\n // Flippers\r\n 'flip', 'flipInX', 'flipInY', 'flipOutX', 'flipOutY',\r\n // Lightspeed\r\n 'lightSpeedInRight', 'lightSpeedInLeft', 'lightSpeedOutRight', 'lightSpeedOutLeft',\r\n // Rotating entrances\r\n 'rotateIn', 'rotateInDownLeft', 'rotateInDownRight', 'rotateInUpLeft', 'rotateInUpRight',\r\n // Rotating exits\r\n 'rotateOut', 'rotateOutDownLeft', 'rotateOutDownRight', 'rotateOutUpLeft', 'rotateOutUpRight',\r\n // Specials\r\n 'hinge', 'jackInTheBox', 'rollIn', 'rollOut',\r\n // Zooming entrances\r\n 'zoomIn', 'zoomInDown', 'zoomInLeft', 'zoomInRight', 'zoomInUp',\r\n // Zooming exits\r\n 'zoomOut', 'zoomOutDown', 'zoomOutLeft', 'zoomOutRight', 'zoomOutUp',\r\n // Sliding entrances\r\n 'slideInDown', 'slideInLeft', 'slideInRight', 'slideInUp',\r\n // Sliding exits\r\n 'slideOutDown', 'slideOutLeft', 'slideOutRight', 'slideOutUp'\r\n];\r\n\r\ndmx.animate.observer = new IntersectionObserver(entries => {\r\n entries.forEach(entry => {\r\n const { inview, outview } = entry.target;\r\n\r\n entry.target.ratio = entry.intersectionRatio;\r\n\r\n //if (!entry.isIntersecting) return;\r\n\r\n if (!entry.target.animateVisible) {\r\n entry.target.style.setProperty('visibility', 'hidden');\r\n }\r\n\r\n if (entry.intersectionRatio >= inview.ratio) {\r\n if (!entry.target.animateVisible) {\r\n entry.target.animating = true;\r\n entry.target.animateVisible = true;\r\n entry.target.style.removeProperty('visibility');\r\n\r\n dmx.animate(entry.target, inview.effect, inview.duration, inview.delay).then(() => {\r\n entry.target.animating = false;\r\n entry.target.style.removeProperty('visibility');\r\n }).catch(() => {});\r\n }\r\n } else {\r\n if (outview && entry.target.animateVisible) {\r\n entry.target.animating = true;\r\n entry.target.animateVisible = false;\r\n \r\n dmx.animate(entry.target, outview.effect, outview.duration, outview.delay).then(() => {\r\n entry.target.animating = false;\r\n entry.target.style.setProperty('visibility', 'hidden');\r\n }).catch(() => {});\r\n }\r\n }\r\n });\r\n}, {\r\n threshold: [0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1]\r\n});\r\n","dmx.Component('animate', {\r\n\r\n initialData: {\r\n animating: false,\r\n visible: false,\r\n },\r\n\r\n attributes: {\r\n showeffect: {\r\n type: String,\r\n default: null,\r\n },\r\n\r\n hideeffect: {\r\n type: String,\r\n default: null,\r\n },\r\n\r\n showduration: {\r\n type: Number,\r\n default: null,\r\n },\r\n\r\n hideduration: {\r\n type: Number,\r\n default: null,\r\n },\r\n\r\n showdelay: {\r\n type: Number,\r\n default: 0,\r\n },\r\n\r\n hidedelay: {\r\n type: Number,\r\n default: 0,\r\n },\r\n\r\n visible: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n },\r\n\r\n methods: {\r\n animate (effect, duration) {\r\n if (this.props.visible) {\r\n dmx.animate(this.$node, effect, duration);\r\n }\r\n },\r\n },\r\n\r\n init (node) {\r\n if (!this.props.visible) {\r\n node.style.setProperty('visibility', 'hidden');\r\n }\r\n },\r\n\r\n performUpdate (updatedProps) {\r\n if (updatedProps.has('visible')) {\r\n if (this.props.visible) {\r\n if (this.props.showeffect) {\r\n this.set('animating', true);\r\n\r\n dmx.animate(this.$node, this.props.showeffect, this.props.showduration, this.props.showdelay).then(() => {\r\n this.set('animating', false);\r\n }).catch(() => {});\r\n }\r\n\r\n console.log('remove visibility');\r\n this.$node.style.removeProperty('visibility');\r\n } else {\r\n if (this.props.hideeffect) {\r\n this.set('animating', true);\r\n\r\n dmx.animate(this.$node, this.props.hideeffect, this.props.hideduration, this.props.hidedelay).then(() => {\r\n this.set('animating', false);\r\n console.log('add visibility');\r\n this.$node.style.setProperty('visibility', 'hidden');\r\n }).catch(() => {});\r\n }\r\n }\r\n\r\n this.set('visible', this.props.visible);\r\n }\r\n },\r\n\r\n});\r\n","dmx.Attribute('animate-inview', 'mounted', function (node, attr) {\r\n node.inview = {\r\n effect: attr.value,\r\n delay: attr.modifiers.delay,\r\n duration: attr.modifiers.duration,\r\n ratio: (parseInt(attr.argument, 10) || 100) / 100,\r\n };\r\n\r\n node.style.setProperty('visibility', 'hidden');\r\n\r\n dmx.animate.observer.observe(node);\r\n\r\n return () => {\r\n dmx.animate.observer.unobserve(node);\r\n };\r\n});\r\n","dmx.Attribute('animate-outview', 'mounted', function (node, attr) {\r\n node.outview = {\r\n effect: attr.value,\r\n delay: attr.modifiers.delay,\r\n duration: attr.modifiers.duration,\r\n ratio: (parseInt(attr.argument, 10) || 100) / 100,\r\n };\r\n});","dmx.Attribute('animate-enter', 'mounted', function (node, attr) {\r\n const { value, modifiers } = attr;\r\n const { delay, duration, random } = modifiers;\r\n dmx.animate(node, value, duration, (random ? Math.random() * 10 : this.data.$index) * delay);\r\n});","dmx.Attribute('animate-leave', 'mounted', function (node, attr) {\r\n const { value, modifiers } = attr;\r\n const { delay, duration, random } = modifiers;\r\n\r\n // repeaters trigger a remove event on nodes that get removed\r\n node.addEventListener('remove', event => {\r\n event.preventDefault();\r\n\r\n const pos = {\r\n top: node.offsetTop,\r\n left: node.offsetLeft,\r\n width: node.offsetWidth,\r\n height: node.offsetHeight,\r\n };\r\n\r\n requestAnimationFrame(() => {\r\n node.style.setProperty('position', 'absolute');\r\n node.style.setProperty('top', pos.top);\r\n node.style.setProperty('left', pos.left);\r\n node.style.setProperty('width', pos.width);\r\n node.style.setProperty('height', pos.height);\r\n node.offsetParent.appendChild(node);\r\n \r\n dmx.animate(node, value, duration, (random ? Math.random() * 10 : this.data.$index) * delay);\r\n });\r\n });\r\n});","dmx.Attribute('animate-move', 'mounted', function (node, attr) {\r\n if (this.type !== 'repeat-item') {\r\n console.warn('Attribute animate-move is only allowed on repeat items');\r\n return;\r\n }\r\n\r\n if (!this.parent.props.key) {\r\n console.warn('Attribute animate-move can only be used on keyed repeaters');\r\n return;\r\n }\r\n\r\n const { delay, duration, random } = attr.modifiers;\r\n const easing = ['linear', 'ease-in', 'ease-out', 'ease-in-out'].find(easing => !!attr.modifiers[easing]);\r\n const repeater = this.parent;\r\n const updateHandler = event => {\r\n node.pos = node.getBoundingClientRect();\r\n };\r\n const updatedHandler = event => {\r\n if (node.pos) {\r\n node.style.removeProperty('transform');\r\n node.style.removeProperty('transition');\r\n\r\n requestAnimationFrame(() => {\r\n const { left, top } = node.getBoundingClientRect();\r\n\r\n node.style.setProperty('transform', `translate(${node.pos.left - left}px, ${node.pos.top - top}px)`);\r\n\r\n requestAnimationFrame(() => {\r\n node.style.setProperty('transition', `transform ${duration || 800}ms ${easing || 'ease'} ${delay ? ((random ? Math.random() * 10 : this.data.$index) * delay) : 0}ms`);\r\n node.style.removeProperty('transform');\r\n });\r\n });\r\n }\r\n };\r\n\r\n repeater.addEventListener('update', updateHandler);\r\n repeater.addEventListener('updated', updatedHandler);\r\n\r\n return () => {\r\n repeater.removeEventListener('update', updateHandler);\r\n repeater.removeEventListener('updated', updatedHandler);\r\n };\r\n});"]}