File size: 12,806 Bytes
b90b222
2bca5e4
b90b222
195e83f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50d5bd6
195e83f
 
 
 
 
 
 
 
 
 
50d5bd6
195e83f
 
 
ec0b19b
50d5bd6
 
 
ec0b19b
195e83f
 
 
 
 
 
 
 
 
 
 
 
 
ec0b19b
 
 
50d5bd6
 
 
ec0b19b
 
 
 
 
 
 
50d5bd6
 
ec0b19b
50d5bd6
ec0b19b
 
 
 
50d5bd6
 
ec0b19b
 
 
50d5bd6
ec0b19b
 
 
 
 
50d5bd6
 
ec0b19b
195e83f
ec0b19b
195e83f
ec0b19b
 
195e83f
 
ec0b19b
 
 
 
 
195e83f
 
 
 
 
 
ec0b19b
195e83f
 
50d5bd6
ec0b19b
 
 
195e83f
 
 
ec0b19b
 
 
 
50d5bd6
ec0b19b
 
 
195e83f
 
ec0b19b
195e83f
 
 
 
 
 
 
 
50d5bd6
195e83f
 
ec0b19b
195e83f
 
 
ec0b19b
195e83f
50d5bd6
195e83f
ec0b19b
 
 
 
 
 
 
 
195e83f
 
50d5bd6
ec0b19b
195e83f
ec0b19b
195e83f
 
 
50d5bd6
195e83f
ec0b19b
195e83f
ec0b19b
 
50d5bd6
 
 
ec0b19b
50d5bd6
ec0b19b
50d5bd6
ec0b19b
195e83f
 
ec0b19b
195e83f
 
ec0b19b
195e83f
 
 
ec0b19b
195e83f
 
 
ec0b19b
 
 
 
 
 
 
 
 
 
 
 
 
 
195e83f
ec0b19b
50d5bd6
ec0b19b
 
 
 
 
 
 
195e83f
ec0b19b
195e83f
 
 
ec0b19b
 
 
 
 
50d5bd6
ec0b19b
 
 
 
195e83f
 
 
b90b222
6a5f05e
b90b222
195e83f
50d5bd6
ec0b19b
 
195e83f
 
 
 
 
ec0b19b
 
 
195e83f
ec0b19b
 
 
 
 
 
 
 
 
195e83f
 
 
ec0b19b
 
 
195e83f
50d5bd6
ec0b19b
 
 
195e83f
ec0b19b
195e83f
 
 
ec0b19b
 
 
195e83f
50d5bd6
ec0b19b
 
 
 
 
195e83f
ec0b19b
195e83f
 
 
ec0b19b
 
 
195e83f
50d5bd6
ec0b19b
 
 
 
 
195e83f
 
 
ca71928
195e83f
ec0b19b
 
 
 
195e83f
ec0b19b
 
 
 
 
 
 
 
 
 
 
195e83f
ec0b19b
 
 
 
195e83f
ec0b19b
 
 
 
 
 
 
 
 
 
 
195e83f
6a5f05e
195e83f
ec0b19b
 
195e83f
 
 
 
50d5bd6
ec0b19b
195e83f
 
48d6b45
 
 
 
 
 
 
 
 
 
 
 
 
1138144
 
48d6b45
6a5f05e
48d6b45
 
 
1138144
48d6b45
195e83f
0a2f101
195e83f
50d5bd6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ec0b19b
 
50d5bd6
 
 
 
 
 
ec0b19b
 
 
 
 
 
 
 
 
 
 
 
50d5bd6
 
