dilpreet77 commited on
Commit
ec0b19b
ยท
verified ยท
1 Parent(s): 50d5bd6

Update templates/index.html

Browse files
Files changed (1) hide show
  1. templates/index.html +185 -143
templates/index.html CHANGED
@@ -37,11 +37,11 @@
37
  .main-card {
38
  animation: fadeInUp 0.8s ease-out;
39
  width: 100%;
40
- max-width: 540px;
41
  background: linear-gradient(135deg, #fff9f1, #fff5e6);
42
  border-radius: 1rem;
43
  box-shadow: 0 10px 30px rgba(230, 126, 34, 0.15);
44
- padding: 3rem 3rem 2rem;
45
  }
46
 
47
  @keyframes fadeInUp {
@@ -55,100 +55,80 @@
55
  }
56
  }
57
 
58
- /* Input group styling */
59
- .input-group {
 
60
  position: relative;
61
- display: block;
62
- }
63
-
64
- /* Icon styling and positioning */
65
- .input-icon {
66
- position: absolute;
67
- left: 15px;
68
- color: #e67e22;
69
- z-index: 10;
70
- pointer-events: none;
71
- transition: color 0.3s ease;
72
  }
73
 
74
- /* For single-line inputs and selects */
75
- .input-group input:not(textarea),
76
- .input-group select {
77
- padding-left: 45px;
78
- min-height: 44px;
79
- border-width: 2px !important;
80
- border-color: #f39c12 !important;
81
- border-radius: 0.75rem !important;
82
- transition: all 0.3s ease;
83
  }
84
 
85
- .input-group input:not(textarea) + .input-icon,
86
- .input-group select + .input-icon {
87
- top: 50%;
88
- transform: translateY(-50%);
89
  font-size: 1.1rem;
 
 
 
 
90
  }
91
 
92
- /* For textarea */
93
- .input-group textarea {
94
- padding-left: 45px;
95
- padding-top: 14px;
96
- border-width: 2px !important;
97
- border-color: #f39c12 !important;
98
  border-radius: 0.75rem !important;
99
- transition: all 0.3s ease;
100
- resize: vertical;
101
- min-height: 90px;
102
- }
103
-
104
- .input-group textarea + .input-icon {
105
- top: 14px;
106
- font-size: 1.2rem;
107
- line-height: 1;
108
- transform: none;
109
  }
110
 
111
- /* Input focus effect */
112
- input:focus, select:focus, textarea:focus {
113
  outline: none !important;
114
- box-shadow: 0 0 8px rgba(230, 126, 34, 0.6), 0 0 0 0.25rem rgba(230, 126, 34, 0.25) !important;
115
  border-color: #e67e22 !important;
116
- transform: scale(1.02);
117
- transition: all 0.3s ease;
118
- }
119
-
120
- /* Icon shake on focus */
121
- .input-group:focus-within .input-icon {
122
- animation: shake 0.5s ease-in-out;
123
  }
124
 
125
- @keyframes shake {
126
- 0%, 100% { transform: translateX(0); }
127
- 25% { transform: translateX(-5px); }
128
- 75% { transform: translateX(5px); }
 
129
  }
130
 
131
  /* Placeholder styling */
132
  ::placeholder {
133
  color: #d35400;
134
  opacity: 0.7;
 
135
  }
136
 
137
  /* Button styling */
