-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨front-end updates and loading for contact form
- Loading branch information
1 parent
90a2cd7
commit 86c8942
Showing
8 changed files
with
327 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
document.addEventListener("DOMContentLoaded", function() { | ||
new VenoBox({ | ||
selector: ".open-modal", | ||
bgcolor: '#ffffff', | ||
overlayColor: 'rgba(255, 255, 255, 0.85)', | ||
maxWidth: '85%', | ||
toolsColor: '#d2d2d2', | ||
}); | ||
// hamburger mobile menu | ||
let menuToggle = document.querySelector('.menu-toggle'); | ||
let menu = document.querySelector('.menu'); | ||
|
||
menuToggle.addEventListener('click', () => { | ||
menu.classList.toggle('menu-open'); | ||
}) | ||
|
||
let menuClose = document.querySelector('.menu-close'); | ||
menuClose.addEventListener('click', () => { | ||
menu.classList.remove('menu-open'); | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,31 @@ | ||
(function() { | ||
// Inicialize o EmailJS com sua chave pública | ||
emailjs.init("l3aDxyNn-8gbF6W4Y"); | ||
|
||
document.getElementById('contactForm').addEventListener('submit', function(event) { | ||
const form = document.getElementById('contactForm'); | ||
const submitButton = document.getElementById('submitButton'); | ||
const thankYouMessage = document.getElementById('thankYouMessage'); | ||
|
||
form.addEventListener('submit', function(event) { | ||
event.preventDefault(); | ||
|
||
// Disable the submit button and show loading | ||
submitButton.disabled = true; | ||
submitButton.classList.add('loading'); | ||
|
||
emailjs.sendForm('service_8zgyk4l', 'template_kvshg7o', this) | ||
.then(function() { | ||
console.log('SUCCESS!'); | ||
alert('Mensagem enviada com sucesso!'); | ||
// Hide the form and show the thank you message | ||
form.style.display = 'none'; | ||
thankYouMessage.style.display = 'block'; | ||
}, function(error) { | ||
console.log('FAILED...', error); | ||
alert('Falha ao enviar a mensagem. Por favor, tente novamente.'); | ||
alert('Failed to send the message. Please try again.'); | ||
}) | ||
.finally(function() { | ||
// Re-enable the submit button and hide loading | ||
submitButton.disabled = false; | ||
submitButton.classList.remove('loading'); | ||
}); | ||
}); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
document.addEventListener("DOMContentLoaded", function() { | ||
new VenoBox({ | ||
selector: ".open-modal", | ||
bgcolor: '#ffffff', | ||
overlayColor: 'rgba(255, 255, 255, 0.85)', | ||
maxWidth: '85%', | ||
toolsColor: '#d2d2d2', | ||
}); | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.