{"version":3,"file":"byggstensida.min.js","sources":["byggstensida.js"],"sourcesContent":["'use strict';\r\n\r\n(function () {\r\n hanteraResize();\r\n\r\n if ('IntersectionObserver' in window && af.isTouchDevice()) {\r\n\r\n uppdateraByggstenarVidScroll();\r\n\r\n function uppdateraByggstenarVidScroll() {\r\n const sections = document.querySelectorAll('.byggsten-container');\r\n\r\n const byggstenObserver = new IntersectionObserver((entries, observer) => {\r\n entries.forEach(entry => {\r\n if (entry.isIntersecting) {\r\n entry.target.classList.add('active');\r\n }\r\n })\r\n }, {\r\n rootMargin: '-20% 0% -60% 0%'\r\n });\r\n\r\n sections.forEach(section => {\r\n byggstenObserver.observe(section);\r\n });\r\n }\r\n }\r\n\r\n function hanteraResize() {\r\n window.addEventListener('resize', resizeFunctions);\r\n }\r\n\r\n function resizeFunctions() {\r\n const sections = document.querySelectorAll('.byggsten-container');\r\n sections.forEach(section => {\r\n section.classList.remove('active');\r\n })\r\n }\r\n\r\n})();\r\n"],"names":["window","addEventListener","resizeFunctions","af","isTouchDevice","uppdateraByggstenarVidScroll","sections","document","querySelectorAll","byggstenObserver","IntersectionObserver","entries","observer","forEach","entry","isIntersecting","target","classList","add","rootMargin","section","observe","remove"],"mappings":"AAAA,aAEA,CAAA,WAGI,GAwBIA,OAAOC,iBAAiB,SAAUC,CAAe,EAxBjD,yBAA0BF,QAAUG,GAAGC,cAAc,EAErDC,CAGI,MAAMC,EAAWC,SAASC,iBAAiB,qBAAqB,EAE1DC,EAAmB,IAAIC,qBAAqB,CAACC,EAASC,KACxDD,EAAQE,QAAQC,IACRA,EAAMC,gBACND,EAAME,OAAOC,UAAUC,IAAI,QAAQ,CAE3C,CAAC,CACL,EAAG,CACCC,WAAY,iBAChB,CAAC,EAEDb,EAASO,QAAQO,IACbX,EAAiBY,QAAQD,CAAO,CACpC,CAAC,CAjBwB,CAyBjC,SAASlB,IACYK,SAASC,iBAAiB,qBAAqB,EACvDK,QAAQO,IACbA,EAAQH,UAAUK,OAAO,QAAQ,CACrC,CAAC,CACL,CAEH,EAAE"}