138
- .btn-warning {
139
- background: linear-gradient(45deg, #f39c12, #e67e22);
140
- border: none;
141
  transition: all 0.3s ease;
142
  position: relative;
143
  overflow: hidden;
144
- border-radius: 0.75rem;
145
- font-weight: 700;
146
- font-size: 1.25rem;
147
- padding: 0.75rem 1rem;
148
  box-shadow: 0 4px 12px rgba(231, 111, 32, 0.3);
 
 
 
149
  }
150
 
151
- .btn-warning::before {
152
  content: '';
153
  position: absolute;
154
  top: 0;
@@ -160,67 +140,97 @@
160
  border-radius: 0.75rem;
161
  }
162
 
163
- .btn-warning:hover::before {
164
  left: 100%;
165
  }
166
 
167
- .btn-warning:hover {
168
  background: linear-gradient(45deg, #e67e22, #d68910) !important;
169
  box-shadow: 0 8px 25px rgba(231, 111, 32, 0.5);
170
  transform: translateY(-2px);
 
 
 
 
 
 
 
 
171
  }
172
 
173
  /* Card hover */
174
- .card:hover {
175
  box-shadow: 0 20px 40px rgba(230, 126, 34, 0.25) !important;
176
- transform: translateY(-5px);
177
  transition: all 0.3s ease;
178
  }
179
 
180
  /* Prediction result styling */
181
  .prediction-result {
182
- animation: slideInRight 0.6s ease-out;
183
  border: none;
184
- background: linear-gradient(135deg, #fff8f0, #ffe8cc);
185
- box-shadow: 0 4px 15px rgba(230, 126, 34, 0.1);
186
  border-radius: 0.75rem;
187
  padding: 1.5rem;
188
  margin-top: 1.5rem;
189
- color: #d35400;
190
  font-weight: 600;
191
- font-size: 1.25rem;
192
  text-align: center;
 
193
  }
194
 
195
- @keyframes slideInRight {
196
  from {
197
  opacity: 0;
198
- transform: translateX(100%);
199
  }
200
  to {
201
  opacity: 1;
202
- transform: translateX(0);
203
  }
204
  }
205
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
206
  /* Responsive adjustments */
207
- @media (max-width: 576px) {
208
  .main-card {
209
- padding: 2rem 1.5rem 1.5rem;
 
 
 
 
 
 
210
  }
 
211
  h1 {
212
  font-size: 1.8rem !important;
213
  }
214
- .input-group input, .input-group select, .input-group textarea {
215
- padding-left: 40px;
216
- }
217
- .input-group .input-icon {
218
- left: 12px;
219
- font-size: 1rem;
220
  }
221
- .btn-warning {
222
- font-size: 1.1rem;
223
- padding: 0.65rem 1rem;
 
224
  }
225
  }
226
  </style>
@@ -229,96 +239,116 @@
229
 
230
  <main>
231
  <div class="card main-card shadow-lg animate__animated">
232
- <h1 class="text-center mb-5 text-4xl font-extrabold text-orange-600 animate__animated animate__bounceIn">
233
- <i class="fas fa-utensils me-2"></i>Indian Food Flavor Profile Prediction
234
  </h1>
235
 
236
  <form method="post" class="needs-validation" novalidate id="predictionForm">
237
 
238
  <!-- Ingredients -->
239
- <div class="mb-4 input-group">
240
- <label for="ingredients" class="form-label fw-semibold fs-6 text-secondary">
241
- <i class="fas fa-list me-1"></i>Ingredients (comma separated):
242
  </label>
243
- <textarea id="ingredients" name="ingredients" rows="3" required placeholder="e.g., cumin, coriander, ginger" class="form-control"></textarea>
244
- <i class="fas fa-pepper-hot input-icon"></i>
245
- <div class="invalid-feedback">Please enter ingredients.</div>
 
 
 
 
 
 
246
  </div>
247
 
248
  <!-- Diet -->
249
- <div class="mb-4 input-group">
250
- <label for="diet" class="form-label fw-semibold fs-6 text-secondary">
251
- <i class="fas fa-leaf me-1"></i>Diet:
252
  </label>
253
  <select id="diet" name="diet" required class="form-select">
254
- <option value="" disabled selected>Select diet</option>
255
- <option value="vegetarian">Vegetarian</option>
256
- <option value="non vegetarian">Non Vegetarian</option>
257
  </select>
258
- <i class="fas fa-seedling input-icon"></i>
259
- <div class="invalid-feedback">Please select a diet.</div>
260
  </div>
261
 
262
  <!-- Course -->
263
- <div class="mb-4 input-group">
264
- <label for="course" class="form-label fw-semibold fs-6 text-secondary">
265
- <i class="fas fa-drumstick-bite me-1"></i>Course:
266
  </label>
267
  <select id="course" name="course" required class="form-select">
268
- <option value="" disabled selected>Select course</option>
269
- <option value="dessert">Dessert</option>
270
- <option value="main course">Main Course</option>
271
- <option value="starter">Starter</option>
272
- <option value="snack">Snack</option>
273
  </select>
274
- <i class="fas fa-utensil-spoon input-icon"></i>
275
- <div class="invalid-feedback">Please select a course.</div>
276
  </div>
277
 
278
  <!-- Region -->
279
- <div class="mb-4 input-group">
280
- <label for="region" class="form-label fw-semibold fs-6 text-secondary">
281
- <i class="fas fa-map-marker-alt me-1"></i>Region:
282
  </label>
283
  <select id="region" name="region" required class="form-select">
284
- <option value="" disabled selected>Select region</option>
285
- <option value="East">East</option>
286
- <option value="West">West</option>
287
- <option value="North">North</option>
288
- <option value="South">South</option>
289
  </select>
290
- <i class="fas fa-globe-americas input-icon"></i>
291
  <div class="invalid-feedback">Please select a region.</div>
292
  </div>
293
 
294
  <!-- Prep & Cook Time -->
295
- <div class="row mb-4 g-3">
296
- <div class="col-6 input-group">
297
- <label for="prep_time" class="form-label fw-semibold fs-6 text-secondary">
298
- <i class="fas fa-clock me-1"></i>Preparation Time (minutes):
299
  </label>
300
- <input id="prep_time" type="number" name="prep_time" min="0" required placeholder="e.g., 15" class="form-control" />
301
- <i class="fas fa-stopwatch input-icon"></i>
302
- <div class="invalid-feedback">Please enter preparation time.</div>
 
 
 
 
 
 
 
 
303
  </div>
304
- <div class="col-6 input-group">
305
- <label for="cook_time" class="form-label fw-semibold fs-6 text-secondary">
306
- <i class="fas fa-fire me-1"></i>Cook Time (minutes):
 
307
  </label>
308
- <input id="cook_time" type="number" name="cook_time" min="0" required placeholder="e.g., 30" class="form-control" />
309
- <i class="fas fa-burn input-icon"></i>
310
- <div class="invalid-feedback">Please enter cook time.</div>
 
 
 
 
 
 
 
 
311
  </div>
312
  </div>
313
 
314
- <button type="submit" class="btn btn-warning w-100 shadow-sm" id="submitBtn">
315
- <i class="fas fa-magic me-2"></i>Predict Flavor Profile
316
  </button>
317
  </form>
318
 
319
  {% if prediction %}
320
  <div class="prediction-result">
321
- <i class="fas fa-star-and-crescent me-2"></i>Predicted Flavor Profile: {{ prediction }}
322
  </div>
323
  {% endif %}
324
  </div>
@@ -340,14 +370,26 @@
340
  } else {
341
  // Add loading state to button
342
  const btn = document.getElementById('submitBtn');
343
- btn.classList.add('btn-loading');
344
- btn.innerHTML = '<span class="spinner-border spinner-border-sm me-2" role="status"></span> Predicting...';
345
  btn.classList.add('animate__animated', 'animate__pulse');
346
  }
347
  form.classList.add('was-validated');
348
  }, false);
