goodemagod commited on
Commit
597123b
·
verified ·
1 Parent(s): e49e0e9

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +438 -19
index.html CHANGED
@@ -1,19 +1,438 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="es">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Encuentra Tu Vino Ideal</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
9
+ <style>
10
+ .fade-in {
11
+ animation: fadeIn 0.5s ease-in-out;
12
+ }
13
+ @keyframes fadeIn {
14
+ from { opacity: 0; transform: translateY(10px); }
15
+ to { opacity: 1; transform: translateY(0); }
16
+ }
17
+ .gradient-bg {
18
+ background: linear-gradient(135deg, #4b6cb7 0%, #182848 100%);
19
+ }
20
+ .wine-card {
21
+ transition: all 0.3s ease;
22
+ }
23
+ .wine-card:hover {
24
+ transform: translateY(-5px);
25
+ box-shadow: 0 10px 20px rgba(0,0,0,0.2);
26
+ }
27
+ .progress-bar {
28
+ transition: width 0.5s ease;
29
+ }
30
+ </style>
31
+ </head>
32
+ <body class="min-h-screen gradient-bg text-white font-sans">
33
+ <div class="container mx-auto px-4 py-12 max-w-4xl">
34
+ <header class="text-center mb-12 fade-in">
35
+ <h1 class="text-4xl md:text-5xl font-bold mb-4">Encuentra Tu Vino Ideal</h1>
36
+ <p class="text-xl opacity-90">Responda nuestras preguntas y descubra el vino perfecto para usted</p>
37
+ </header>
38
+
39
+ <div id="app" class="bg-white bg-opacity-10 backdrop-blur-sm rounded-xl shadow-xl overflow-hidden fade-in">
40
+ <!-- Progress Bar -->
41
+ <div class="h-2 bg-white bg-opacity-20">
42
+ <div id="progressBar" class="h-full bg-yellow-400 progress-bar" style="width: 0%"></div>
43
+ </div>
44
+
45
+ <!-- Question Container -->
46
+ <div id="questionContainer" class="p-8">
47
+ <!-- Initial Screen -->
48
+ <div id="welcomeScreen" class="text-center">
49
+ <div class="mb-8">
50
+ <i class="fas fa-wine-glass-alt text-6xl text-yellow-400 mb-4"></i>
51
+ <h2 class="text-3xl font-bold mb-4">Bienvenido al Sommelier Digital</h2>
52
+ <p class="text-lg mb-6">Vamos a hacerle algunas preguntas para encontrar el vino perfecto que combine con su personalidad, signo zodiacal y estado de ánimo.</p>
53
+ </div>
54
+ <button onclick="startQuestionnaire()" class="bg-yellow-500 hover:bg-yellow-600 text-gray-900 font-bold py-3 px-8 rounded-full text-lg transition-all transform hover:scale-105">
55
+ Comenzar <i class="fas fa-chevron-right ml-2"></i>
56
+ </button>
57
+ </div>
58
+
59
+ <!-- Questions will be inserted here dynamically -->
60
+ </div>
61
+ </div>
62
+ </div>
63
+
64
+ <script>
65
+ // Data
66
+ const zodiacData = {
67
+ aries: {
68
+ dates: "Mar 21 - Apr 19",
69
+ traits: "Energético, apasionado, valiente",
70
+ foods: ["Carnes rojas", "Especias fuertes", "Ajo", "Cebolla", "Quesos fuertes"],
71
+ winePairings: ["Malbec", "Syrah", "Zinfandel"]
72
+ },
73
+ tauro: {
74
+ dates: "Apr 20 - May 20",
75
+ traits: "Sensual, terrenal, persistente",
76
+ foods: ["Quesos cremosos", "Trufas", "Chocolate", "Carnes de caza", "Raíces"],
77
+ winePairings: ["Merlot", "Rioja", "Châteauneuf-du-Pape"]
78
+ },
79
+ geminis: {
80
+ dates: "May 21 - Jun 20",
81
+ traits: "Versátil, comunicativo, curioso",
82
+ foods: ["Ensaladas variadas", "Frutas tropicales", "Mariscos ligeros", "Comida étnica"],
83
+ winePairings: ["Sauvignon Blanc", "Pinot Grigio", "Rosado"]
84
+ },
85
+ cancer: {
86
+ dates: "Jun 21 - Jul 22",
87
+ traits: "Emocional, intuitivo, protector",
88
+ foods: ["Comida casera", "Sopas", "Mariscos", "Productos lácteos"],
89
+ winePairings: ["Chardonnay", "Viognier", "Pinot Noir"]
90
+ },
91
+ leo: {
92
+ dates: "Jul 23 - Aug 22",
93
+ traits: "Dramático, generoso, orgulloso",
94
+ foods: ["Platos ostentosos", "Carnes premium", "Comida gourmet", "Frutas exóticas"],
95
+ winePairings: ["Cabernet Sauvignon", "Barolo", "Champagne"]
96
+ },
97
+ virgo: {
98
+ dates: "Aug 23 - Sep 22",
99
+ traits: "Detallista, práctico, perfeccionista",
100
+ foods: ["Comida orgánica", "Vegetales", "Granos enteros", "Platos balanceados"],
101
+ winePairings: ["Riesling", "Gewürztraminer", "Sancerre"]
102
+ },
103
+ libra: {
104
+ dates: "Sep 23 - Oct 22",
105
+ traits: "Armonioso, social, equilibrado",
106
+ foods: ["Comida estéticamente presentada", "Postres", "Platos equilibrados"],
107
+ winePairings: ["Prosecco", "Pinot Noir", "Champagne rosado"]
108
+ },
109
+ escorpio: {
110
+ dates: "Oct 23 - Nov 21",
111
+ traits: "Intenso, misterioso, apasionado",
112
+ foods: ["Comida picante", "Mariscos oscuros", "Quesos azules", "Chocolate amargo"],
113
+ winePairings: ["Shiraz", "Carménère", "Amarone"]
114
+ },
115
+ sagitario: {
116
+ dates: "Nov 22 - Dec 21",
117
+ traits: "Aventurero, optimista, filosófico",
118
+ foods: ["Comida internacional", "Platos exóticos", "Carnes a la parrilla"],
119
+ winePairings: ["Tempranillo", "Carmenere", "Chianti"]
120
+ },
121
+ capricornio: {
122
+ dates: "Dec 22 - Jan 19",
123
+ traits: "Disciplinado, tradicional, ambicioso",
124
+ foods: ["Carnes maduradas", "Platos clásicos", "Raíces", "Quesos añejados"],
125
+ winePairings: ["Brunello di Montalcino", "Bordeaux", "Rioja Reserva"]
126
+ },
127
+ acuario: {
128
+ dates: "Jan 20 - Feb 18",
129
+ traits: "Innovador, excéntrico, humanitario",
130
+ foods: ["Comida futurista", "Fusiones", "Platos veganos innovadores"],
131
+ winePairings: ["Garnacha", "Verdejo", "Vinos naturales"]
132
+ },
133
+ piscis: {
134
+ dates: "Feb 19 - Mar 20",
135
+ traits: "Sensible, artístico, espiritual",
136
+ foods: ["Pescados", "Algas", "Comida con presentación artística"],
137
+ winePairings: ["Moscato", "Pinot Noir", "Vinos biodinámicos"]
138
+ }
139
+ };
140
+
141
+ const nameFoodData = {
142
+ a: ["Aguacate", "Alcachofa", "Almendras"],
143
+ b: ["Berenjena", "Brócoli", "Bayas"],
144
+ c: ["Cítricos", "Coliflor", "Cangrejo"],
145
+ d: ["Dátiles", "Durazno", "Dorada"],
146
+ e: ["Espárragos", "Espinacas", "Endibias"],
147
+ f: ["Fresas", "Frambuesas", "Frijoles"],
148
+ g: ["Granada", "Garbanzos", "Gambas"],
149
+ h: ["Higos", "Huevos", "Hongos"],
150
+ i: ["Ínguere", "Iceberg (lechuga)", "Iberico (jamón)"],
151
+ j: ["Jengibre", "Judías", "Jamon"],
152
+ k: ["Kiwi", "Kale", "Kumquat"],
153
+ l: ["Limón", "Lentejas", "Langosta"],
154
+ m: ["Manzana", "Maíz", "Merluza"],
155
+ n: ["Naranja", "Nueces", "Navajas"],
156
+ o: ["Oliva", "Ostras", "Okra"],
157
+ p: ["Piña", "Pimiento", "Pulpo"],
158
+ q: ["Queso", "Quinoa", "Quimbombó"],
159
+ r: ["Remolacha", "Rúcula", "Rape"],
160
+ s: ["Sandía", "Salmon", "Semillas"],
161
+ t: ["Tomate", "Tofu", "Trucha"],
162
+ u: ["Uva", "Udon", "Umeboshi"],
163
+ v: ["Vainilla", "Vieiras", "Verduras"],
164
+ w: ["Wasabi", "Wakame", "Wonton"],
165
+ x: ["Xoconostle", "Xiaolongbao", "Xoi"],
166
+ y: ["Yogur", "Yuca", "Yakitori"],
167
+ z: ["Zanahoria", "Zapallo", "Zarzamora"]
168
+ };
169
+
170
+ const moodData = {
171
+ feliz: ["Champagne", "Prosecco", "Moscato"],
172
+ relajado: ["Pinot Noir", "Chardonnay", "Viognier"],
173
+ estresado: ["Merlot", "Rioja", "Beaujolais"],
174
+ romantico: ["Champagne rosado", "Pinot Noir", "Malbec"],
175
+ nostalgico: ["Vinos añejos", "Sherry", "Madeira"],
176
+ energico: ["Sauvignon Blanc", "Albariño", "Garnacha"],
177
+ creativo: ["Vinos naturales", "Vinos naranjas", "Vinos biodinámicos"]
178
+ };
179
+
180
+ const locationData = {
181
+ playa: ["Vinos blancos frescos", "Rosados", "Albariño"],
182
+ montana: ["Vinos tintos robustos", "Syrah", "Cabernet Sauvignon"],
183
+ ciudad: ["Vinos elegantes", "Champagne", "Pinot Noir"],
184
+ campo: ["Vinos orgánicos", "Vinos locales", "Vinos artesanales"],
185
+ extranjero: ["Vinos de la región", "Vinos internacionales", "Vinos de importación"]
186
+ };
187
+
188
+ // State
189
+ let currentQuestion = 0;
190
+ const answers = {};
191
+ const questions = [
192
+ {
193
+ question: "¿Cuál es su fecha de nacimiento?",
194
+ type: "date",
195
+ key: "birthdate"
196
+ },
197
+ {
198
+ question: "¿Cuál es su nombre?",
199
+ type: "text",
200
+ key: "name"
201
+ },
202
+ {
203
+ question: "¿En qué contexto se encuentra actualmente?",
204
+ type: "select",
205
+ options: ["En la playa", "En la montaña", "En la ciudad", "En el campo", "En el extranjero"],
206
+ key: "location"
207
+ },
208
+ {
209
+ question: "¿Cómo se siente hoy?",
210
+ type: "select",
211
+ options: ["Feliz", "Relajado", "Estresado", "Romántico", "Nostálgico", "Energético", "Creativo"],
212
+ key: "mood"
213
+ },
214
+ {
215
+ question: "¿Qué tipo de experiencia busca con el vino?",
216
+ type: "select",
217
+ options: ["Algo familiar y confortable", "Una aventura nueva", "Un equilibrio entre ambos"],
218
+ key: "preference"
219
+ }
220
+ ];
221
+
222
+ // Functions
223
+ function startQuestionnaire() {
224
+ currentQuestion = 0;
225
+ document.getElementById('welcomeScreen').style.display = 'none';
226
+ showQuestion(currentQuestion);
227
+ }
228
+
229
+ function showQuestion(index) {
230
+ const question = questions[index];
231
+ const container = document.getElementById('questionContainer');
232
+
233
+ // Update progress bar
234
+ const progress = ((index + 1) / questions.length) * 100;
235
+ document.getElementById('progressBar').style.width = `${progress}%`;
236
+
237
+ let html = `
238
+ <div class="fade-in">
239
+ <h2 class="text-2xl font-bold mb-6">${question.question}</h2>
240
+ <div class="mb-8">
241
+ `;
242
+
243
+ if (question.type === "date") {
244
+ html += `
245
+ <input type="date" id="answerInput" class="w-full px-4 py-3 rounded-lg bg-white bg-opacity-20 border border-white border-opacity-30 text-white focus:outline-none focus:ring-2 focus:ring-yellow-400">
246
+ `;
247
+ } else if (question.type === "text") {
248
+ html += `
249
+ <input type="text" id="answerInput" class="w-full px-4 py-3 rounded-lg bg-white bg-opacity-20 border border-white border-opacity-30 text-white focus:outline-none focus:ring-2 focus:ring-yellow-400" placeholder="Escriba su nombre">
250
+ `;
251
+ } else if (question.type === "select") {
252
+ question.options.forEach(option => {
253
+ html += `
254
+ <button onclick="selectOption('${option}')" class="w-full mb-3 px-6 py-3 rounded-lg bg-white bg-opacity-10 hover:bg-opacity-20 border border-white border-opacity-20 text-left transition-all">
255
+ ${option}
256
+ </button>
257
+ `;
258
+ });
259
+ }
260
+
261
+ html += `
262
+ </div>
263
+ <div class="flex justify-between">
264
+ `;
265
+
266
+ if (index > 0) {
267
+ html += `
268
+ <button onclick="previousQuestion()" class="bg-white bg-opacity-10 hover:bg-opacity-20 text-white font-bold py-2 px-6 rounded-lg">
269
+ <i class="fas fa-chevron-left mr-2"></i> Anterior
270
+ </button>
271
+ `;
272
+ } else {
273
+ html += `<div></div>`;
274
+ }
275
+
276
+ if (question.type === "select") {
277
+ html += `<div></div>`; // Placeholder for center
278
+ } else {
279
+ html += `
280
+ <button onclick="nextQuestion()" class="bg-yellow-500 hover:bg-yellow-600 text-gray-900 font-bold py-2 px-6 rounded-lg">
281
+ Siguiente <i class="fas fa-chevron-right ml-2"></i>
282
+ </button>
283
+ `;
284
+ }
285
+
286
+ html += `
287
+ </div>
288
+ </div>
289
+ `;
290
+
291
+ container.innerHTML = html;
292
+ }
293
+
294
+ function selectOption(option) {
295
+ const question = questions[currentQuestion];
296
+ answers[question.key] = option;
297
+ nextQuestion();
298
+ }
299
+
300
+ function previousQuestion() {
301
+ currentQuestion--;
302
+ showQuestion(currentQuestion);
303
+ }
304
+
305
+ function nextQuestion() {
306
+ const question = questions[currentQuestion];
307
+
308
+ if (question.type !== "select") {
309
+ const input = document.getElementById('answerInput');
310
+ if (!input.value) {
311
+ alert("Por favor complete la pregunta");
312
+ return;
313
+ }
314
+ answers[question.key] = input.value;
315
+ }
316
+
317
+ currentQuestion++;
318
+
319
+ if (currentQuestion < questions.length) {
320
+ showQuestion(currentQuestion);
321
+ } else {
322
+ showResults();
323
+ }
324
+ }
325
+
326
+ function getZodiacSign(birthdate) {
327
+ const date = new Date(birthdate);
328
+ const month = date.getMonth() + 1;
329
+ const day = date.getDate();
330
+
331
+ if ((month === 3 && day >= 21) || (month === 4 && day <= 19)) return "aries";
332
+ if ((month === 4 && day >= 20) || (month === 5 && day <= 20)) return "tauro";
333
+ if ((month === 5 && day >= 21) || (month === 6 && day <= 20)) return "geminis";
334
+ if ((month === 6 && day >= 21) || (month === 7 && day <= 22)) return "cancer";
335
+ if ((month === 7 && day >= 23) || (month === 8 && day <= 22)) return "leo";
336
+ if ((month === 8 && day >= 23) || (month === 9 && day <= 22)) return "virgo";
337
+ if ((month === 9 && day >= 23) || (month === 10 && day <= 22)) return "libra";
338
+ if ((month === 10 && day >= 23) || (month === 11 && day <= 21)) return "escorpio";
339
+ if ((month === 11 && day >= 22) || (month === 12 && day <= 21)) return "sagitario";
340
+ if ((month === 12 && day >= 22) || (month === 1 && day <= 19)) return "capricornio";
341
+ if ((month === 1 && day >= 20) || (month === 2 && day <= 18)) return "acuario";
342
+ return "piscis";
343
+ }
344
+
345
+ function getNameFoods(name) {
346
+ const firstLetter = name.charAt(0).toLowerCase();
347
+ return nameFoodData[firstLetter] || ["Alimentos variados"];
348
+ }
349
+
350
+ function showResults() {
351
+ // Process answers
352
+ const zodiacSign = getZodiacSign(answers.birthdate);
353
+ const zodiacInfo = zodiacData[zodiacSign];
354
+ const nameFoods = getNameFoods(answers.name);
355
+ const moodWines = moodData[answers.mood.toLowerCase()] || [];
356
+ const locationWines = locationData[answers.location.toLowerCase().replace("en el ", "").replace("en la ", "").replace("en ", "")] || [];
357
+
358
+ // Find common wines
359
+ const allWines = [
360
+ ...zodiacInfo.winePairings,
361
+ ...moodWines,
362
+ ...locationWines
363
+ ];
364
+
365
+ // Count occurrences
366
+ const wineCounts = {};
367
+ allWines.forEach(wine => {
368
+ wineCounts[wine] = (wineCounts[wine] || 0) + 1;
369
+ });
370
+
371
+ // Sort by most common
372
+ const sortedWines = Object.keys(wineCounts).sort((a, b) => wineCounts[b] - wineCounts[a]);
373
+
374
+ // Get top 3 unique recommendations
375
+ const recommendations = [];
376
+ const seen = new Set();
377
+ for (const wine of sortedWines) {
378
+ if (!seen.has(wine)) {
379
+ recommendations.push(wine);
380
+ seen.add(wine);
381
+ if (recommendations.length >= 3) break;
382
+ }
383
+ }
384
+
385
+ // Display results
386
+ const container = document.getElementById('questionContainer');
387
+ container.innerHTML = `
388
+ <div class="fade-in text-center">
389
+ <div class="mb-8">
390
+ <i class="fas fa-star text-5xl text-yellow-400 mb-4"></i>
391
+ <h2 class="text-3xl font-bold mb-4">¡Hemos encontrado tu vino ideal!</h2>
392
+ <p class="text-lg mb-2">Basado en tu signo (${zodiacSign}), nombre, ubicación y estado de ánimo, te recomendamos:</p>
393
+ </div>
394
+
395
+ <div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-8">
396
+ ${recommendations.map((wine, index) => `
397
+ <div class="wine-card bg-white bg-opacity-10 p-6 rounded-xl border border-white border-opacity-20">
398
+ <div class="text-yellow-400 text-4xl mb-3">${index + 1}</div>
399
+ <h3 class="text-xl font-bold mb-2">${wine}</h3>
400
+ <p class="text-sm opacity-80">Perfecto para combinar con:</p>
401
+ <ul class="text-sm mt-1">
402
+ ${zodiacInfo.foods.slice(0, 2).map(food => `<li>• ${food}</li>`).join('')}
403
+ ${nameFoods.slice(0, 2).map(food => `<li>• ${food}</li>`).join('')}
404
+ </ul>
405
+ </div>
406
+ `).join('')}
407
+ </div>
408
+
409
+ <div class="bg-white bg-opacity-10 rounded-xl p-6 mb-8 text-left">
410
+ <h3 class="text-xl font-bold mb-4">Detalles de tu perfil:</h3>
411
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
412
+ <div>
413
+ <h4 class="font-semibold text-yellow-400 mb-2"><i class="fas fa-sun mr-2"></i> Signo Zodiacal: ${zodiacSign.charAt(0).toUpperCase() + zodiacSign.slice(1)}</h4>
414
+ <p class="text-sm">${zodiacInfo.traits}</p>
415
+ <p class="text-sm mt-2"><span class="font-semibold">Alimentos afines:</span> ${zodiacInfo.foods.join(", ")}</p>
416
+ </div>
417
+ <div>
418
+ <h4 class="font-semibold text-yellow-400 mb-2"><i class="fas fa-user mr-2"></i> Nombre: ${answers.name}</h4>
419
+ <p class="text-sm"><span class="font-semibold">Alimentos asociados:</span> ${nameFoods.join(", ")}</p>
420
+
421
+ <h4 class="font-semibold text-yellow-400 mt-4 mb-2"><i class="fas fa-map-marker-alt mr-2"></i> Contexto: ${answers.location}</h4>
422
+ <h4 class="font-semibold text-yellow-400 mt-4 mb-2"><i class="fas fa-smile mr-2"></i> Estado de ánimo: ${answers.mood}</h4>
423
+ </div>
424
+ </div>
425
+ </div>
426
+
427
+ <button onclick="startQuestionnaire()" class="bg-yellow-500 hover:bg-yellow-600 text-gray-900 font-bold py-3 px-8 rounded-full text-lg transition-all transform hover:scale-105">
428
+ <i class="fas fa-redo mr-2"></i> Volver a empezar
429
+ </button>
430
+ </div>
431
+ `;
432
+
433
+ // Update progress bar to 100%
434
+ document.getElementById('progressBar').style.width = '100%';
435
+ }
436
+ </script>
437
+ </body>
438
+ </html>