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K;AACH;AACD;AAEF,GAXD;;AAaA;AACA;;AAGA;AACA,SAAO;AACL;AADK,GAAP;AAGD,CAjJD;;kBAmJe,e;;AAGf;;AACO,IAAM,kCAAa,SAAb,UAAa;AAAA,SAAS;AAAA,WAAe;AAAA,aAClD,OAAO,KAAP,GAAe,MAAM,GAAN,CAAf,GAA4B,WADsB;AAAA,KAAf;AAAA,GAAT;AAAA,CAAnB;;;;;ACpKP;;;;;;AAEA;AACA,IAAM,uBAAuB,+BAAgB;AAC3C,YAAU;AADiC,CAAhB,CAA7B;;AAIA;AACA,IAAM,uBAAuB,+BAAgB;AAC3C,YAAU,+BADiC;AAE3C,gBAAc,yBAF6B;AAG3C,iBAAe,OAH4B;AAI3C,eAAa,IAJ8B;AAK3C,kBAAgB;AAL2B,CAAhB,CAA7B;;AAQA;AACA,IAAM,2BAA2B,+BAAgB;AAC/C,YAAU,oCADqC;AAE/C,iBAAe;AAFgC,CAAhB,CAAjC;;AAKA;AACA,IAAM,wBAAwB,+BAAgB;AAC5C,YAAU,gCADkC;AAE5C,iBAAe;AAF6B,CAAhB,CAA9B;;AAKA;AACA,IAAM,sBAAsB,+BAAgB;AAC1C,YAAU,8BADgC;AAE1C,iBAAe;AAF2B,CAAhB,CAA5B;;AAKA;AACA,IAAM,0BAA0B,+BAAgB;AAC9C,YAAU;AADoC,CAAhB,CAAhC","file":"bundle.js","sourcesContent":["(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o h ? (h / w) : 1));\n let y = (e.pageY - position.y - (h / 2) * (h > w ? (w / h) : 1));\n\n // Calculate the angle the pointer entered/exited and convert to clockwise format (top/right/bottom/left = 0/1/2/3). See https://stackoverflow.com/a/3647634 for a full explanation.\n let d = Math.round(Math.atan2(y, x) / 1.57079633 + 5) % 4;\n\n // console.table([x, y, w, h, e.pageX, e.pageY, item.offsetLeft, item.offsetTop, position.x, position.y]);\n\n return d;\n };\n\n\n // https://www.kirupa.com/html5/get_element_position_using_javascript.htm\n const getPosition = function (el) {\n let xPos = 0;\n let yPos = 0;\n\n while (el) {\n xPos += (el.offsetLeft + el.clientLeft);\n yPos += (el.offsetTop + el.clientTop);\n\n el = el.offsetParent;\n }\n return {\n x: xPos,\n y: yPos\n };\n }\n\n\n const translateDirection = switchcase({\n 0: 'top',\n 1: 'right',\n 2: 'bottom',\n 3: 'left'\n })('top');\n\n\n const addClass = function (e, state) {\n let currentItem = e.currentTarget;\n let direction = getDirection(e, currentItem);\n let directionString = translateDirection(direction);\n\n // Remove current animation classes and add new ones e.g. swap --in for --out.\n let currentCssClasses = currentItem.className.split(' ');\n let filteredCssClasses = currentCssClasses.filter((cssClass) => (!cssClass.startsWith(animationName))).join(' ');\n currentItem.className = filteredCssClasses;\n currentItem.classList.add(`${animationName}--${state}-${directionString}`);\n };\n\n\n const bindEvents = function (containerItem) {\n const items = containerItem.querySelectorAll(itemSelector);\n\n items.forEach((item) => {\n\n addEventListenerMulti(item, ['mouseenter', 'focus'], (e) => {\n addClass(e, 'in');\n });\n\n addEventListenerMulti(item, ['mouseleave', 'blur'], (e) => {\n addClass(e, 'out');\n });\n\n\n if (enableTouch) {\n\n item.addEventListener('touchstart', (e) => {\n touchStart = +new Date;\n }, { passive: true });\n\n item.addEventListener('touchend', (e) => {\n let touchTime = +new Date - touchStart;\n\n if (touchTime < touchThreshold && !item.className.includes(`${animationName}--in`)) {\n e.preventDefault();\n\n resetVisible(e, items, addClass(e, 'in'));\n }\n });\n\n }\n\n });\n };\n\n const addEventListenerMulti = function (element, events, fn) {\n events.forEach((e) => element.addEventListener(e, fn));\n }\n\n\n const resetVisible = function (e, items, callback) {\n\n items.forEach((item) => {\n let currentCssClasses = item.className;\n\n if(currentCssClasses.includes(`${animationName}--in`) && item !== e.currentTarget) {\n item.className = currentCssClasses.replace(`${animationName}--in`, `${animationName}--out`);\n }\n });\n\n callback;\n };\n\n\n const init = function () {\n\n if (containers.length) {\n containers.forEach((containerItem) => {\n bindEvents(containerItem);\n });\n }\n else {\n return;\n }\n\n };\n\n // Init is called by default\n init();\n\n\n // Reveal API\n return {\n init\n };\n};\n\nexport default DirectionReveal;\n\n\n// Better switch cases - https://hackernoon.com/rethinking-javascript-eliminate-the-switch-statement-for-better-code-5c81c044716d\nexport const switchcase = cases => defaultCase => key =>\nkey in cases ? cases[key] : defaultCase;\n","import DirectionReveal from './direction-reveal.js';\n\n// Swing animation(Default)\nconst directionRevealSwing = DirectionReveal({\n selector: '.direction-reveal--demo-swing'\n});\n\n// Slide animation with all options specified\nconst directionRevealSlide = DirectionReveal({\n selector: '.direction-reveal--demo-slide',\n itemSelector: '.direction-reveal__card',\n animationName: 'slide',\n enableTouch: true,\n touchThreshold: 250\n});\n\n// Slide & push\nconst directionRevealSlidePush = DirectionReveal({\n selector: '.direction-reveal--demo-slide-push',\n animationName: 'slide'\n});\n\n// Rotate animation\nconst directionRevealRotate = DirectionReveal({\n selector: '.direction-reveal--demo-rotate',\n animationName: 'rotate'\n});\n\n// Flip animation\nconst directionRevealFlip = DirectionReveal({\n selector: '.direction-reveal--demo-flip',\n animationName: 'flip'\n});\n\n// Bootstrap demo\nconst directionRevealBoostrap = DirectionReveal({\n selector: '.direction-reveal--demo-bootstrap'\n});\n"],"preExistingComment":"//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJzY3JpcHRzL2RpcmVjdGlvbi1yZXZlYWwuanMiLCJzY3JpcHRzL21haW4uanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ik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