{"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","Attribute","attr","value","modifiers","parseInt","argument","observe","random","Math","data","$index","preventDefault","pos","top","offsetTop","left","offsetLeft","width","offsetWidth","height","offsetHeight","requestAnimationFrame","offsetParent","appendChild","console","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,qBACApB,EAAAc,MAAAM,eAAA,wBACApB,EA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AH,EAAAc,MAAAM,eAAA,YAAA,GACA,IAEA,EAGAyE,EAAA3E,iBAAA,SAAA4E,GACAD,EAAA3E,iBAAA,UAAA8E,GAEAzC,KAAArC,iBAAA,WAAAP,IACAkF,EAAAhF,oBAAA,SAAAiF,GACAD,EAAAhF,oBAAA,UAAAmF,EAAA,GAEA","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('--animation-delay');\r\n node.style.removeProperty('--animation-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 });\r\n }\r\n\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 });\r\n }\r\n\r\n this.$node.style.setProperty('visibility', 'hidden');\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","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 this.addEventListener('destroy', event => {\r\n repeater.removeEventListener('update', updateHandler);\r\n repeater.removeEventListener('updated', updatedHandler);\r\n })\r\n});"]}