349
  });
350
  })();
 
 
 
 
 
 
 
 
 
 
 
 
351
  </script>
352
  </body>
353
- </html>
 
37
  .main-card {
38
  animation: fadeInUp 0.8s ease-out;
39
  width: 100%;
40
+ max-width: 600px;
41
  background: linear-gradient(135deg, #fff9f1, #fff5e6);
42
  border-radius: 1rem;
43
  box-shadow: 0 10px 30px rgba(230, 126, 34, 0.15);
44
+ padding: 3rem;
45
  }
46
 
47
  @keyframes fadeInUp {
 
55
  }
56
  }
57
 
58
+ /* Form group styling */
59
+ .form-group {
60
+ margin-bottom: 1.5rem;
61
  position: relative;
 
 
 
 
 
 
 
 
 
 
 
62
  }
63
 
64
+ /* Label styling */
65
+ .form-label {
66
+ font-weight: 600 !important;
67
+ font-size: 1rem !important;
68
+ color: #8b4513 !important;
69
+ margin-bottom: 0.5rem !important;
70
+ display: block;
 
 
71
  }
72
 
73
+ .label-icon {
 
 
 
74
  font-size: 1.1rem;
75
+ margin-right: 0.5rem;
76
+ color: #e67e22;
77
+ width: 16px;
78
+ text-align: center;
79
  }
