{"mappings":"AAAA,MA4BMA,EAAW,IAAIC,sBA5BE,SAAUC,GAC/BA,EAAQC,SAASC,IACf,IAAIC,EAASD,EAAOC,OAChBC,EAAQC,SAASF,EAAOG,aAAa,gBAAkB,EACvDC,EAAWJ,EAAOG,aAAa,kBAAoB,KACnDE,EAAUL,EAAOG,aAAa,iBAC9BJ,EAAOO,kBAAoB,EAC7BC,YAAW,KACLH,IACFJ,EAAOQ,MAAMC,mBAAqB,GAAGL,MAAaA,KAEpDJ,EAAOU,UAAUC,IAAI,cAEL,OAAZN,GACFV,EAASiB,UAAUZ,EAAA,GAEpBC,GACkB,OAAZI,IACTL,EAAOU,UAAUG,OAAO,cACxBb,EAAOQ,MAAMM,eAAe,uBAC9B,GAEJ,IAYe,EAACC,EAAW,iBAEzB,MAAMC,EAAQC,SAASC,iBAAiBH,GAGpC,yBAA0BI,OAE5BH,EAAMlB,SAASsB,IACbzB,EAAS0B,QAAQD,EAAA,IAInBJ,EAAMlB,SAASsB,GAASA,EAAKV,UAAUC,IAAI,iBC7C/C","sources":["src/js/libs/animon.ts","src/js/index.ts"],"sourcesContent":["const animonCallback = function (changes) {\n changes.forEach((change) => {\n let target = change.target;\n let delay = parseInt(target.getAttribute(\"data-delay\")) || 0;\n let duration = target.getAttribute(\"data-duration\") || null;\n let runOnce = target.getAttribute(\"data-run-once\");\n if (change.intersectionRatio > 0) {\n setTimeout(() => {\n if (duration) {\n target.style.transitionDuration = `${duration}, ${duration}`;\n }\n target.classList.add(\"is-visible\");\n // unobserve target if has attribute 'data-run-once'\n if (runOnce !== null) {\n observer.unobserve(target);\n }\n }, delay);\n } else if (runOnce === null) {\n target.classList.remove(\"is-visible\");\n target.style.removeProperty(\"transition-duration\");\n }\n });\n};\n\n/**\n * Create a new IntersectionObserver object\n * @param { Function } animonCallback: function to be executed\n */\nconst observer = new IntersectionObserver(animonCallback);\n\n/**\n * Animon's initialisation\n * @param { String } selector: items that should be animated\n */\nconst animon = (selector = \".animonItem\") => {\n // Build our nodes list\n const nodes = document.querySelectorAll(selector);\n\n // If IntersectionObserver is supported\n if (\"IntersectionObserver\" in window) {\n // Observe each node\n nodes.forEach((node) => {\n observer.observe(node);\n });\n } else {\n // Else make every node visible\n nodes.forEach((node) => node.classList.add(\"is-visible\"));\n }\n};\n\nexport { animon };\n","import { animon } from \"./libs/animon\";\nanimon();\n"],"names":["$c67910698eab5caa$var$observer","IntersectionObserver","changes","forEach","change","target","delay","parseInt","getAttribute","duration","runOnce","intersectionRatio","setTimeout","style","transitionDuration","classList","add","unobserve","remove","removeProperty","selector","nodes","document","querySelectorAll","window","node","observe"],"version":3,"file":"index.36113532.js.map"}