Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -90,7 +90,6 @@ def find_similar_recipes_list(query_text):
|
|
| 90 |
title = row['Title']
|
| 91 |
desc = str(row['Raw_Output'])
|
| 92 |
|
| 93 |
-
# --- MODIFIED: Show Title, Exact Score (3 decimals), and Description ---
|
| 94 |
card_content = (
|
| 95 |
f"<div style='font-weight: bold; font-size: 16px; margin-bottom: 4px; color: #050505;'>🥘 {title}</div>"
|
| 96 |
f"<div style='color: #1877F2; font-size: 13px; font-weight: 600; margin-bottom: 8px;'>Similarity Score: {score:.3f}</div>"
|
|
@@ -141,20 +140,8 @@ theme = gr.themes.Default(
|
|
| 141 |
)
|
| 142 |
|
| 143 |
facebook_css = """
|
| 144 |
-
body
|
| 145 |
-
|
| 146 |
-
margin: 0;
|
| 147 |
-
padding: 0;
|
| 148 |
-
height: 100vh;
|
| 149 |
-
overflow: hidden !important;
|
| 150 |
-
}
|
| 151 |
-
.gradio-container {
|
| 152 |
-
background-color: #f0f2f5 !important;
|
| 153 |
-
max-width: 100% !important;
|
| 154 |
-
margin: 0 !important;
|
| 155 |
-
padding: 0 !important;
|
| 156 |
-
height: 100vh !important;
|
| 157 |
-
}
|
| 158 |
footer { display: none !important; }
|
| 159 |
|
| 160 |
/* 1. FIXED NAVBAR */
|
|
@@ -165,10 +152,8 @@ footer { display: none !important; }
|
|
| 165 |
box-shadow: 0 1px 2px rgba(0,0,0,0.1);
|
| 166 |
display: flex;
|
| 167 |
align-items: center;
|
| 168 |
-
position:
|
| 169 |
top: 0;
|
| 170 |
-
left: 0;
|
| 171 |
-
right: 0;
|
| 172 |
z-index: 999;
|
| 173 |
justify-content: space-between;
|
| 174 |
}
|
|
@@ -190,50 +175,40 @@ footer { display: none !important; }
|
|
| 190 |
align-items: center;
|
| 191 |
}
|
| 192 |
|
| 193 |
-
/* 2. LAYOUT COLUMNS */
|
| 194 |
.main-layout {
|
| 195 |
display: flex;
|
| 196 |
justify-content: center;
|
| 197 |
-
padding-top:
|
| 198 |
gap: 20px;
|
| 199 |
max-width: 1600px;
|
| 200 |
margin: 0 auto;
|
| 201 |
align-items: flex-start;
|
| 202 |
}
|
| 203 |
|
|
|
|
| 204 |
.col-left {
|
| 205 |
-
width:
|
| 206 |
-
min-width:
|
| 207 |
flex-shrink: 0;
|
| 208 |
-
display: none;
|
| 209 |
-
position: sticky
|
| 210 |
-
top: 76px;
|
| 211 |
-
height: calc(100vh - 80px);
|
| 212 |
-
overflow-y: auto;
|
| 213 |
-
scrollbar-width: none;
|
| 214 |
}
|
| 215 |
|
|
|
|
| 216 |
.col-feed {
|
| 217 |
flex-grow: 1;
|
| 218 |
min-width: 600px;
|
| 219 |
max-width: 1000px;
|
| 220 |
-
|
| 221 |
-
overflow-y: auto;
|
| 222 |
-
padding: 20px 0 100px 0;
|
| 223 |
-
scrollbar-width: none;
|
| 224 |
}
|
| 225 |
-
.col-feed::-webkit-scrollbar { display: none; }
|
| 226 |
|
|
|
|
| 227 |
.col-right {
|
| 228 |
-
width:
|
| 229 |
-
min-width:
|
| 230 |
flex-shrink: 0;
|
| 231 |
-
display: none;
|
| 232 |
-
position: sticky;
|
| 233 |
-
top: 76px;
|
| 234 |
-
height: calc(100vh - 80px);
|
| 235 |
-
overflow-y: auto;
|
| 236 |
-
scrollbar-width: none;
|
| 237 |
}
|
| 238 |
|
| 239 |
/* 3. CARD STYLING */
|
|
@@ -250,7 +225,7 @@ footer { display: none !important; }
|
|
| 250 |
/* 4. NAVIGATION BUTTONS */
|
| 251 |
.nav-btn {
|
| 252 |
width: 100% !important;
|
| 253 |
-
height:
|
| 254 |
text-align: left !important;
|
| 255 |
justify-content: flex-start !important;
|
| 256 |
background: transparent !important;
|
|
@@ -330,6 +305,7 @@ details[open] > summary { display: none !important; }
|
|
| 330 |
|
| 331 |
/* UTILS */
|
| 332 |
.sim-scroll { height: 200px; overflow-y: auto; font-size: 13px; color: #050505; }
|
|
|
|
| 333 |
@media (min-width: 1100px) { .col-left, .col-right { display: block; } }
|
| 334 |
"""
|
| 335 |
|
|
|
|
| 90 |
title = row['Title']
|
| 91 |
desc = str(row['Raw_Output'])
|
| 92 |
|
|
|
|
| 93 |
card_content = (
|
| 94 |
f"<div style='font-weight: bold; font-size: 16px; margin-bottom: 4px; color: #050505;'>🥘 {title}</div>"
|
| 95 |
f"<div style='color: #1877F2; font-size: 13px; font-weight: 600; margin-bottom: 8px;'>Similarity Score: {score:.3f}</div>"
|
|
|
|
| 140 |
)
|
| 141 |
|
| 142 |
facebook_css = """
|
| 143 |
+
body { background-color: #f0f2f5; margin: 0; padding: 0; }
|
| 144 |
+
.gradio-container { background-color: #f0f2f5 !important; max-width: 100% !important; margin: 0 !important; padding: 0 !important; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 145 |
footer { display: none !important; }
|
| 146 |
|
| 147 |
/* 1. FIXED NAVBAR */
|
|
|
|
| 152 |
box-shadow: 0 1px 2px rgba(0,0,0,0.1);
|
| 153 |
display: flex;
|
| 154 |
align-items: center;
|
| 155 |
+
position: sticky; /* Keep navbar sticky at top */
|
| 156 |
top: 0;
|
|
|
|
|
|
|
| 157 |
z-index: 999;
|
| 158 |
justify-content: space-between;
|
| 159 |
}
|
|
|
|
| 175 |
align-items: center;
|
| 176 |
}
|
| 177 |
|
| 178 |
+
/* 2. LAYOUT COLUMNS - STANDARD FLOW (NO FIXED SIDEBARS) */
|
| 179 |
.main-layout {
|
| 180 |
display: flex;
|
| 181 |
justify-content: center;
|
| 182 |
+
padding-top: 20px;
|
| 183 |
gap: 20px;
|
| 184 |
max-width: 1600px;
|
| 185 |
margin: 0 auto;
|
| 186 |
align-items: flex-start;
|
| 187 |
}
|
| 188 |
|
| 189 |
+
/* Left Sidebar */
|
| 190 |
.col-left {
|
| 191 |
+
width: 280px !important;
|
| 192 |
+
min-width: 280px !important;
|
| 193 |
flex-shrink: 0;
|
| 194 |
+
display: none; /* Hidden on mobile */
|
| 195 |
+
/* No position: sticky here anymore */
|
|
|
|
|
|
|
|
|
|
|
|
|
| 196 |
}
|
| 197 |
|
| 198 |
+
/* Center Feed */
|
| 199 |
.col-feed {
|
| 200 |
flex-grow: 1;
|
| 201 |
min-width: 600px;
|
| 202 |
max-width: 1000px;
|
| 203 |
+
/* No overflow-y auto here, let the page scroll */
|
|
|
|
|
|
|
|
|
|
| 204 |
}
|
|
|
|
| 205 |
|
| 206 |
+
/* Right Sidebar */
|
| 207 |
.col-right {
|
| 208 |
+
width: 280px !important;
|
| 209 |
+
min-width: 280px !important;
|
| 210 |
flex-shrink: 0;
|
| 211 |
+
display: none; /* Hidden on mobile */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 212 |
}
|
| 213 |
|
| 214 |
/* 3. CARD STYLING */
|
|
|
|
| 225 |
/* 4. NAVIGATION BUTTONS */
|
| 226 |
.nav-btn {
|
| 227 |
width: 100% !important;
|
| 228 |
+
height: 48px !important;
|
| 229 |
text-align: left !important;
|
| 230 |
justify-content: flex-start !important;
|
| 231 |
background: transparent !important;
|
|
|
|
| 305 |
|
| 306 |
/* UTILS */
|
| 307 |
.sim-scroll { height: 200px; overflow-y: auto; font-size: 13px; color: #050505; }
|
| 308 |
+
.suggested-header { font-size: 12px; font-weight: bold; color: #65676B; margin-bottom: 5px; }
|
| 309 |
@media (min-width: 1100px) { .col-left, .col-right { display: block; } }
|
| 310 |
"""
|
| 311 |
|