{"version":3,"file":"index.entry.js","mappings":";;;;;AAAA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,oBAAoB,QAAQ;AAC5B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL","sources":["webpack://ArcsaCapitalRedesign2022/./src/js/index.js"],"sourcesContent":["const completedInvestments = document.querySelector('.completed-investments');\nconst millionsInvested = document.querySelector('.millions-invested');\nconst activeInvestments = document.querySelector('.active-investments');\n\nconst wantToInvestButton = document.getElementById('want-to-invest-button');\nconst suscribeFormHome = document.getElementById('form-suscribe-home');\nconst suscribeEmailHome = document.getElementById('suscribe-email-home');\n\nconst startCountValue = 0;\nconst completedInvestmentsValue = 1000;\nconst millionsInvestedValue = 50;\nconst activeInvestmentsValue = 20;\nconst counterAnimationDuration = 1500;\n\nvar countersAnimated = false;\nvar tabButtons = [];\nvar tabImages = [];\n\nwindow.addEventListener('load', () => {\n for (var i = 1; i <= 6; i++) {\n tabButtons.push(document.getElementById('tab-' + i));\n tabImages.push(document.getElementById('tab-img-' + i));\n }\n\n tabButtons.forEach((tabButton) => {\n tabButton.addEventListener('click', (e) => {\n let elementId = e.currentTarget.id;\n let img = document.getElementById('tab-img-' + elementId.charAt(elementId.length - 1));\n document.querySelectorAll('.tab-img').forEach((tabImage) => {\n tabImage.classList.replace('opacity-100', 'opacity-0');\n });\n img.classList.replace('opacity-0', 'opacity-100');\n });\n });\n\n setImagesContainerHeight();\n setTabPanelHeight();\n //animateText();\n\n wantToInvestButton.addEventListener('click', () => {\n sendinblue.track('click_quiero_invertir');\n });\n\n suscribeFormHome.addEventListener('submit', (event) => {\n if (!suscribeEmailHome.validity.valid) {\n event.preventDefault();\n } else {\n let properties = {\n 'email': suscribeEmailHome.value,\n 'RECIBE_NOTICIAS': true\n };\n sendinblue.identify(suscribeEmailHome.value, properties);\n\n properties = {\n 'email': suscribeEmailHome.value,\n 'form': 'home_form',\n 'RECIBE_NOTICIAS': true\n };\n sendinblue.track('suscripcion_newsletter', properties);\n }\n });\n});\n\nwindow.addEventListener('scroll', () => {\n if (window.scrollY > 200) {\n if (countersAnimated === false) {\n animateValue(completedInvestments, startCountValue, completedInvestmentsValue, counterAnimationDuration);\n animateValue(millionsInvested, startCountValue, millionsInvestedValue, counterAnimationDuration);\n animateValue(activeInvestments, startCountValue, activeInvestmentsValue, counterAnimationDuration);\n countersAnimated = true;\n }\n }\n});\n\nwindow.addEventListener('resize', function (event) {\n setImagesContainerHeight();\n setTabPanelHeight();\n});\n\nconst setImagesContainerHeight = () => {\n let height = document.querySelector('.tab-img').clientHeight;\n document.getElementById('tab-img-container').style.height = height + 'px';\n}\n\nconst setTabPanelHeight = () => {\n let height = 0;\n document.querySelectorAll('.tab-pane').forEach((pane) => {\n height = pane.clientHeight > height ? pane.clientHeight : height;\n });\n document.getElementById('numberTabsContent').style.height = height + 'px';\n}\n\nconst animateValue = (obj, start, end, duration) => {\n let startTimestamp = null;\n const step = (timestamp) => {\n if (!startTimestamp) startTimestamp = timestamp;\n const progress = Math.min((timestamp - startTimestamp) / duration, 1);\n obj.innerHTML = Math.floor(progress * (end - start) + start).toLocaleString('en-US');\n if (progress < 1) {\n window.requestAnimationFrame(step);\n }\n };\n window.requestAnimationFrame(step);\n}\n\nconst animateText = () => {\n let part;\n let i = 0;\n let offset = 0;\n let len = features.length;\n let forwards = true;\n let skip_count = 0;\n let skip_delay = 400;\n let speed = 10;\n\n intervalID = setInterval(function () {\n if (forwards) {\n if (offset >= features[i].length) {\n ++skip_count;\n if (skip_count == skip_delay) {\n forwards = false;\n skip_count = 0;\n }\n }\n }\n else {\n if (offset == 0) {\n forwards = true;\n i++;\n offset = 0;\n if (i >= len) {\n i = 0;\n }\n }\n }\n part = features[i].substr(0, offset);\n if (skip_count == 0) {\n if (forwards) {\n offset++;\n }\n else {\n offset--;\n }\n }\n document.querySelector('.features').textContent = part;\n }, speed);\n};\n"],"names":[],"sourceRoot":""}