80
 
81
+ /* Input styling */
82
+ .form-control, .form-select {
83
+ border: 2px solid #f39c12 !important;
 
 
 
84
  border-radius: 0.75rem !important;
85
+ padding: 0.75rem 1rem !important;
86
+ font-size: 1rem !important;
87
+ transition: all 0.3s ease !important;
88
+ background-color: #fffbf7 !important;
89
+ min-height: 48px;
 
 
 
 
 
90
  }
91
 
92
+ .form-control:focus, .form-select:focus {
 
93
  outline: none !important;
94
+ box-shadow: 0 0 8px rgba(230, 126, 34, 0.4), 0 0 0 0.25rem rgba(230, 126, 34, 0.2) !important;
95
  border-color: #e67e22 !important;
96
+ transform: scale(1.01);
97
+ background-color: #ffffff !important;
 
 
 
 
 
98
  }
99
 
100
+ /* Textarea specific */
101
+ textarea.form-control {
102
+ resize: vertical;
103
+ min-height: 100px !important;
104
+ padding-top: 0.75rem !important;
105
  }
106
 
107
  /* Placeholder styling */
108
  ::placeholder {
109
  color: #d35400;
110
  opacity: 0.7;
111
+ font-style: italic;
112
  }
113
 
114
  /* Button styling */
