-
Notifications
You must be signed in to change notification settings - Fork 1
/
suscribete2021.html
107 lines (91 loc) · 4.35 KB
/
suscribete2021.html
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<title>Rainbowlad border</title>
<link href="https://fonts.googleapis.com/css?family=IBM+Plex+Sans|Fredoka+One&display=swap" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.cssx">
<link rel='stylesheet' href='https://taniarascia.github.io/primitive/css/main.cssx'>
<link rel="stylesheet" href="css/suscribete2021style.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" charset="utf-8"></script>
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600&display=swap" rel="stylesheet">
</head>
<body>
<!-- partial:index.partial.html -->
<div class="c-subscribe-box u-align-center">
<div class="rainbow"><span></span><span></span></div>
<div class="c-subscribe-box__wrapper">
<h3 class="c-subscribe-box__title">Suscribete al newsletter</h3>
<p class="c-subscribe-box__desc">Actualizaciones via whatsapp <i class="fa fa-whatsapp" aria-hidden="true"></i></p>
<form id="formulario" class="formulario">
<input class="u-align-center" type="text" placeholder="55 1234 5678" />
<button name="nombre" id="nombre" type="submit" class="botonw"><i class="fab fa-whatsapp"></i> Enviar WhatsApp</button>
</form>
<form id="formulario" class="formulario">
<h1>Vestidor</h1>
<div class="box-input">
<input name="nombre" id="nombre" type="text" required>
<span data-placeholder="Escriba su Nombre"></span>
</div>
<div class="box-input">
<input name="apellidos" id="apellidos" type="text" required>
<span data-placeholder="Escriba sus Apellidos"></span>
</div>
<div class="box-input">
<input name="email" id="email" type="email" required>
<span data-placeholder="Escriba su Correo Electrónico"></span>
</div>
<button id="submit" type="submit" class="botonw"><i class="fab fa-whatsapp"></i> Enviar WhatsApp</button>
</form>
</div>
</div>
<!-- partial -->
<script type="text/javascript">
$(".box-input input").on("focus", function() {
$(this).addClass("focus");
});
$(".box-input input").on("blur", function() {
if ($(this).val() == "") {
$(this).removeClass("focus");
}
});
</script>
<script src="https://kit.fontawesome.com/a076d05399.js"></script>
<script ">
function isMobile() {
if (sessionStorage.desktop)
return false;
else if (localStorage.mobile)
return true;
var mobile = ['iphone', 'ipad', 'android', 'blackberry', 'nokia', 'opera mini', 'windows mobile', 'windows phone', 'iemobile'];
for (var i in mobile)
if (navigator.userAgent.toLowerCase().indexOf(mobile[i].toLowerCase()) > 0) return true;
return false;
}
const formulario = document.querySelector('#formulario');
const buttonSubmit = document.querySelector('#submit');
const urlDesktop = 'https://web.whatsapp.com/';
const urlMobile = 'whatsapp://';
const telefono = '525539793727';
formulario.addEventListener('submit', (event) => {
event.preventDefault()
buttonSubmit.innerHTML = '<i class="fas fa-circle-notch fa-spin "></i>'
buttonSubmit.disabled = true
setTimeout(() => {
let nombre = document.querySelector('#nombre').value
let apellidos = document.querySelector('#apellidos').value
let email = document.querySelector('#email').value
let mensaje = 'send?phone=' + telefono + '&text=*_Suscribir_*%0A**%0A' + nombre + '%0A**%0A' + apellidos + '%0A**%0A' + email + ''
if(isMobile()) {
window.open(urlMobile + mensaje, '_blank')
}else{
window.open(urlDesktop + mensaje, '_blank')
}
buttonSubmit.innerHTML = '<i class="fab fa-whatsapp "></i> Enviar WhatsApp'
buttonSubmit.disabled = false
}, 3000);
});
</script>
</body>
</html>