-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
26 lines (21 loc) · 1.01 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Envío de recibo a contacto
const formv = document.querySelector('.email-form')
const form = document.querySelector('.btn-email');
const namem = document.querySelector('.name-form');
form.addEventListener('click', addSpinnerAndEmail);
function addSpinnerAndEmail() {
form.classList.add('disabled');
form.innerHTML += `<span class="spinner-border spinner-border-sm ms-2" role="status" aria-hidden="true"></span>`;
emailjs.send('service_gmail', 'template_portfolio', { to_email: formv.value, to_name: namem.value, userID: 'user_6Z3mCm9NiTNUQqYhMfV8E' })
.then(function (response) {
console.log('SUCCESS!', response.status, response.text);
}, function (error) {
console.log('FAILED...', error);
});
}
function offline() {
document.getElementById('offline').innerHTML += `<div class="alert alert-danger"><i class="bi bi-exclamation-circle"></i> Usted se encuentra sin conexión, por favor, conéctese a Internet.</div>`;
}
function online() {
document.getElementById('offline').innerHTML = ``;
}