{"version":3,"file":"blog.a4646ce72472006d8dc6.js","mappings":"wHAIA,SAASA,EAAeC,GACpB,IAAIC,EAAOC,SAASC,uBAAuB,wBAAwB,GAC/DC,EAAYC,SACZC,OAAOC,iBAAiBN,GAAMO,iBAAiB,mBAE/CC,EAASJ,SACTC,OAAOC,iBAAiBN,GAAMO,iBAAiB,iBAE/CE,EAAUC,KAAKC,MACdZ,EACIa,cAAc,uCACdC,wBAAwBC,OACzBN,IACCL,EAAYK,IAErBT,EAAKgB,MAAMC,WAAa,QAAUP,CACtC,CAEA,SAASQ,IACL,IAAIC,EAAWjB,SAASC,uBACpB,8BAEJ,IAAK,IAAIiB,EAAI,EAAGA,EAAID,EAASE,OAAQD,IACjCrB,EAAeoB,EAASC,GAEhC,CACAlB,SAASoB,iBAAiB,yBAAyB,KAC/CJ,IACAZ,OAAOiB,iBAAiBC,QAAQ,IAGpCtB,SAASoB,iBAAiB,cAAc,KACpCJ,GAAoB,IAIxBZ,OAAOgB,iBAAiB,UAAU,IAAAG,UAASP,EAAoB,K","sources":["webpack://ziber.eu/./app/page-blog.js"],"sourcesContent":["import \"./css/blog.scss\";\r\nimport {debounce} from \"lodash\";\r\n\r\n// this is our masonry layout\r\nfunction resizeGridItem(item) {\r\n let grid = document.getElementsByClassName(\"of-news-article-grid\")[0];\r\n let rowHeight = parseInt(\r\n window.getComputedStyle(grid).getPropertyValue(\"grid-auto-rows\")\r\n );\r\n let rowGap = parseInt(\r\n window.getComputedStyle(grid).getPropertyValue(\"grid-row-gap\")\r\n );\r\n let rowSpan = Math.ceil(\r\n (item\r\n .querySelector(\".of-news-article-grid__item-content\")\r\n .getBoundingClientRect().height +\r\n rowGap) /\r\n (rowHeight + rowGap)\r\n );\r\n item.style.gridRowEnd = \"span \" + rowSpan;\r\n}\r\n\r\nfunction resizeAllGridItems() {\r\n let allItems = document.getElementsByClassName(\r\n \"of-news-article-grid__item\"\r\n );\r\n for (let x = 0; x < allItems.length; x++) {\r\n resizeGridItem(allItems[x]);\r\n }\r\n}\r\ndocument.addEventListener(\"blog:articles-changed\", () => {\r\n resizeAllGridItems();\r\n window.lazyLoadInstance.update();\r\n});\r\n\r\ndocument.addEventListener(\"turbo:load\", () => {\r\n resizeAllGridItems();\r\n});\r\n\r\n// debounce the resize event\r\nwindow.addEventListener(\"resize\", debounce(resizeAllGridItems, 250));\r\n"],"names":["resizeGridItem","item","grid","document","getElementsByClassName","rowHeight","parseInt","window","getComputedStyle","getPropertyValue","rowGap","rowSpan","Math","ceil","querySelector","getBoundingClientRect","height","style","gridRowEnd","resizeAllGridItems","allItems","x","length","addEventListener","lazyLoadInstance","update","debounce"],"sourceRoot":""}