115
+ .btn-predict {
116
+ background: linear-gradient(45deg, #f39c12, #e67e22) !important;
117
+ border: none !important;
118
  transition: all 0.3s ease;
119
  position: relative;
120
  overflow: hidden;
121
+ border-radius: 0.75rem !important;
122
+ font-weight: 700 !important;
123
+ font-size: 1.2rem !important;
124
+ padding: 1rem 2rem !important;
125
  box-shadow: 0 4px 12px rgba(231, 111, 32, 0.3);
126
+ color: white !important;
127
+ width: 100%;
128
+ margin-top: 1rem;
129
  }
130
 
131
+ .btn-predict::before {
132
  content: '';
133
  position: absolute;
134
  top: 0;
 
140
  border-radius: 0.75rem;
141
  }
142
 
143
+ .btn-predict:hover::before {
144
  left: 100%;
145
  }
146
 
147
+ .btn-predict:hover {
148
  background: linear-gradient(45deg, #e67e22, #d68910) !important;
149
  box-shadow: 0 8px 25px rgba(231, 111, 32, 0.5);
150
  transform: translateY(-2px);
151
+ color: white !important;
152
+ }
153
+
154
+ /* Time inputs row */
155
+ .time-row {
156
+ display: grid;
157
+ grid-template-columns: 1fr 1fr;
158
+ gap: 1rem;
159
  }
160
 
161
  /* Card hover */
162
+ .main-card:hover {
163
  box-shadow: 0 20px 40px rgba(230, 126, 34, 0.25) !important;
164
+ transform: translateY(-2px);
165
  transition: all 0.3s ease;
166
  }
167
 
168
  /* Prediction result styling */
169
  .prediction-result {
170
+ animation: slideInUp 0.6s ease-out;
171
  border: none;
172
+ background: linear-gradient(135deg, #e8f5e8, #d4edda);
173
+ box-shadow: 0 4px 15px rgba(40, 167, 69, 0.2);
174
  border-radius: 0.75rem;
175
  padding: 1.5rem;
176
  margin-top: 1.5rem;
177
+ color: #155724;
178
  font-weight: 600;
179
+ font-size: 1.1rem;
180
  text-align: center;
181
+ border-left: 4px solid #28a745;
182
  }
183
 
184
+ @keyframes slideInUp {
185
  from {
186
  opacity: 0;
187
+ transform: translateY(30px);
188
  }
189
  to {
190
  opacity: 1;
191
+ transform: translateY(0);
192
  }
193
  }
194
 
195
+ /* Form validation styles */
196
+ .form-control.is-invalid, .form-select.is-invalid {
197
+ border-color: #dc3545 !important;
198
+ box-shadow: 0 0 8px rgba(220, 53, 69, 0.4) !important;
199
+ }
200
+
201
+ .invalid-feedback {
202
+ display: block;
203
+ color: #dc3545;
204
+ font-size: 0.875rem;
205
+ margin-top: 0.25rem;
206
+ font-style: italic;
207
+ }
208
+
209
  /* Responsive adjustments */
210
+ @media (max-width: 768px) {
211
  .main-card {
212
+ padding: 2rem 1.5rem;
213
+ margin: 1rem;
214
+ }
215
+
216
+ .time-row {
217
+ grid-template-columns: 1fr;
218
+ gap: 1rem;
219
  }
220
+
221
  h1 {
222
  font-size: 1.8rem !important;
223
  }
224
+ }
225
+
226
+ @media (max-width: 480px) {
227
+ .main-card {
228
+ padding: 1.5rem 1rem;
 
229
  }
230
+
231
+ .btn-predict {
232
+ font-size: 1.1rem !important;
233
+ padding: 0.875rem 1.5rem !important;
234
  }
235
  }
236
  </style>
 
239
 
240
  <main>
241
  <div class="card main-card shadow-lg animate__animated">
242
+ <h1 class="text-center mb-4 text-3xl font-extrabold text-orange-600 animate__animated animate__bounceIn">
243
+ ๐Ÿ› Indian Food Flavor Profile Prediction
244
  </h1>
245
 
246
  <form method="post" class="needs-validation" novalidate id="predictionForm">
247
 
248
  <!-- Ingredients -->
249
+ <div class="form-group">
250
+ <label for="ingredients" class="form-label">
251
+ <span class="label-icon">๐ŸŒถ๏ธ</span>Ingredients
252
  </label>
253
+ <textarea
254
+ id="ingredients"
255
+ name="ingredients"
256
+ rows="3"
257
+ required
258
+ placeholder="Enter ingredients separated by commas (e.g., cumin, coriander, ginger, turmeric)"
259
+ class="form-control"
260
+ ></textarea>
261
+ <div class="invalid-feedback">Please enter at least one ingredient.</div>
262
  </div>
263
 
264
  <!-- Diet -->
265
+ <div class="form-group">
266
+ <label for="diet" class="form-label">
267
+ <span class="label-icon">๐Ÿฅฌ</span>Diet Type
268
  </label>
269
  <select id="diet" name="diet" required class="form-select">
270
+ <option value="" disabled selected>Choose diet type</option>
271
+ <option value="vegetarian">๐ŸŒฑ Vegetarian</option>
272
+ <option value="non vegetarian">๐Ÿ– Non Vegetarian</option>
273
  </select>
274
+ <div class="invalid-feedback">Please select a diet type.</div>
 
275
  </div>
276
 
277
  <!-- Course -->
278
+ <div class="form-group">
279
+ <label for="course" class="form-label">
280
+ <span class="label-icon">๐Ÿฝ๏ธ</span>Course Type
281
  </label>
282
  <select id="course" name="course" required class="form-select">
283
+ <option value="" disabled selected>Choose course type</option>
284
+ <option value="starter">๐Ÿฅ— Starter</option>
285
+ <option value="main course">๐Ÿ› Main Course</option>
286
+ <option value="dessert">๐Ÿฎ Dessert</option>
287
+ <option value="snack">๐Ÿฟ Snack</option>
288
  </select>
289
+ <div class="invalid-feedback">Please select a course type.</div>
 
290
  </div>
291
 
292
  <!-- Region -->
293
+ <div class="form-group">
294
+ <label for="region" class="form-label">
295
+ <span class="label-icon">๐Ÿ—บ๏ธ</span>Indian Region
296
  </label>
297
  <select id="region" name="region" required class="form-select">
298
+ <option value="" disabled selected>Choose regional cuisine</option>
299
+ <option value="North">๐Ÿ”๏ธ North Indian</option>
300
+ <option value="South">๐Ÿ๏ธ South Indian</option>
301
+ <option value="East">๐ŸŒ… East Indian</option>
302
+ <option value="West">๐ŸŒŠ West Indian</option>
303
  </select>
 
304
  <div class="invalid-feedback">Please select a region.</div>
305
  </div>
306
 
307
  <!-- Prep & Cook Time -->
308
+ <div class="time-row">
309
+ <div class="form-group">
310
+ <label for="prep_time" class="form-label">
311
+ <span class="label-icon">โฑ๏ธ</span>Prep Time (minutes)
312
  </label>
313
+ <input
314
+ id="prep_time"
315
+ type="number"
316
+ name="prep_time"
317
+ min="0"
318
+ max="300"
319
+ required
320
+ placeholder="e.g., 15"
321
+ class="form-control"
322
+ />
323
+ <div class="invalid-feedback">Enter preparation time (0-300 minutes).</div>
324
  </div>
325
+
326
+ <div class="form-group">
327
+ <label for="cook_time" class="form-label">
328
+ <span class="label-icon">๐Ÿ”ฅ</span>Cook Time (minutes)
329
  </label>
330
+ <input
331
+ id="cook_time"
332
+ type="number"
333
+ name="cook_time"
334
+ min="0"
335
+ max="600"
336
+ required
337
+ placeholder="e.g., 30"
338
+ class="form-control"
339
+ />
340
+ <div class="invalid-feedback">Enter cooking time (0-600 minutes).</div>
341
  </div>
342
  </div>
343
 
344
+ <button type="submit" class="btn btn-predict shadow-sm" id="submitBtn">
345
+ โœจ Predict Flavor Profile
346
  </button>
347
  </form>
348
 
349
  {% if prediction %}
350
  <div class="prediction-result">
351
+ ๐ŸŽฏ Predicted Flavor Profile: <strong>{{ prediction }}</strong>
352
  </div>
353
  {% endif %}
354
  </div>
 
370
  } else {
371
  // Add loading state to button
372
  const btn = document.getElementById('submitBtn');
373
+ btn.disabled = true;
374
+ btn.innerHTML = '<span class="spinner-border spinner-border-sm me-2" role="status"></span>๐Ÿ”ฎ Analyzing flavors...';
375
  btn.classList.add('animate__animated', 'animate__pulse');
376
  }
377
  form.classList.add('was-validated');
378
  }, false);
379
  });
380
  })();
381
+
382
+ // Add some interactive feedback
383
+ document.querySelectorAll('.form-control, .form-select').forEach(input => {
384
+ input.addEventListener('focus', function() {
385
+ this.parentElement.style.transform = 'scale(1.01)';
386
+ this.parentElement.style.transition = 'transform 0.2s ease';
387
+ });
388
+
389
+ input.addEventListener('blur', function() {
390
+ this.parentElement.style.transform = 'scale(1)';
391
+ });
392
+ });
393
  </script>
394
  </body>
395
+ </html>