ec0b19b
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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <title>Flavor Profile Prediction</title>
  
  <!-- Bootstrap CSS -->
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.4.1/dist/css/bootstrap.min.css" rel="stylesheet" />
  <!-- Tailwind CSS CDN -->
  <script src="https://cdn.tailwindcss.com"></script>
  <!-- Font Awesome for Icons -->
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" />
  <!-- Animate.css for Animations -->
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css" />
  
  <style>
    body {
      background: linear-gradient(135deg, #fff8f0, #ffe8cc, #ffddb5, #ffdab9);
      font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
      overflow-x: hidden;
      position: relative;
    }

    /* Center main content */
    main {
      min-height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 2rem;
      position: relative;
      z-index: 1;
    }

    /* Card styling */
    .main-card {
      animation: fadeInUp 0.8s ease-out;
      width: 100%;
      max-width: 600px;
      background: linear-gradient(135deg, #fff9f1, #fff5e6);
      border-radius: 1rem;
      box-shadow: 0 10px 30px rgba(230, 126, 34, 0.15);
      padding: 3rem;
    }

    @keyframes fadeInUp {
      from {
        opacity: 0;
        transform: translateY(30px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    /* Form group styling */
    .form-group {
      margin-bottom: 1.5rem;
      position: relative;
    }

    /* Label styling */
    .form-label {
      font-weight: 600 !important;
      font-size: 1rem !important;
      color: #8b4513 !important;
      margin-bottom: 0.5rem !important;
      display: block;
    }

    .label-icon {
      font-size: 1.1rem;
      margin-right: 0.5rem;
      color: #e67e22;
      width: 16px;
      text-align: center;
    }

    /* Input styling */
    .form-control, .form-select {
      border: 2px solid #f39c12 !important;
      border-radius: 0.75rem !important;
      padding: 0.75rem 1rem !important;
      font-size: 1rem !important;
      transition: all 0.3s ease !important;
      background-color: #fffbf7 !important;
      min-height: 48px;
    }

    .form-control:focus, .form-select:focus {
      outline: none !important;
      box-shadow: 0 0 8px rgba(230, 126, 34, 0.4), 0 0 0 0.25rem rgba(230, 126, 34, 0.2) !important;
      border-color: #e67e22 !important;
      transform: scale(1.01);
      background-color: #ffffff !important;
    }

    /* Textarea specific */
    textarea.form-control {
      resize: vertical;
      min-height: 100px !important;
      padding-top: 0.75rem !important;
    }

    /* Placeholder styling */
    ::placeholder {
      color: #d35400;
      opacity: 0.7;
      font-style: italic;
    }

    /* Button styling */
    .btn-predict {
      background: linear-gradient(45deg, #f39c12, #e67e22) !important;
      border: none !important;
      transition: all 0.3s ease;
      position: relative;
      overflow: hidden;
      border-radius: 0.75rem !important;
      font-weight: 700 !important;
      font-size: 1.2rem !important;
      padding: 1rem 2rem !important;
      box-shadow: 0 4px 12px rgba(231, 111, 32, 0.3);
      color: white !important;
      width: 100%;
      margin-top: 1rem;
    }

    .btn-predict::before {
      content: '';
      position: absolute;
      top: 0;
      left: -100%;
      width: 100%;
      height: 100%;
      background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
      transition: left 0.5s;
      border-radius: 0.75rem;
    }

    .btn-predict:hover::before {
      left: 100%;
    }

    .btn-predict:hover {
      background: linear-gradient(45deg, #e67e22, #d68910) !important;
      box-shadow: 0 8px 25px rgba(231, 111, 32, 0.5);
      transform: translateY(-2px);
      color: white !important;
    }

    /* Time inputs row */
    .time-row {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 1rem;
    }

    /* Card hover */
    .main-card:hover {
      box-shadow: 0 20px 40px rgba(230, 126, 34, 0.25) !important;
      transform: translateY(-2px);
      transition: all 0.3s ease;
    }

    /* Prediction result styling */
    .prediction-result {
      animation: slideInUp 0.6s ease-out;
      border: none;
      background: linear-gradient(135deg, #e8f5e8, #d4edda);
      box-shadow: 0 4px 15px rgba(40, 167, 69, 0.2);
      border-radius: 0.75rem;
      padding: 1.5rem;
      margin-top: 1.5rem;
      color: #155724;
      font-weight: 600;
      font-size: 1.1rem;
      text-align: center;
      border-left: 4px solid #28a745;
    }

    @keyframes slideInUp {
      from {
        opacity: 0;
        transform: translateY(30px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    /* Form validation styles */
    .form-control.is-invalid, .form-select.is-invalid {
      border-color: #dc3545 !important;
      box-shadow: 0 0 8px rgba(220, 53, 69, 0.4) !important;
    }

    .invalid-feedback {
      display: block;
      color: #dc3545;
      font-size: 0.875rem;
      margin-top: 0.25rem;
      font-style: italic;
    }

    /* Responsive adjustments */
    @media (max-width: 768px) {
      .main-card {
        padding: 2rem 1.5rem;
        margin: 1rem;
      }
      
      .time-row {
        grid-template-columns: 1fr;
        gap: 1rem;
      }
      
      h1 {
        font-size: 1.8rem !important;
      }
    }

    @media (max-width: 480px) {
      .main-card {
        padding: 1.5rem 1rem;
      }
      
      .btn-predict {
        font-size: 1.1rem !important;
        padding: 0.875rem 1.5rem !important;
      }
    }
  </style>
</head>
<body>

  <main>
    <div class="card main-card shadow-lg animate__animated">
      <h1 class="text-center mb-4 text-3xl font-extrabold text-orange-600 animate__animated animate__bounceIn">
        ๐Ÿ› Indian Food Flavor Profile Prediction
      </h1>

      <form method="post" class="needs-validation" novalidate id="predictionForm">
        
        <!-- Ingredients -->
        <div class="form-group">
          <label for="ingredients" class="form-label">
            <span class="label-icon">๐ŸŒถ๏ธ</span>Ingredients
          </label>
          <textarea 
            id="ingredients" 
            name="ingredients" 
            rows="3" 
            required 
            placeholder="Enter ingredients separated by commas (e.g., cumin, coriander, ginger, turmeric)" 
            class="form-control"
          ></textarea>
          <div class="invalid-feedback">Please enter at least one ingredient.</div>
        </div>

        <!-- Diet -->
        <div class="form-group">
          <label for="diet" class="form-label">
            <span class="label-icon">๐Ÿฅฌ</span>Diet Type
          </label>
          <select id="diet" name="diet" required class="form-select">
            <option value="" disabled selected>Choose diet type</option>
            <option value="vegetarian">๐ŸŒฑ Vegetarian</option>
            <option value="non vegetarian">๐Ÿ– Non Vegetarian</option>
          </select>
          <div class="invalid-feedback">Please select a diet type.</div>
        </div>

        <!-- Course -->
        <div class="form-group">
          <label for="course" class="form-label">
            <span class="label-icon">๐Ÿฝ๏ธ</span>Course Type
          </label>
          <select id="course" name="course" required class="form-select">
            <option value="" disabled selected>Choose course type</option>
            <option value="starter">๐Ÿฅ— Starter</option>
            <option value="main course">๐Ÿ› Main Course</option>
            <option value="dessert">๐Ÿฎ Dessert</option>
            <option value="snack">๐Ÿฟ Snack</option>
          </select>
          <div class="invalid-feedback">Please select a course type.</div>
        </div>

        <!-- Region -->
        <div class="form-group">
          <label for="region" class="form-label">
            <span class="label-icon">๐Ÿ—บ๏ธ</span>Indian Region
          </label>
          <select id="region" name="region" required class="form-select">
            <option value="" disabled selected>Choose regional cuisine</option>
            <option value="North">๐Ÿ”๏ธ North Indian</option>
            <option value="South">๐Ÿ๏ธ South Indian</option>
            <option value="East">๐ŸŒ… East Indian</option>
            <option value="West">๐ŸŒŠ West Indian</option>
          </select>
          <div class="invalid-feedback">Please select a region.</div>
        </div>

        <!-- Prep & Cook Time -->
        <div class="time-row">
          <div class="form-group">
            <label for="prep_time" class="form-label">
              <span class="label-icon">โฑ๏ธ</span>Prep Time (minutes)
            </label>
            <input 
              id="prep_time" 
              type="number" 
              name="prep_time" 
              min="0" 
              max="300"
              required 
              placeholder="e.g., 15" 
              class="form-control" 
            />
            <div class="invalid-feedback">Enter preparation time (0-300 minutes).</div>
          </div>
          
          <div class="form-group">
            <label for="cook_time" class="form-label">
              <span class="label-icon">๐Ÿ”ฅ</span>Cook Time (minutes)
            </label>
            <input 
              id="cook_time" 
              type="number" 
              name="cook_time" 
              min="0" 
              max="600"
              required 
              placeholder="e.g., 30" 
              class="form-control" 
            />
            <div class="invalid-feedback">Enter cooking time (0-600 minutes).</div>
          </div>
        </div>

        <button type="submit" class="btn btn-predict shadow-sm" id="submitBtn">
          โœจ Predict Flavor Profile
        </button>
      </form>

      {% if prediction %}
      <div class="prediction-result">
        ๐ŸŽฏ Predicted Flavor Profile: <strong>{{ prediction }}</strong>
      </div>
      {% endif %}

      <!-- Colab Link Section -->
      <div class="text-center mt-4">
        <a 
          href="https://colab.research.google.com/drive/1hpU2sx-U63uelHoa23nobW7nUQ-_ZgCW?usp=sharing" 
          target="_blank" 
          class="btn btn-outline-primary btn-sm px-3 py-2"
          style="border-radius: 0.5rem; font-weight: 500; text-decoration: none; border: 2px solid #007bff; color: #007bff; transition: all 0.3s ease;"
          onmouseover="this.style.backgroundColor='#007bff'; this.style.color='white'; this.style.transform='translateY(-1px)';"
          onmouseout="this.style.backgroundColor='transparent'; this.style.color='#007bff'; this.style.transform='translateY(0)';"
        >
          ๐Ÿ“Š View Colab Notebook
        </a>
         <br>
        <br>
      </div>
    </div>

    <!-- Footer -->
    <footer class="text-center mt-4" style="position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); color: #8b4513; font-size: 0.9rem; font-weight: 500;">
      ยฉ 2025 NIELIT - ROPAR
    </footer>
  </main>

  <!-- Bootstrap JS Bundle -->
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.4.1/dist/js/bootstrap.bundle.min.js"></script>
  
  <script>
    // Bootstrap form validation
    (() => {
      'use strict';
      const forms = document.querySelectorAll('.needs-validation');
      Array.from(forms).forEach(form => {
        form.addEventListener('submit', event => {
          if (!form.checkValidity()) {
            event.preventDefault();
            event.stopPropagation();
          } else {
            // Add loading state to button
            const btn = document.getElementById('submitBtn');
            btn.disabled = true;
            btn.innerHTML = '<span class="spinner-border spinner-border-sm me-2" role="status"></span>๐Ÿ”ฎ Analyzing flavors...';
            btn.classList.add('animate__animated', 'animate__pulse');
          }
          form.classList.add('was-validated');
        }, false);
      });
    })();

    // Add some interactive feedback
    document.querySelectorAll('.form-control, .form-select').forEach(input => {
      input.addEventListener('focus', function() {
        this.parentElement.style.transform = 'scale(1.01)';
        this.parentElement.style.transition = 'transform 0.2s ease';
      });
      
      input.addEventListener('blur', function() {
        this.parentElement.style.transform = 'scale(1)';
      });
    });
  </script>
</body>
</html>