Spaces:
Sleeping
Sleeping
Update templates/index.html
Browse files- templates/index.html +212 -29
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" />
|
|
@@ -9,19 +9,78 @@
|
|
| 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 |
-
/*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
}
|
| 26 |
|
| 27 |
/* Placeholder styling */
|
|
@@ -30,48 +89,144 @@
|
|
| 30 |
opacity: 0.7;
|
| 31 |
}
|
| 32 |
|
| 33 |
-
/*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
.btn-warning:hover {
|
| 35 |
-
background
|
| 36 |
-
box-shadow: 0
|
|
|
|
| 37 |
}
|
| 38 |
|
| 39 |
-
/* Card
|
| 40 |
.card:hover {
|
| 41 |
-
box-shadow: 0
|
| 42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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
|
| 50 |
-
<h1 class="text-center text-4xl font-extrabold
|
|
|
|
|
|
|
| 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">
|
|
|
|
|
|
|
| 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">
|
|
|
|
|
|
|
| 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">
|
|
|
|
|
|
|
| 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>
|
|
@@ -79,12 +234,15 @@
|
|
| 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">
|
|
|
|
|
|
|
| 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>
|
|
@@ -92,29 +250,42 @@
|
|
| 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">
|
| 102 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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">
|
| 107 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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"
|
|
|
|
|
|
|
| 113 |
</form>
|
| 114 |
|
| 115 |
{% if prediction %}
|
| 116 |
-
<div class="mt-
|
| 117 |
-
Predicted Flavor Profile: {{ prediction }}
|
| 118 |
</div>
|
| 119 |
{% endif %}
|
| 120 |
</div>
|
|
@@ -133,11 +304,23 @@
|
|
| 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>
|
|
|
|
| 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" />
|
|
|
|
| 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 |
+
<!-- Font Awesome for Icons -->
|
| 13 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" />
|
| 14 |
+
<!-- Animate.css for Animations -->
|
| 15 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css" />
|
| 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;
|
| 28 |
+
top: 0;
|
| 29 |
+
left: 0;
|
| 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 {
|
| 56 |
+
from {
|
| 57 |
+
opacity: 0;
|
| 58 |
+
transform: translateY(30px);
|
| 59 |
+
}
|
| 60 |
+
to {
|
| 61 |
+
opacity: 1;
|
| 62 |
+
transform: translateY(0);
|
| 63 |
+
}
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
/* Smooth input focus ring with scale */
|
| 67 |
input:focus, select:focus, textarea:focus {
|
| 68 |
outline: none !important;
|
| 69 |
+
box-shadow: 0 0 8px rgba(230, 126, 34, 0.6), 0 0 0 0.2rem rgba(230, 126, 34, 0.25) !important;
|
| 70 |
border-color: #e67e22 !important;
|
| 71 |
+
transform: scale(1.02);
|
| 72 |
+
transition: all 0.3s ease;
|
| 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 |
+
|
| 80 |
+
@keyframes shake {
|
| 81 |
+
0%, 100% { transform: translateX(0); }
|
| 82 |
+
25% { transform: translateX(-5px); }
|
| 83 |
+
75% { transform: translateX(5px); }
|
| 84 |
}
|
| 85 |
|
| 86 |
/* Placeholder styling */
|
|
|
|
| 89 |
opacity: 0.7;
|
| 90 |
}
|
| 91 |
|
| 92 |
+
/* Enhanced button hover with pulse */
|
| 93 |
+
.btn-warning {
|
| 94 |
+
background: linear-gradient(45deg, #f39c12, #e67e22);
|
| 95 |
+
border: none;
|
| 96 |
+
transition: all 0.3s ease;
|
| 97 |
+
position: relative;
|
| 98 |
+
overflow: hidden;
|
| 99 |
+
}
|
| 100 |
+
|
| 101 |
+
.btn-warning::before {
|
| 102 |
+
content: '';
|
| 103 |
+
position: absolute;
|
| 104 |
+
top: 0;
|
| 105 |
+
left: -100%;
|
| 106 |
+
width: 100%;
|
| 107 |
+
height: 100%;
|
| 108 |
+
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
|
| 109 |
+
transition: left 0.5s;
|
| 110 |
+
}
|
| 111 |
+
|
| 112 |
+
.btn-warning:hover::before {
|
| 113 |
+
left: 100%;
|
| 114 |
+
}
|
| 115 |
+
|
| 116 |
.btn-warning:hover {
|
| 117 |
+
background: linear-gradient(45deg, #e67e22, #d68910) !important;
|
| 118 |
+
box-shadow: 0 8px 25px rgba(231, 111, 32, 0.4);
|
| 119 |
+
transform: translateY(-2px);
|
| 120 |
}
|
| 121 |
|
| 122 |
+
/* Card hover enhancement */
|
| 123 |
.card:hover {
|
| 124 |
+
box-shadow: 0 20px 40px rgba(230, 126, 34, 0.25) !important;
|
| 125 |
+
transform: translateY(-5px);
|
| 126 |
+
transition: all 0.3s ease;
|
| 127 |
+
}
|
| 128 |
+
|
| 129 |
+
/* Prediction slide-in animation */
|
| 130 |
+
.prediction-result {
|
| 131 |
+
animation: slideInRight 0.6s ease-out;
|
| 132 |
+
border: none;
|
| 133 |
+
background: linear-gradient(135deg, #fff8f0, #ffe8cc);
|
| 134 |
+
box-shadow: 0 4px 15px rgba(230, 126, 34, 0.1);
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
@keyframes slideInRight {
|
| 138 |
+
from {
|
| 139 |
+
opacity: 0;
|
| 140 |
+
transform: translateX(100%);
|
| 141 |
+
}
|
| 142 |
+
to {
|
| 143 |
+
opacity: 1;
|
| 144 |
+
transform: translateX(0);
|
| 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 */
|
| 168 |
+
.btn-loading {
|
| 169 |
+
pointer-events: none;
|
| 170 |
+
opacity: 0.7;
|
| 171 |
+
}
|
| 172 |
+
|
| 173 |
+
.spinner-border-sm {
|
| 174 |
+
width: 1rem;
|
| 175 |
+
height: 1rem;
|
| 176 |
+
}
|
| 177 |
+
|
| 178 |
+
/* Responsive adjustments */
|
| 179 |
+
@media (max-width: 576px) {
|
| 180 |
+
.card {
|
| 181 |
+
margin: 10px;
|
| 182 |
+
padding: 20px !important;
|
| 183 |
+
}
|
| 184 |
+
|
| 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>
|
| 198 |
|
| 199 |
+
<form method="post" class="needs-validation" novalidate id="predictionForm">
|
| 200 |
|
| 201 |
<!-- Ingredients -->
|
| 202 |
+
<div class="mb-4 input-group">
|
| 203 |
+
<label for="ingredients" class="form-label fw-semibold fs-6 text-secondary">
|
| 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 |
|
| 211 |
<!-- Diet -->
|
| 212 |
+
<div class="mb-4 input-group">
|
| 213 |
+
<label for="diet" class="form-label fw-semibold fs-6 text-secondary">
|
| 214 |
+
<i class="fas fa-leaf me-1"></i>Diet:
|
| 215 |
+
</label>
|
| 216 |
<select id="diet" name="diet" required class="form-select rounded-3 border-2 border-warning">
|
| 217 |
<option value="" disabled selected>Select diet</option>
|
| 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 |
|
| 225 |
<!-- Course -->
|
| 226 |
+
<div class="mb-4 input-group">
|
| 227 |
+
<label for="course" class="form-label fw-semibold fs-6 text-secondary">
|
| 228 |
+
<i class="fas fa-drumstick-bite me-1"></i>Course:
|
| 229 |
+
</label>
|
| 230 |
<select id="course" name="course" required class="form-select rounded-3 border-2 border-warning">
|
| 231 |
<option value="" disabled selected>Select course</option>
|
| 232 |
<option value="dessert">Dessert</option>
|
|
|
|
| 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 |
|
| 241 |
<!-- Region -->
|
| 242 |
+
<div class="mb-4 input-group">
|
| 243 |
+
<label for="region" class="form-label fw-semibold fs-6 text-secondary">
|
| 244 |
+
<i class="fas fa-map-marker-alt me-1"></i>Region:
|
| 245 |
+
</label>
|
| 246 |
<select id="region" name="region" required class="form-select rounded-3 border-2 border-warning">
|
| 247 |
<option value="" disabled selected>Select region</option>
|
| 248 |
<option value="East">East</option>
|
|
|
|
| 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 |
|
| 257 |
<!-- Prep & Cook Time -->
|
| 258 |
<div class="row mb-4 g-3">
|
| 259 |
<div class="col-6">
|
| 260 |
+
<label for="prep_time" class="form-label fw-semibold fs-6 text-secondary">
|
| 261 |
+
<i class="fas fa-clock me-1"></i>Preparation Time (minutes):
|
| 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>
|
| 269 |
<div class="col-6">
|
| 270 |
+
<label for="cook_time" class="form-label fw-semibold fs-6 text-secondary">
|
| 271 |
+
<i class="fas fa-fire me-1"></i>Cook Time (minutes):
|
| 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>
|
| 279 |
</div>
|
| 280 |
|
| 281 |
+
<button type="submit" class="btn btn-warning w-100 py-3 fs-5 fw-bold shadow-sm mb-3" id="submitBtn">
|
| 282 |
+
<i class="fas fa-magic me-2"></i>Predict Flavor Profile
|
| 283 |
+
</button>
|
| 284 |
</form>
|
| 285 |
|
| 286 |
{% if prediction %}
|
| 287 |
+
<div class="prediction-result mt-4 p-4 rounded-3 bg-gradient text-warning fs-5 text-center shadow-sm fw-semibold border-0">
|
| 288 |
+
<i class="fas fa-star-and-crescent me-2"></i>Predicted Flavor Profile: {{ prediction }}
|
| 289 |
</div>
|
| 290 |
{% endif %}
|
| 291 |
</div>
|
|
|
|
| 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>
|