From 124c1a2cdebdd3a91aab0204ff47b08bb9f18418 Mon Sep 17 00:00:00 2001 From: Dinkar Date: Thu, 14 Nov 2024 21:48:41 +0530 Subject: [PATCH] bugFix for form submit firecrackers --- index.html | 2 +- scripts/dynamicallyLoadChunks.js | 3 --- scripts/emailjs.js | 15 +++++++++------ styles/style.css | 4 ++++ 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/index.html b/index.html index 03f035b..dbb7476 100644 --- a/index.html +++ b/index.html @@ -760,7 +760,7 @@

Contact Me

-
diff --git a/scripts/dynamicallyLoadChunks.js b/scripts/dynamicallyLoadChunks.js index d319bec..76171b6 100644 --- a/scripts/dynamicallyLoadChunks.js +++ b/scripts/dynamicallyLoadChunks.js @@ -71,7 +71,4 @@ intersectionObserver('#project', () => { intersectionObserver('#contact', () => { loadJs('scripts/emailjs.js'); - - const footerCanvas = document.querySelector('canvas#fireworksFooter'); - createFooterFirework = getFirework(footerCanvas); }); diff --git a/scripts/emailjs.js b/scripts/emailjs.js index c59b841..a7c0366 100644 --- a/scripts/emailjs.js +++ b/scripts/emailjs.js @@ -30,19 +30,22 @@ submitButton.disabled = true; const emailCallback = (success = true) => { + let createFooterFirework = () => {}; + if (getFirework) { + const footerFireworkCanvas = document.querySelector('canvas#fireworksFooter'); + createFooterFirework = getFirework(footerFireworkCanvas); + } if (success) { - emailCallback(true); - document.querySelector('section#home').addEventListener('click', () => { - setTimeout(createHomeFirework, 0); - setTimeout(createHomeFirework, 100); - setTimeout(createHomeFirework, 200); - }); + setTimeout(createFooterFirework, 0); + setTimeout(createFooterFirework, 100); + setTimeout(createFooterFirework, 200); } form.classList.remove('loading'); buttonTextElement.innerText = success ? 'Sent ✅' : 'Failed ❌'; setTimeout(() => { buttonTextElement.innerText = 'Send Me'; submitButton.disabled = false; + form.reset(); }, 2000); }; diff --git a/styles/style.css b/styles/style.css index 1816509..2f5bead 100644 --- a/styles/style.css +++ b/styles/style.css @@ -105,6 +105,10 @@ section .text-content { box-shadow: 0px 8px 20px rgba(0, 0, 0, 0.4); } } +.styled-btn.submit-btn:hover { + transform: none; + cursor: pointer; +} .color-black, a.color-black { text-decoration: none; color: var(--primary-bg-color);