-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path656Proposals.html
209 lines (188 loc) · 7.61 KB
/
656Proposals.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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>656 Rollers</title>
<style>
/* Estilos para el logo */
#logo {
position: absolute;
top: 300px; /* Distancia desde la parte superior */
left: 10px; /* Distancia desde la parte izquierda */
width: 300px;
height: auto;
background: transparent;
}
/* Estilos generales */
body {
font-family: Arial, sans-serif;
background-color: white; /* Fondo blanco para la página */
color: black; /* Texto en negro */
margin: 0;
padding: 0;
}
/* Estilo para el mensaje explicativo */
#introMessage {
text-align: center;
font-size: 1.2em;
margin: 20px;
padding: 20px;
background: linear-gradient(to right, #1936d5, #1E90FF); border-radius: 8px;
color: white;
}
/* Estilos del formulario */
#propuestaForm {
display: block;
margin: 0 auto;
padding: 20px;
background-color: white; /* Fondo blanco para el formulario */
border-radius: 8px;
border: 1px solid #ddd;
width: 80%;
max-width: 500px;
}
label {
font-weight: bold;
}
input[type="text"], textarea {
width: 100%;
padding: 10px;
margin: 10px 0;
border: 1px solid #ccc;
border-radius: 4px;
}
button {
background-color: #1E90FF; /* Azul */
color: white;
padding: 10px 20px;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 16px;
}
button:hover {
background-color: #4682B4; /* Azul más oscuro al pasar el mouse */
}
/* Estilo para los mensajes de éxito y error */
#successMessage, #errorMessage {
display: none;
text-align: center;
margin-top: 20px;
}
#checkmark {
width: 50px;
height: 50px;
margin-top: 10px;
}
#anotherProposalButton, #retryButton {
margin-top: 20px;
background-color: #1E90FF; /* Azul */
color: white;
border: none;
padding: 10px 20px;
cursor: pointer;
font-size: 16px;
border-radius: 4px;
}
#anotherProposalButton:hover, #retryButton:hover {
background-color: #4682B4; /* Azul más oscuro al pasar el mouse */
}
</style>
</head>
<body>
<!-- Logo en la esquina superior izquierda -->
<img src="logo_656.png" alt="Logo" id="logo">
<!-- Mensaje explicativo -->
<div id="introMessage">
<p><strong>Si eres una persona tímida que prefiere no comentar u opinar en grupos grandes, este es tu espacio.</strong></p>
<p>Por este medio puedes informarnos sobre cualquier problema, sugerencia o propuesta que tengas. Puede ser de manera anónima, si así lo prefieres.</p>
<p>Cuéntanos tus propuestas para rutas, recorridos, actividades, horarios, temáticas, etcétera.</p>
<p><strong>¡No te quedes sin participar, juntos podemos mejorar y crecer esta comunidad!</strong></p>
</div>
<h1 style="text-align: center;">Envía tu propuesta</h1>
<form id="propuestaForm">
<label for="nombre">Nombre (opcional):</label>
<input type="text" id="nombre" name="nombre">
<br>
<label for="propuesta">Tu propuesta:</label>
<textarea id="propuesta" name="propuesta" rows="4" required></textarea>
<br>
<button type="submit">Enviar</button>
</form>
<!-- Mensaje de éxito -->
<div id="successMessage">
<img src="checkmark.png" alt="Checkmark" id="checkmark">
<p>Propuesta enviada exitosamente</p>
<button id="anotherProposalButton">Enviar otra propuesta</button>
</div>
<!-- Mensaje de error -->
<div id="errorMessage">
<p>Hubo un error al enviar la propuesta. Intenta de nuevo.</p>
<button id="retryButton">Reintentar</button>
</div>
<script>
document.getElementById('propuestaForm').addEventListener('submit', function(e) {
e.preventDefault();
var nombre = document.getElementById('nombre').value;
var propuesta = document.getElementById('propuesta').value;
// Validación básica de la propuesta
if (!propuesta.trim()) {
alert('Por favor, escribe una propuesta válida.');
return;
}
// Realizamos la solicitud al backend para enviar el correo
fetch('https://api.emailjs.com/api/v1.0/email/send', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
service_id: 'service_xcxd6mu',
template_id: 'template_tmk2b7p',
user_id: 'O2RwGslfhB17kpP_U',
template_params: {
nombre: nombre,
propuesta: propuesta
}
})
})
.then(response => {
if (response.ok) {
// Ocultar el formulario
document.getElementById('propuestaForm').style.display = 'none';
// Mostrar el mensaje de éxito
document.getElementById('successMessage').style.display = 'block';
document.getElementById('errorMessage').style.display = 'none';
} else {
throw new Error('Hubo un error al enviar la propuesta');
}
})
.catch(error => {
// Mostrar mensaje de error y ocultar formulario
document.getElementById('errorMessage').style.display = 'block';
document.getElementById('propuestaForm').style.display = 'none';
document.getElementById('successMessage').style.display = 'none';
});
});
// Botón para enviar otra propuesta
document.getElementById('anotherProposalButton').addEventListener('click', function() {
// Mostrar de nuevo el formulario y ocultar el mensaje de éxito
document.getElementById('propuestaForm').style.display = 'block';
document.getElementById('successMessage').style.display = 'none';
// Limpiar los campos del formulario
document.getElementById('nombre').value = '';
document.getElementById('propuesta').value = '';
});
// Botón para reintentar el envío de la propuesta
document.getElementById('retryButton').addEventListener('click', function() {
// Mostrar el formulario y ocultar el mensaje de error
document.getElementById('propuestaForm').style.display = 'block';
document.getElementById('errorMessage').style.display = 'none';
// Limpiar los campos del formulario para reintentar
document.getElementById('nombre').value = '';
document.getElementById('propuesta').value = '';
});
</script>
</body>
</html>