{"version":3,"file":"crossfade_banner-CtY0f1V7.js","sources":["../../../app/javascript/entrypoints/crossfade_banner.js"],"sourcesContent":["\n// Pass backend variables to js variables\n/**\n * VARIABLES AND FUNCTIONS THAT NEED INITIATION\n */\nvar windowSize = window.innerWidth\nsetBackgrounds();\n\n/**\n * EVENT LISTENERS\n */\n\n// Execute something on 575 breakpoint (mobile to desktop and vice versa)\nwindow.addEventListener('resize', function(event) {\n setBackgrounds();\n windowSize = window.innerWidth;\n}, true);\n\n/**\n * FUNCTIONS\n */\n\n// Get Sections Data and check if it has a background image\nfunction setBackgrounds() {\n let images = document.querySelectorAll(`img[class^=\"auto-resize\"]`);\n\n images.forEach(image => {\n let imageSrc = image && image.src ? image.src : null;\n if (imageSrc) {\n let urlWithSize = window.innerWidth <= 768 ? imageSrc.replace('?size=desktop', '?size=mobile') : imageSrc.replace('?size=mobile', '?size=desktop');\n image.src = urlWithSize;\n }\n\n });\n}"],"names":["setBackgrounds","event","image","imageSrc","urlWithSize"],"mappings":"AAMAA,IAOA,OAAO,iBAAiB,SAAU,SAASC,EAAO,CAC9CD,GAEJ,EAAG,EAAI,EAOP,SAASA,GAAiB,CACT,SAAS,iBAAiB,2BAA2B,EAE3D,QAAQE,GAAS,CACpB,IAAIC,EAAWD,GAASA,EAAM,IAAMA,EAAM,IAAM,KAChD,GAAIC,EAAU,CACV,IAAIC,EAAc,OAAO,YAAc,IAAMD,EAAS,QAAQ,gBAAiB,cAAc,EAAIA,EAAS,QAAQ,eAAgB,eAAe,EACjJD,EAAM,IAAME,CACf,CAET,CAAK,CACL"}