Update app.py
Browse files
app.py
CHANGED
|
@@ -127,17 +127,20 @@ def process_recipe_request(api_key, files, num_recipes, dietary_restrictions, cu
|
|
| 127 |
|
| 128 |
custom_css = """
|
| 129 |
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');
|
|
|
|
| 130 |
:root {
|
| 131 |
-
--primary-color: #
|
| 132 |
-
--
|
| 133 |
-
--
|
| 134 |
-
--
|
| 135 |
-
--
|
| 136 |
-
--
|
| 137 |
-
--
|
| 138 |
-
--border-radius: 10px;
|
| 139 |
--font-family: 'Poppins', sans-serif;
|
|
|
|
|
|
|
| 140 |
}
|
|
|
|
| 141 |
body {
|
| 142 |
font-family: var(--font-family);
|
| 143 |
background-color: var(--background-color);
|
|
@@ -145,84 +148,95 @@ body {
|
|
| 145 |
margin: 0;
|
| 146 |
padding: 0;
|
| 147 |
}
|
|
|
|
| 148 |
.container {
|
| 149 |
max-width: 1200px;
|
| 150 |
margin: 0 auto;
|
| 151 |
padding: 20px;
|
| 152 |
}
|
|
|
|
| 153 |
.app-header {
|
| 154 |
background-color: var(--primary-color);
|
| 155 |
color: white;
|
| 156 |
-
padding:
|
| 157 |
text-align: center;
|
| 158 |
-
border-radius: 0 0
|
| 159 |
-
box-shadow:
|
| 160 |
}
|
|
|
|
| 161 |
.app-title {
|
| 162 |
-
font-size: 2.
|
| 163 |
-
margin-bottom: 10px;
|
| 164 |
font-weight: 700;
|
|
|
|
| 165 |
}
|
|
|
|
| 166 |
.app-subtitle {
|
| 167 |
-
font-size: 1.
|
| 168 |
font-weight: 300;
|
| 169 |
-
max-width:
|
| 170 |
margin: 0 auto;
|
| 171 |
}
|
|
|
|
| 172 |
.input-section, .output-section {
|
| 173 |
background-color: var(--card-background);
|
| 174 |
border-radius: var(--border-radius);
|
| 175 |
padding: 30px;
|
| 176 |
-
box-shadow:
|
| 177 |
margin-bottom: 30px;
|
| 178 |
}
|
|
|
|
| 179 |
.section-header {
|
| 180 |
-
font-size: 1.
|
| 181 |
font-weight: 600;
|
| 182 |
color: var(--text-color);
|
| 183 |
margin-bottom: 20px;
|
| 184 |
border-bottom: 2px solid var(--primary-color);
|
| 185 |
padding-bottom: 10px;
|
| 186 |
}
|
|
|
|
| 187 |
.image-upload-container {
|
| 188 |
border: 2px dashed var(--secondary-color);
|
| 189 |
border-radius: var(--border-radius);
|
| 190 |
padding: 40px;
|
| 191 |
text-align: center;
|
| 192 |
-
background-color: rgba(
|
| 193 |
transition: all 0.3s ease;
|
| 194 |
}
|
|
|
|
| 195 |
.image-upload-container:hover {
|
| 196 |
border-color: var(--primary-color);
|
| 197 |
-
background-color: rgba(
|
| 198 |
}
|
|
|
|
| 199 |
button.primary-button {
|
| 200 |
background-color: var(--primary-color);
|
| 201 |
color: white;
|
| 202 |
border: none;
|
| 203 |
-
padding:
|
| 204 |
-
border-radius:
|
| 205 |
font-size: 1.1em;
|
| 206 |
cursor: pointer;
|
| 207 |
transition: all 0.3s ease;
|
| 208 |
-
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
|
| 209 |
width: 100%;
|
|
|
|
| 210 |
}
|
|
|
|
| 211 |
button.primary-button:hover {
|
| 212 |
-
background-color:
|
| 213 |
-
box-shadow:
|
| 214 |
}
|
|
|
|
| 215 |
.gallery-container {
|
| 216 |
display: grid;
|
| 217 |
-
grid-template-columns: repeat(auto-fill, minmax(
|
| 218 |
gap: 20px;
|
| 219 |
-
margin-top:
|
| 220 |
}
|
| 221 |
|
| 222 |
.gallery-item {
|
| 223 |
border-radius: var(--border-radius);
|
| 224 |
overflow: hidden;
|
| 225 |
-
box-shadow: var(--
|
| 226 |
transition: transform 0.3s ease;
|
| 227 |
aspect-ratio: 1 / 1;
|
| 228 |
object-fit: cover;
|
|
@@ -232,24 +246,28 @@ button.primary-button:hover {
|
|
| 232 |
transform: scale(1.05);
|
| 233 |
box-shadow: var(--hover-shadow);
|
| 234 |
}
|
|
|
|
| 235 |
.recipe-output {
|
| 236 |
-
font-size: 1.
|
| 237 |
-
line-height: 1.
|
| 238 |
color: var(--text-color);
|
| 239 |
max-height: 600px;
|
| 240 |
overflow-y: auto;
|
| 241 |
-
padding-right:
|
| 242 |
}
|
|
|
|
| 243 |
.recipe-output h2 {
|
| 244 |
color: var(--primary-color);
|
| 245 |
margin-top: 30px;
|
| 246 |
-
font-size:
|
| 247 |
}
|
|
|
|
| 248 |
.recipe-output h3 {
|
| 249 |
color: var(--secondary-color);
|
| 250 |
-
font-size: 1.
|
| 251 |
margin-top: 20px;
|
| 252 |
}
|
|
|
|
| 253 |
.loading-container {
|
| 254 |
display: flex;
|
| 255 |
flex-direction: column;
|
|
@@ -266,10 +284,12 @@ button.primary-button:hover {
|
|
| 266 |
visibility: hidden;
|
| 267 |
transition: opacity 0.3s ease, visibility 0.3s ease;
|
| 268 |
}
|
|
|
|
| 269 |
.loading-container.visible {
|
| 270 |
opacity: 1;
|
| 271 |
visibility: visible;
|
| 272 |
}
|
|
|
|
| 273 |
.loading-spinner {
|
| 274 |
border: 8px solid #f3f3f3;
|
| 275 |
border-top: 8px solid var(--primary-color);
|
|
@@ -278,37 +298,44 @@ button.primary-button:hover {
|
|
| 278 |
height: 60px;
|
| 279 |
animation: spin 1s linear infinite;
|
| 280 |
}
|
|
|
|
| 281 |
@keyframes spin {
|
| 282 |
0% { transform: rotate(0deg); }
|
| 283 |
100% { transform: rotate(360deg); }
|
| 284 |
}
|
|
|
|
| 285 |
.loading-text {
|
| 286 |
color: white;
|
| 287 |
-
font-size: 1.
|
| 288 |
margin-top: 20px;
|
| 289 |
}
|
|
|
|
| 290 |
.footer {
|
| 291 |
background-color: var(--card-background);
|
| 292 |
padding: 40px 20px;
|
| 293 |
text-align: center;
|
| 294 |
color: var(--text-color);
|
| 295 |
-
font-size: 1em;
|
| 296 |
-
box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
|
| 297 |
}
|
|
|
|
| 298 |
.footer-content {
|
| 299 |
max-width: 800px;
|
| 300 |
margin: 0 auto;
|
| 301 |
}
|
|
|
|
| 302 |
.footer-brand {
|
| 303 |
font-weight: 700;
|
| 304 |
color: var(--primary-color);
|
| 305 |
}
|
|
|
|
| 306 |
.footer-links a {
|
| 307 |
color: var(--secondary-color);
|
| 308 |
text-decoration: none;
|
| 309 |
margin: 0 15px;
|
| 310 |
transition: color 0.3s ease;
|
| 311 |
}
|
|
|
|
| 312 |
.footer-links a:hover {
|
| 313 |
color: var(--primary-color);
|
| 314 |
}
|
|
|
|
| 127 |
|
| 128 |
custom_css = """
|
| 129 |
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');
|
| 130 |
+
|
| 131 |
:root {
|
| 132 |
+
--primary-color: #FF6F61; /* Warm coral */
|
| 133 |
+
--secondary-color: #4BB543; /* Fresh green */
|
| 134 |
+
--accent-color: #F0A500; /* Golden yellow */
|
| 135 |
+
--background-color: #F4F4F9; /* Light grayish background */
|
| 136 |
+
--text-color: #333333; /* Dark gray text */
|
| 137 |
+
--card-background: #FFFFFF; /* White for cards */
|
| 138 |
+
--border-radius: 12px;
|
|
|
|
| 139 |
--font-family: 'Poppins', sans-serif;
|
| 140 |
+
--box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 20px;
|
| 141 |
+
--hover-shadow: rgba(0, 0, 0, 0.15) 0px 8px 30px;
|
| 142 |
}
|
| 143 |
+
|
| 144 |
body {
|
| 145 |
font-family: var(--font-family);
|
| 146 |
background-color: var(--background-color);
|
|
|
|
| 148 |
margin: 0;
|
| 149 |
padding: 0;
|
| 150 |
}
|
| 151 |
+
|
| 152 |
.container {
|
| 153 |
max-width: 1200px;
|
| 154 |
margin: 0 auto;
|
| 155 |
padding: 20px;
|
| 156 |
}
|
| 157 |
+
|
| 158 |
.app-header {
|
| 159 |
background-color: var(--primary-color);
|
| 160 |
color: white;
|
| 161 |
+
padding: 60px 20px;
|
| 162 |
text-align: center;
|
| 163 |
+
border-radius: 0 0 30px 30px;
|
| 164 |
+
box-shadow: var(--box-shadow);
|
| 165 |
}
|
| 166 |
+
|
| 167 |
.app-title {
|
| 168 |
+
font-size: 2.8em;
|
|
|
|
| 169 |
font-weight: 700;
|
| 170 |
+
margin-bottom: 10px;
|
| 171 |
}
|
| 172 |
+
|
| 173 |
.app-subtitle {
|
| 174 |
+
font-size: 1.3em;
|
| 175 |
font-weight: 300;
|
| 176 |
+
max-width: 800px;
|
| 177 |
margin: 0 auto;
|
| 178 |
}
|
| 179 |
+
|
| 180 |
.input-section, .output-section {
|
| 181 |
background-color: var(--card-background);
|
| 182 |
border-radius: var(--border-radius);
|
| 183 |
padding: 30px;
|
| 184 |
+
box-shadow: var(--box-shadow);
|
| 185 |
margin-bottom: 30px;
|
| 186 |
}
|
| 187 |
+
|
| 188 |
.section-header {
|
| 189 |
+
font-size: 1.6em;
|
| 190 |
font-weight: 600;
|
| 191 |
color: var(--text-color);
|
| 192 |
margin-bottom: 20px;
|
| 193 |
border-bottom: 2px solid var(--primary-color);
|
| 194 |
padding-bottom: 10px;
|
| 195 |
}
|
| 196 |
+
|
| 197 |
.image-upload-container {
|
| 198 |
border: 2px dashed var(--secondary-color);
|
| 199 |
border-radius: var(--border-radius);
|
| 200 |
padding: 40px;
|
| 201 |
text-align: center;
|
| 202 |
+
background-color: rgba(75, 181, 67, 0.1);
|
| 203 |
transition: all 0.3s ease;
|
| 204 |
}
|
| 205 |
+
|
| 206 |
.image-upload-container:hover {
|
| 207 |
border-color: var(--primary-color);
|
| 208 |
+
background-color: rgba(255, 111, 97, 0.1);
|
| 209 |
}
|
| 210 |
+
|
| 211 |
button.primary-button {
|
| 212 |
background-color: var(--primary-color);
|
| 213 |
color: white;
|
| 214 |
border: none;
|
| 215 |
+
padding: 16px 32px;
|
| 216 |
+
border-radius: 6px;
|
| 217 |
font-size: 1.1em;
|
| 218 |
cursor: pointer;
|
| 219 |
transition: all 0.3s ease;
|
|
|
|
| 220 |
width: 100%;
|
| 221 |
+
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
| 222 |
}
|
| 223 |
+
|
| 224 |
button.primary-button:hover {
|
| 225 |
+
background-color: #E15F52;
|
| 226 |
+
box-shadow: var(--hover-shadow);
|
| 227 |
}
|
| 228 |
+
|
| 229 |
.gallery-container {
|
| 230 |
display: grid;
|
| 231 |
+
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
|
| 232 |
gap: 20px;
|
| 233 |
+
margin-top: 30px;
|
| 234 |
}
|
| 235 |
|
| 236 |
.gallery-item {
|
| 237 |
border-radius: var(--border-radius);
|
| 238 |
overflow: hidden;
|
| 239 |
+
box-shadow: var(--box-shadow);
|
| 240 |
transition: transform 0.3s ease;
|
| 241 |
aspect-ratio: 1 / 1;
|
| 242 |
object-fit: cover;
|
|
|
|
| 246 |
transform: scale(1.05);
|
| 247 |
box-shadow: var(--hover-shadow);
|
| 248 |
}
|
| 249 |
+
|
| 250 |
.recipe-output {
|
| 251 |
+
font-size: 1.2em;
|
| 252 |
+
line-height: 1.7;
|
| 253 |
color: var(--text-color);
|
| 254 |
max-height: 600px;
|
| 255 |
overflow-y: auto;
|
| 256 |
+
padding-right: 15px;
|
| 257 |
}
|
| 258 |
+
|
| 259 |
.recipe-output h2 {
|
| 260 |
color: var(--primary-color);
|
| 261 |
margin-top: 30px;
|
| 262 |
+
font-size: 2em;
|
| 263 |
}
|
| 264 |
+
|
| 265 |
.recipe-output h3 {
|
| 266 |
color: var(--secondary-color);
|
| 267 |
+
font-size: 1.5em;
|
| 268 |
margin-top: 20px;
|
| 269 |
}
|
| 270 |
+
|
| 271 |
.loading-container {
|
| 272 |
display: flex;
|
| 273 |
flex-direction: column;
|
|
|
|
| 284 |
visibility: hidden;
|
| 285 |
transition: opacity 0.3s ease, visibility 0.3s ease;
|
| 286 |
}
|
| 287 |
+
|
| 288 |
.loading-container.visible {
|
| 289 |
opacity: 1;
|
| 290 |
visibility: visible;
|
| 291 |
}
|
| 292 |
+
|
| 293 |
.loading-spinner {
|
| 294 |
border: 8px solid #f3f3f3;
|
| 295 |
border-top: 8px solid var(--primary-color);
|
|
|
|
| 298 |
height: 60px;
|
| 299 |
animation: spin 1s linear infinite;
|
| 300 |
}
|
| 301 |
+
|
| 302 |
@keyframes spin {
|
| 303 |
0% { transform: rotate(0deg); }
|
| 304 |
100% { transform: rotate(360deg); }
|
| 305 |
}
|
| 306 |
+
|
| 307 |
.loading-text {
|
| 308 |
color: white;
|
| 309 |
+
font-size: 1.3em;
|
| 310 |
margin-top: 20px;
|
| 311 |
}
|
| 312 |
+
|
| 313 |
.footer {
|
| 314 |
background-color: var(--card-background);
|
| 315 |
padding: 40px 20px;
|
| 316 |
text-align: center;
|
| 317 |
color: var(--text-color);
|
| 318 |
+
font-size: 1.1em;
|
| 319 |
+
box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
|
| 320 |
}
|
| 321 |
+
|
| 322 |
.footer-content {
|
| 323 |
max-width: 800px;
|
| 324 |
margin: 0 auto;
|
| 325 |
}
|
| 326 |
+
|
| 327 |
.footer-brand {
|
| 328 |
font-weight: 700;
|
| 329 |
color: var(--primary-color);
|
| 330 |
}
|
| 331 |
+
|
| 332 |
.footer-links a {
|
| 333 |
color: var(--secondary-color);
|
| 334 |
text-decoration: none;
|
| 335 |
margin: 0 15px;
|
| 336 |
transition: color 0.3s ease;
|
| 337 |
}
|
| 338 |
+
|
| 339 |
.footer-links a:hover {
|
| 340 |
color: var(--primary-color);
|
| 341 |
}
|