{"version":3,"sources":["jsdelivr-header.js","/npm/smyld-lib-scroll-visible@1.0.0/main.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACeA,MAAM,QAAU,QAEhB,SAAS,eAAe,GACpB,QAAQ,IAAI,GACZ,EAAG,UAAU,IAAI,EAAG,aAJR,SAMhB,CAEA,SAAS,wBACL,QAAQ,IAAI,sCAIZ,IAAI,EAAM,SAAS,iBAAiB,8BACpC,QAAQ,IAAI,SAAW,EAAI,OAAS,kBAEpC,IAAI,EAAW,IAAI,sBAAqB,SAAS,GAC7C,EAAQ,SAAQ,IAAY,EAAI,gBAAgB,eAAe,EAAI,OAAO,GAC9E,GAAG,CAAE,UAAW,CAAC,KAEjB,EAAI,SAAS,GAAI,EAAS,QAAQ,IAEtC,CAEA,OAAO,OAAS,WAAW,uBAAwB","file":"/npm/smyld-lib-scroll-visible@1.0.0/main.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/smyld-lib-scroll-visible@1.0.0/main.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/**\r\n var observer = new IntersectionObserver(function(entries) {\r\n\t// isIntersecting is true when element and viewport are overlapping\r\n\t// isIntersecting is false when element and viewport don't overlap\r\n\tif(entries[0].isIntersecting === true)\r\n\t\tconsole.log('Element has just become visible in screen');\r\n}, { threshold: [0] });\r\n\r\nobserver.observe(document.querySelector(\"#main-container\"));\r\nIf we want to know when element becomes fully visible in screen :\r\n\r\nvar observer = new IntersectionObserver(function(entries) {\r\n\tif(entries[0].isIntersecting === true)\r\n\t\tconsole.log('Element is fully visible in screen');\r\n}, { threshold: [1] });\r\n\r\nobserver.observe(document.querySelector(\"#main-container\"));\r\n\r\n//document.querySelectorAll('div[shown][type=\"checkbox\"]:not([value=\"\"])');\r\n */\r\n\r\nconst showAtt = \"shown\";\r\n\r\nfunction doHandleElment(el){\r\n    console.log(el);\r\n    el.classList.add(el.getAttribute(showAtt));\r\n\r\n}\r\n\r\nfunction doInitVisibleElements(){\r\n    console.log(\"Is about checking for elements....\");\r\n    \r\n    \r\n\r\n    var els = document.querySelectorAll(`div[${showAtt}]:not([${showAtt}=\"\"])`);\r\n    console.log(\"Found \" + els.length + \" elements ....\");\r\n\r\n    var observer = new IntersectionObserver(function(entries) {\r\n        entries.forEach(ent => {if (ent.isIntersecting) doHandleElment(ent.target);});\r\n    }, { threshold: [0] });\r\n\r\n    els.forEach (e=> observer.observe(e));\r\n    \r\n}\r\n\r\nwindow.onload = function(){doInitVisibleElements();}"]}