Spaces:
Sleeping
Sleeping
Update templates/index.html
Browse files- templates/index.html +115 -107
templates/index.html
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
-
<html lang="en">
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8" />
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
@@ -7,129 +7,137 @@
|
|
| 7 |
|
| 8 |
<!-- Bootstrap CSS -->
|
| 9 |
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.4.1/dist/css/bootstrap.min.css" rel="stylesheet" />
|
| 10 |
-
<!-- Tailwind CSS CDN
|
| 11 |
<script src="https://cdn.tailwindcss.com"></script>
|
| 12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
</head>
|
| 14 |
-
<body
|
| 15 |
|
| 16 |
-
<
|
| 17 |
-
<
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
<
|
| 24 |
-
|
| 25 |
-
id="ingredients"
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
<select id="diet" name="diet" required class="form-select rounded-md border-orange-400 focus:ring-orange-300 focus:border-orange-500">
|
| 39 |
-
<option value="" disabled selected>Select diet</option>
|
| 40 |
-
<option value="vegetarian">Vegetarian</option>
|
| 41 |
-
<option value="non vegetarian">Non Vegetarian</option>
|
| 42 |
-
</select>
|
| 43 |
-
<div class="invalid-feedback">Please select a diet.</div>
|
| 44 |
-
</div>
|
| 45 |
-
|
| 46 |
-
<!-- Course -->
|
| 47 |
-
<div class="mb-4">
|
| 48 |
-
<label for="course" class="form-label fw-semibold text-gray-700">Course:</label>
|
| 49 |
-
<select id="course" name="course" required class="form-select rounded-md border-orange-400 focus:ring-orange-300 focus:border-orange-500">
|
| 50 |
-
<option value="" disabled selected>Select course</option>
|
| 51 |
-
<option value="dessert">Dessert</option>
|
| 52 |
-
<option value="main course">Main Course</option>
|
| 53 |
-
<option value="starter">Starter</option>
|
| 54 |
-
<option value="snack">Snack</option>
|
| 55 |
-
</select>
|
| 56 |
-
<div class="invalid-feedback">Please select a course.</div>
|
| 57 |
-
</div>
|
| 58 |
-
|
| 59 |
-
<!-- Region -->
|
| 60 |
-
<div class="mb-4">
|
| 61 |
-
<label for="region" class="form-label fw-semibold text-gray-700">Region:</label>
|
| 62 |
-
<select id="region" name="region" required class="form-select rounded-md border-orange-400 focus:ring-orange-300 focus:border-orange-500">
|
| 63 |
-
<option value="" disabled selected>Select region</option>
|
| 64 |
-
<option value="East">East</option>
|
| 65 |
-
<option value="West">West</option>
|
| 66 |
-
<option value="North">North</option>
|
| 67 |
-
<option value="South">South</option>
|
| 68 |
-
</select>
|
| 69 |
-
<div class="invalid-feedback">Please select a region.</div>
|
| 70 |
-
</div>
|
| 71 |
-
|
| 72 |
-
<!-- Prep & Cook Time in Bootstrap Grid -->
|
| 73 |
-
<div class="row mb-4 g-3">
|
| 74 |
-
<div class="col-6">
|
| 75 |
-
<label for="prep_time" class="form-label fw-semibold text-gray-700">Preparation Time (minutes):</label>
|
| 76 |
-
<input
|
| 77 |
-
type="number"
|
| 78 |
-
min="0"
|
| 79 |
-
id="prep_time"
|
| 80 |
-
name="prep_time"
|
| 81 |
-
required
|
| 82 |
-
placeholder="e.g., 15"
|
| 83 |
-
class="form-control rounded-md border-orange-400 focus:ring-orange-300 focus:border-orange-500" />
|
| 84 |
-
<div class="invalid-feedback">Please enter preparation time.</div>
|
| 85 |
</div>
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
</div>
|
| 98 |
-
</div>
|
| 99 |
-
|
| 100 |
-
<button
|
| 101 |
-
type="submit"
|
| 102 |
-
class="w-full btn btn-lg btn-warning text-white font-bold hover:bg-orange-600 transition"
|
| 103 |
-
>
|
| 104 |
-
Predict Flavor Profile
|
| 105 |
-
</button>
|
| 106 |
-
</form>
|
| 107 |
|
| 108 |
-
|
| 109 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 110 |
Predicted Flavor Profile: {{ prediction }}
|
| 111 |
</div>
|
| 112 |
-
|
| 113 |
-
|
|
|
|
| 114 |
|
| 115 |
-
<!-- Bootstrap JS
|
| 116 |
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.4.1/dist/js/bootstrap.bundle.min.js"></script>
|
|
|
|
| 117 |
<script>
|
| 118 |
-
//
|
| 119 |
(() => {
|
| 120 |
-
'use strict'
|
| 121 |
-
const forms = document.querySelectorAll('.needs-validation')
|
| 122 |
Array.from(forms).forEach(form => {
|
| 123 |
form.addEventListener('submit', event => {
|
| 124 |
if (!form.checkValidity()) {
|
| 125 |
-
event.preventDefault()
|
| 126 |
-
event.stopPropagation()
|
| 127 |
}
|
| 128 |
-
form.classList.add('was-validated')
|
| 129 |
-
}, false)
|
| 130 |
-
})
|
| 131 |
-
})()
|
| 132 |
</script>
|
| 133 |
-
|
| 134 |
</body>
|
| 135 |
</html>
|
|
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
+
<html lang="en" >
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8" />
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
|
|
| 7 |
|
| 8 |
<!-- Bootstrap CSS -->
|
| 9 |
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.4.1/dist/css/bootstrap.min.css" rel="stylesheet" />
|
| 10 |
+
<!-- Tailwind CSS CDN -->
|
| 11 |
<script src="https://cdn.tailwindcss.com"></script>
|
| 12 |
|
| 13 |
+
<style>
|
| 14 |
+
body {
|
| 15 |
+
background: linear-gradient(135deg, #fff8f0, #ffe8cc);
|
| 16 |
+
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
/* Smooth input focus ring */
|
| 20 |
+
input:focus, select:focus, textarea:focus {
|
| 21 |
+
outline: none !important;
|
| 22 |
+
box-shadow: 0 0 8px rgba(230, 126, 34, 0.6);
|
| 23 |
+
border-color: #e67e22 !important;
|
| 24 |
+
transition: box-shadow 0.3s ease;
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
/* Placeholder styling */
|
| 28 |
+
::placeholder {
|
| 29 |
+
color: #d35400;
|
| 30 |
+
opacity: 0.7;
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
/* Button hover transition */
|
| 34 |
+
.btn-warning:hover {
|
| 35 |
+
background-color: #e76f20 !important;
|
| 36 |
+
box-shadow: 0 4px 15px rgba(231, 111, 32, 0.5);
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
/* Card shadow on hover */
|
| 40 |
+
.card:hover {
|
| 41 |
+
box-shadow: 0 15px 30px rgba(230, 126, 34, 0.2);
|
| 42 |
+
transition: box-shadow 0.3s ease;
|
| 43 |
+
}
|
| 44 |
+
</style>
|
| 45 |
</head>
|
| 46 |
+
<body>
|
| 47 |
|
| 48 |
+
<main class="min-vh-100 d-flex align-items-center justify-content-center p-4">
|
| 49 |
+
<div class="card shadow rounded-4 p-5 w-100" style="max-width: 540px; background:#fff9f1;">
|
| 50 |
+
<h1 class="text-center text-4xl font-extrabold mb-5 text-orange-600">Indian Food Flavor Profile Prediction</h1>
|
| 51 |
+
|
| 52 |
+
<form method="post" class="needs-validation" novalidate>
|
| 53 |
+
|
| 54 |
+
<!-- Ingredients -->
|
| 55 |
+
<div class="mb-4">
|
| 56 |
+
<label for="ingredients" class="form-label fw-semibold fs-6 text-secondary">Ingredients (comma separated):</label>
|
| 57 |
+
<textarea id="ingredients" name="ingredients" rows="3" required placeholder="e.g., cumin, coriander, ginger" class="form-control rounded-3 border-2 border-warning"></textarea>
|
| 58 |
+
<div class="invalid-feedback">Please enter ingredients.</div>
|
| 59 |
+
</div>
|
| 60 |
+
|
| 61 |
+
<!-- Diet -->
|
| 62 |
+
<div class="mb-4">
|
| 63 |
+
<label for="diet" class="form-label fw-semibold fs-6 text-secondary">Diet:</label>
|
| 64 |
+
<select id="diet" name="diet" required class="form-select rounded-3 border-2 border-warning">
|
| 65 |
+
<option value="" disabled selected>Select diet</option>
|
| 66 |
+
<option value="vegetarian">Vegetarian</option>
|
| 67 |
+
<option value="non vegetarian">Non Vegetarian</option>
|
| 68 |
+
</select>
|
| 69 |
+
<div class="invalid-feedback">Please select a diet.</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
</div>
|
| 71 |
+
|
| 72 |
+
<!-- Course -->
|
| 73 |
+
<div class="mb-4">
|
| 74 |
+
<label for="course" class="form-label fw-semibold fs-6 text-secondary">Course:</label>
|
| 75 |
+
<select id="course" name="course" required class="form-select rounded-3 border-2 border-warning">
|
| 76 |
+
<option value="" disabled selected>Select course</option>
|
| 77 |
+
<option value="dessert">Dessert</option>
|
| 78 |
+
<option value="main course">Main Course</option>
|
| 79 |
+
<option value="starter">Starter</option>
|
| 80 |
+
<option value="snack">Snack</option>
|
| 81 |
+
</select>
|
| 82 |
+
<div class="invalid-feedback">Please select a course.</div>
|
| 83 |
+
</div>
|
| 84 |
+
|
| 85 |
+
<!-- Region -->
|
| 86 |
+
<div class="mb-4">
|
| 87 |
+
<label for="region" class="form-label fw-semibold fs-6 text-secondary">Region:</label>
|
| 88 |
+
<select id="region" name="region" required class="form-select rounded-3 border-2 border-warning">
|
| 89 |
+
<option value="" disabled selected>Select region</option>
|
| 90 |
+
<option value="East">East</option>
|
| 91 |
+
<option value="West">West</option>
|
| 92 |
+
<option value="North">North</option>
|
| 93 |
+
<option value="South">South</option>
|
| 94 |
+
</select>
|
| 95 |
+
<div class="invalid-feedback">Please select a region.</div>
|
| 96 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
|
| 98 |
+
<!-- Prep & Cook Time -->
|
| 99 |
+
<div class="row mb-4 g-3">
|
| 100 |
+
<div class="col-6">
|
| 101 |
+
<label for="prep_time" class="form-label fw-semibold fs-6 text-secondary">Preparation Time (minutes):</label>
|
| 102 |
+
<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" />
|
| 103 |
+
<div class="invalid-feedback">Please enter preparation time.</div>
|
| 104 |
+
</div>
|
| 105 |
+
<div class="col-6">
|
| 106 |
+
<label for="cook_time" class="form-label fw-semibold fs-6 text-secondary">Cook Time (minutes):</label>
|
| 107 |
+
<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" />
|
| 108 |
+
<div class="invalid-feedback">Please enter cook time.</div>
|
| 109 |
+
</div>
|
| 110 |
+
</div>
|
| 111 |
+
|
| 112 |
+
<button type="submit" class="btn btn-warning w-100 py-3 fs-5 fw-bold shadow-sm">Predict Flavor Profile</button>
|
| 113 |
+
</form>
|
| 114 |
+
|
| 115 |
+
{% if prediction %}
|
| 116 |
+
<div class="mt-5 p-4 rounded-3 bg-orange-50 border-l-4 border-warning text-warning fs-5 text-center shadow-sm fw-semibold">
|
| 117 |
Predicted Flavor Profile: {{ prediction }}
|
| 118 |
</div>
|
| 119 |
+
{% endif %}
|
| 120 |
+
</div>
|
| 121 |
+
</main>
|
| 122 |
|
| 123 |
+
<!-- Bootstrap JS Bundle -->
|
| 124 |
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.4.1/dist/js/bootstrap.bundle.min.js"></script>
|
| 125 |
+
|
| 126 |
<script>
|
| 127 |
+
// Bootstrap form validation
|
| 128 |
(() => {
|
| 129 |
+
'use strict';
|
| 130 |
+
const forms = document.querySelectorAll('.needs-validation');
|
| 131 |
Array.from(forms).forEach(form => {
|
| 132 |
form.addEventListener('submit', event => {
|
| 133 |
if (!form.checkValidity()) {
|
| 134 |
+
event.preventDefault();
|
| 135 |
+
event.stopPropagation();
|
| 136 |
}
|
| 137 |
+
form.classList.add('was-validated');
|
| 138 |
+
}, false);
|
| 139 |
+
});
|
| 140 |
+
})();
|
| 141 |
</script>
|
|
|
|
| 142 |
</body>
|
| 143 |
</html>
|