{ "version": 3, "sources": ["../../../Vettvangur.Frontend/src/scripts/components/hero.ts"], "sourcesContent": ["const Hero = {\r\n el: {\r\n hero: document.querySelector('.hero'),\r\n },\r\n\r\n init() {\r\n // checking if hero exists\r\n if (this.el.hero) {\r\n const nextElementSibling = this.el.hero.nextElementSibling as HTMLElement\r\n const isInvestorStatsBlock = nextElementSibling.classList.contains('investor-stats-block')\r\n const heroSvg = document.querySelector('.hero__svg')\r\n const heroVideoComponent = document.querySelector('.hero__video-container')\r\n\r\n //only run this if the first block after hero is investor stats block\r\n if (isInvestorStatsBlock && heroSvg != null) {\r\n //run this on load\r\n this.renderMargin(nextElementSibling, heroSvg)\r\n }\r\n\r\n //only run this if hero video component exists\r\n if (heroVideoComponent) {\r\n this.setHeroVideoSpacing(heroVideoComponent)\r\n }\r\n\r\n //run again on resize\r\n window.addEventListener('resize', () => {\r\n if (isInvestorStatsBlock && heroSvg != null) {\r\n this.renderMargin(nextElementSibling, heroSvg)\r\n }\r\n\r\n if (heroVideoComponent) {\r\n this.setHeroVideoSpacing(heroVideoComponent)\r\n }\r\n })\r\n }\r\n },\r\n\r\n renderMargin(nextElementSibling: HTMLElement, heroSvg: HTMLElement) {\r\n if (window.innerWidth < 992) {\r\n nextElementSibling.style.marginTop = `${heroSvg.clientHeight / 4 + 60}px`\r\n } else {\r\n nextElementSibling.style.marginTop = '0px'\r\n }\r\n },\r\n\r\n setHeroVideoSpacing(heroVideoComponent: HTMLElement) {\r\n if (window.innerWidth < 992) {\r\n this.el.hero.style.paddingBottom = `${(heroVideoComponent.clientHeight / 2) + 40}px`\r\n this.el.hero.style.marginBottom = `${(heroVideoComponent.clientHeight / 2) + 60}px`\r\n } else {\r\n this.el.hero.style.paddingBottom = '90px'\r\n this.el.hero.style.marginBottom = '160px'\r\n }\r\n }\r\n}\r\n\r\nexport default Hero\r\n"], "mappings": "gCAAA,IAAMA,EAAO,CACX,GAAI,CACF,KAAM,SAAS,cAA2B,OAAO,CACnD,EAEA,MAAO,CAEL,GAAI,KAAK,GAAG,KAAM,CAChB,IAAMC,EAAqB,KAAK,GAAG,KAAK,mBAClCC,EAAuBD,EAAmB,UAAU,SAAS,sBAAsB,EACnFE,EAAU,SAAS,cAA2B,YAAY,EAC1DC,EAAqB,SAAS,cAA2B,wBAAwB,EAGnFF,GAAwBC,GAAW,MAErC,KAAK,aAAaF,EAAoBE,CAAO,EAI3CC,GACF,KAAK,oBAAoBA,CAAkB,EAI7C,OAAO,iBAAiB,SAAU,IAAM,CAClCF,GAAwBC,GAAW,MACrC,KAAK,aAAaF,EAAoBE,CAAO,EAG3CC,GACF,KAAK,oBAAoBA,CAAkB,CAE/C,CAAC,CACH,CACF,EAEA,aAAaH,EAAiCE,EAAsB,CAC9D,OAAO,WAAa,IACtBF,EAAmB,MAAM,UAAY,GAAGE,EAAQ,aAAe,EAAI,EAAE,KAErEF,EAAmB,MAAM,UAAY,KAEzC,EAEA,oBAAoBG,EAAiC,CAC/C,OAAO,WAAa,KACtB,KAAK,GAAG,KAAK,MAAM,cAAgB,GAAIA,EAAmB,aAAe,EAAK,EAAE,KAChF,KAAK,GAAG,KAAK,MAAM,aAAe,GAAIA,EAAmB,aAAe,EAAK,EAAE,OAE/E,KAAK,GAAG,KAAK,MAAM,cAAgB,OACnC,KAAK,GAAG,KAAK,MAAM,aAAe,QAEtC,CACF,EAEOC,EAAQL", "names": ["Hero", "nextElementSibling", "isInvestorStatsBlock", "heroSvg", "heroVideoComponent", "hero_default"] }