dilpreet77 commited on
Commit
5a772dc
·
verified ·
1 Parent(s): 2bca5e4

Update templates/index.html

Browse files
Files changed (1) hide show
  1. templates/index.html +170 -57
templates/index.html CHANGED
@@ -16,12 +16,13 @@
16
 
17
  <style>
18
  body {
19
- background: linear-gradient(135deg, #fff8f0, #ffe8cc, #ffddb5);
20
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
21
  overflow-x: hidden;
 
22
  }
23
 
24
- /* Animated background particles (subtle) */
25
  body::before {
26
  content: '';
27
  position: fixed;
@@ -30,26 +31,123 @@
30
  width: 100%;
31
  height: 100%;
32
  background-image:
33
- radial-gradient(2px 2px at 20px 30px, #e67e22, transparent),
34
- radial-gradient(2px 2px at 40px 70px, rgba(230, 126, 34, 0.8), transparent),
35
- radial-gradient(1px 1px at 90px 40px, #f39c12, transparent),
36
- radial-gradient(1px 1px at 130px 80px, rgba(241, 196, 15, 0.6), transparent);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  background-repeat: repeat;
38
- background-size: 200px 100px;
39
- animation: sparkle 20s linear infinite;
40
  pointer-events: none;
41
  z-index: -1;
42
  opacity: 0.3;
43
  }
44
 
45
- @keyframes sparkle {
46
- 0% { transform: translateY(0px) rotate(0deg); }
47
- 100% { transform: translateY(-100px) rotate(360deg); }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  }
49
 
50
  /* Card entrance animation */
51
  .main-card {
52
  animation: fadeInUp 0.8s ease-out;
 
 
53
  }
54
 
55
  @keyframes fadeInUp {
@@ -73,7 +171,7 @@
73
  }
74
 
75
  /* Icon shake on focus for fun */
76
- .input-group:focus-within i {
77
  animation: shake 0.5s ease-in-out;
78
  }
79
 
@@ -145,23 +243,46 @@
145
  }
146
  }
147
 
148
- /* Input group styling for icons */
149
  .input-group {
150
  position: relative;
 
151
  }
152
 
153
- .input-group i {
154
  position: absolute;
155
  left: 12px;
156
- top: 50%;
157
- transform: translateY(-50%);
158
  color: #e67e22;
159
  z-index: 10;
160
  transition: color 0.3s ease;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
161
  }
162
 
163
- .input-group input, .input-group select, .input-group textarea {
 
164
  padding-left: 40px;
 
 
 
 
 
 
 
 
 
165
  }
166
 
167
  /* Loading spinner for button */
@@ -185,13 +306,36 @@
185
  h1 {
186
  font-size: 1.8rem !important;
187
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
188
  }
189
  </style>
190
  </head>
191
  <body>
192
 
193
- <main class="min-vh-100 d-flex align-items-center justify-content-center p-4">
194
- <div class="card main-card shadow-lg rounded-4 p-5 w-100 animate__animated" style="max-width: 540px; background: linear-gradient(135deg, #fff9f1, #fff5e6);">
 
 
 
 
 
 
 
 
195
  <h1 class="text-center mb-5 text-4xl font-extrabold text-orange-600 animate__animated animate__bounceIn">
196
  <i class="fas fa-utensils me-2"></i>Indian Food Flavor Profile Prediction
197
  </h1>
@@ -204,7 +348,7 @@
204
  <i class="fas fa-list me-1"></i>Ingredients (comma separated):
205
  </label>
206
  <textarea id="ingredients" name="ingredients" rows="3" required placeholder="e.g., cumin, coriander, ginger" class="form-control rounded-3 border-2 border-warning"></textarea>
207
- <i class="fas fa-pepper-hot"></i>
208
  <div class="invalid-feedback">Please enter ingredients.</div>
209
  </div>
210
 
@@ -218,7 +362,7 @@
218
  <option value="vegetarian">Vegetarian</option>
219
  <option value="non vegetarian">Non Vegetarian</option>
220
  </select>
221
- <i class="fas fa-seedling"></i>
222
  <div class="invalid-feedback">Please select a diet.</div>
223
  </div>
224
 
@@ -234,7 +378,7 @@
234
  <option value="starter">Starter</option>
235
  <option value="snack">Snack</option>
236
  </select>
237
- <i class="fas fa-utensil-spoon"></i>
238
  <div class="invalid-feedback">Please select a course.</div>
239
  </div>
240
 
@@ -250,7 +394,7 @@
250
  <option value="North">North</option>
251
  <option value="South">South</option>
252
  </select>
253
- <i class="fas fa-globe-americas"></i>
254
  <div class="invalid-feedback">Please select a region.</div>
255
  </div>
256
 
@@ -262,7 +406,7 @@
262
  </label>
263
  <div class="input-group">
264
  <input id="prep_time" type="number" name="prep_time" min="0" required placeholder="e.g., 15" class="form-control rounded-3 border-2 border-warning" />
265
- <i class="fas fa-stopwatch"></i>
266
  </div>
267
  <div class="invalid-feedback">Please enter preparation time.</div>
268
  </div>
@@ -272,7 +416,7 @@
272
  </label>
273
  <div class="input-group">
274
  <input id="cook_time" type="number" name="cook_time" min="0" required placeholder="e.g., 30" class="form-control rounded-3 border-2 border-warning" />
275
- <i class="fas fa-burn"></i>
276
  </div>
277
  <div class="invalid-feedback">Please enter cook time.</div>
278
  </div>
@@ -292,35 +436,4 @@
292
  </main>
293
 
294
  <!-- Bootstrap JS Bundle -->
295
- <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.4.1/dist/js/bootstrap.bundle.min.js"></script>
296
-
297
- <script>
298
- // Bootstrap form validation
299
- (() => {
300
- 'use strict';
301
- const forms = document.querySelectorAll('.needs-validation');
302
- Array.from(forms).forEach(form => {
303
- form.addEventListener('submit', event => {
304
- if (!form.checkValidity()) {
305
- event.preventDefault();
306
- event.stopPropagation();
307
- } else {
308
- // Add loading state to button
309
- const btn = document.getElementById('submitBtn');
310
- btn.classList.add('btn-loading');
311
- btn.innerHTML = '<span class="spinner-border spinner-border-sm me-2" role="status"></span> Predicting...';
312
- btn.classList.add('animate__animated', 'animate__pulse');
313
- }
314
- form.classList.add('was-validated');
315
- }, false);
316
- });
317
- })();
318
-
319
- // Reset button on form reset or page load if needed
320
- document.addEventListener('DOMContentLoaded', function() {
321
- const btn = document.getElementById('submitBtn');
322
- // Note: Loading state will be reset by server response in a real app
323
- });
324
- </script>
325
- </body>
326
- </html>
 
16
 
17
  <style>
18
  body {
19
+ background: linear-gradient(135deg, #fff8f0, #ffe8cc, #ffddb5, #ffdab9);
20
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
21
  overflow-x: hidden;
22
+ position: relative;
23
  }
24
 
25
+ /* Enhanced animated background with foody elements */
26
  body::before {
27
  content: '';
28
  position: fixed;
 
31
  width: 100%;
32
  height: 100%;
33
  background-image:
34
+ /* Spice particles (cumin-like dots) */
35
+ radial-gradient(3px 3px at 20px 30px, #8B4513, transparent),
36
+ radial-gradient(2px 2px at 80px 50px, #FF4500, transparent),
37
+ radial-gradient(4px 4px at 150px 20px, #D2691E, transparent),
38
+ /* Steam wisps (curved lines for cooking steam) */
39
+ radial-gradient(1px 20px at 60px 80px, rgba(255, 255, 255, 0.6), transparent),
40
+ radial-gradient(1px 15px at 200px 100px, rgba(255, 255, 255, 0.4), transparent),
41
+ /* Floating leaf/curry leaf shapes */
42
+ radial-gradient(ellipse 10px 5px at 120px 60px, #228B22, transparent),
43
+ radial-gradient(ellipse 8px 4px at 250px 90px, #32CD32, transparent);
44
+ background-repeat: repeat;
45
+ background-size: 300px 200px;
46
+ animation: floatSpices 25s linear infinite;
47
+ pointer-events: none;
48
+ z-index: -1;
49
+ opacity: 0.4;
50
+ }
51
+
52
+ /* Additional foody animation layer: Rising bubbles/steam */
53
+ body::after {
54
+ content: '';
55
+ position: fixed;
56
+ top: 0;
57
+ left: 0;
58
+ width: 100%;
59
+ height: 100%;
60
+ background-image:
61
+ radial-gradient(circle 5px at 40px 90%, rgba(255, 193, 7, 0.5), transparent),
62
+ radial-gradient(circle 3px at 100px 70%, rgba(255, 140, 0, 0.4), transparent),
63
+ radial-gradient(circle 4px at 180px 85%, rgba(255, 69, 0, 0.3), transparent),
64
+ radial-gradient(circle 6px at 300px 95%, rgba(255, 215, 0, 0.5), transparent);
65
  background-repeat: repeat;
66
+ background-size: 400px 150px;
67
+ animation: riseSteam 15s ease-in-out infinite;
68
  pointer-events: none;
69
  z-index: -1;
70
  opacity: 0.3;
71
  }
72
 
73
+ @keyframes floatSpices {
74
+ 0% {
75
+ transform: translateY(0px) rotate(0deg);
76
+ opacity: 0.4;
77
+ }
78
+ 50% {
79
+ opacity: 0.8;
80
+ }
81
+ 100% {
82
+ transform: translateY(-200px) rotate(180deg);
83
+ opacity: 0.4;
84
+ }
85
+ }
86
+
87
+ @keyframes riseSteam {
88
+ 0% {
89
+ transform: translateY(100vh) scale(0);
90
+ opacity: 0;
91
+ }
92
+ 10% {
93
+ opacity: 1;
94
+ }
95
+ 90% {
96
+ opacity: 1;
97
+ }
98
+ 100% {
99
+ transform: translateY(-100px) scale(1.5);
100
+ opacity: 0;
101
+ }
102
+ }
103
+
104
+ /* Subtle rotating utensil in background (optional, low opacity) */
105
+ .bg-utensil {
106
+ position: fixed;
107
+ top: 20%;
108
+ right: 10%;
109
+ font-size: 3rem;
110
+ color: rgba(230, 126, 34, 0.1);
111
+ z-index: -1;
112
+ animation: rotateUtensil 20s linear infinite;
113
+ }
114
+
115
+ .bg-plate {
116
+ position: fixed;
117
+ bottom: 20%;
118
+ left: 10%;
119
+ font-size: 4rem;
120
+ color: rgba(255, 193, 7, 0.08);
121
+ z-index: -1;
122
+ animation: bouncePlate 8s ease-in-out infinite;
123
+ }
124
+
125
+ @keyframes rotateUtensil {
126
+ from { transform: rotate(0deg); }
127
+ to { transform: rotate(360deg); }
128
+ }
129
+
130
+ @keyframes bouncePlate {
131
+ 0%, 100% { transform: translateY(0px); }
132
+ 50% { transform: translateY(-20px); }
133
+ }
134
+
135
+ /* Ensure main content is perfectly centered */
136
+ main {
137
+ min-height: 100vh;
138
+ display: flex;
139
+ align-items: center;
140
+ justify-content: center;
141
+ padding: 2rem;
142
+ position: relative;
143
+ z-index: 1;
144
  }
145
 
146
  /* Card entrance animation */
147
  .main-card {
148
  animation: fadeInUp 0.8s ease-out;
149
+ width: 100%;
150
+ max-width: 540px;
151
  }
152
 
153
  @keyframes fadeInUp {
 
171
  }
172
 
173
  /* Icon shake on focus for fun */
174
+ .input-group:focus-within i.input-icon {
175
  animation: shake 0.5s ease-in-out;
176
  }
177
 
 
243
  }
244
  }
245
 
246
+ /* Improved Input group styling for icons - Fixed positioning */
247
  .input-group {
248
  position: relative;
249
+ display: block; /* Ensure consistent layout */
250
  }
251
 
252
+ .input-group .input-icon {
253
  position: absolute;
254
  left: 12px;
 
 
255
  color: #e67e22;
256
  z-index: 10;
257
  transition: color 0.3s ease;
258
+ pointer-events: none; /* Prevent icon from interfering with input */
259
+ }
260
+
261
+ /* For single-line inputs and selects: center vertically */
262
+ .input-group input:not(textarea), .input-group select {
263
+ padding-left: 40px;
264
+ min-height: 42px; /* Consistent height for alignment */
265
+ }
266
+
267
+ .input-group input:not(textarea) + .input-icon,
268
+ .input-group select + .input-icon {
269
+ top: 50%;
270
+ transform: translateY(-50%);
271
+ font-size: 1rem;
272
  }
273
 
274
+ /* For textarea: Align icon to the top-left, near the first line */
275
+ .input-group textarea {
276
  padding-left: 40px;
277
+ padding-top: 12px; /* Space for icon */
278
+ resize: vertical; /* Allow vertical resize only */
279
+ }
280
+
281
+ .input-group textarea + .input-icon {
282
+ top: 12px;
283
+ transform: none; /* No vertical centering for multi-line */
284
+ font-size: 1.1rem;
285
+ line-height: 1;
286
  }
287
 
288
  /* Loading spinner for button */
 
306
  h1 {
307
  font-size: 1.8rem !important;
308
  }
309
+
310
+ /* Hide background elements on small screens for performance */
311
+ body::before, body::after, .bg-utensil, .bg-plate {
312
+ display: none;
313
+ }
314
+
315
+ /* Adjust icon padding on mobile */
316
+ .input-group input, .input-group select, .input-group textarea {
317
+ padding-left: 35px;
318
+ }
319
+
320
+ .input-group .input-icon {
321
+ left: 10px;
322
+ font-size: 0.9rem;
323
+ }
324
  }
325
  </style>
326
  </head>
327
  <body>
328
 
329
+ <!-- Background foody elements -->
330
+ <div class="bg-utensil">
331
+ <i class="fas fa-utensils"></i>
332
+ </div>
333
+ <div class="bg-plate">
334
+ <i class="fas fa-circle"></i> <!-- Simple plate representation -->
335
+ </div>
336
+
337
+ <main>
338
+ <div class="card main-card shadow-lg rounded-4 p-5 w-100 animate__animated" style="background: linear-gradient(135deg, #fff9f1, #fff5e6);">
339
  <h1 class="text-center mb-5 text-4xl font-extrabold text-orange-600 animate__animated animate__bounceIn">
340
  <i class="fas fa-utensils me-2"></i>Indian Food Flavor Profile Prediction
341
  </h1>
 
348
  <i class="fas fa-list me-1"></i>Ingredients (comma separated):
349
  </label>
350
  <textarea id="ingredients" name="ingredients" rows="3" required placeholder="e.g., cumin, coriander, ginger" class="form-control rounded-3 border-2 border-warning"></textarea>
351
+ <i class="fas fa-pepper-hot input-icon"></i>
352
  <div class="invalid-feedback">Please enter ingredients.</div>
353
  </div>
354
 
 
362
  <option value="vegetarian">Vegetarian</option>
363
  <option value="non vegetarian">Non Vegetarian</option>
364
  </select>
365
+ <i class="fas fa-seedling input-icon"></i>
366
  <div class="invalid-feedback">Please select a diet.</div>
367
  </div>
368
 
 
378
  <option value="starter">Starter</option>
379
  <option value="snack">Snack</option>
380
  </select>
381
+ <i class="fas fa-utensil-spoon input-icon"></i>
382
  <div class="invalid-feedback">Please select a course.</div>
383
  </div>
384
 
 
394
  <option value="North">North</option>
395
  <option value="South">South</option>
396
  </select>
397
+ <i class="fas fa-globe-americas input-icon"></i>
398
  <div class="invalid-feedback">Please select a region.</div>
399
  </div>
400
 
 
406
  </label>
407
  <div class="input-group">
408
  <input id="prep_time" type="number" name="prep_time" min="0" required placeholder="e.g., 15" class="form-control rounded-3 border-2 border-warning" />
409
+ <i class="fas fa-stopwatch input-icon"></i>
410
  </div>
411
  <div class="invalid-feedback">Please enter preparation time.</div>
412
  </div>
 
416
  </label>
417
  <div class="input-group">
418
  <input id="cook_time" type="number" name="cook_time" min="0" required placeholder="e.g., 30" class="form-control rounded-3 border-2 border-warning" />
419
+ <i class="fas fa-burn input-icon"></i>
420
  </div>
421
  <div class="invalid-feedback">Please enter cook time.</div>
422
  </div>
 
436
  </main>
437
 
438
  <!-- Bootstrap JS Bundle -->
439
+ <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.4.1