OGOGOG commited on
Commit
ccb974f
·
verified ·
1 Parent(s): 0edb9d4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -43
app.py CHANGED
@@ -238,59 +238,37 @@ def recommend(base_alcohol_text, flavor, top_k=3):
238
  return "\n\n---\n\n".join(blocks)
239
 
240
  # ========================
241
- # Background + UI (bulletproof)
242
  # ========================
243
  CUSTOM_CSS = f"""
244
  html, body, #root {{ height: 100%; margin: 0; padding: 0; }}
245
 
246
- /* Dedicated background layer behind everything (avoid iframe/body quirks) */
247
- #bg-layer {{
248
- position: fixed;
249
- inset: 0;
250
  background-image: url('{BACKGROUND_IMAGE_URL}');
251
  background-size: cover;
252
  background-position: center;
253
- background-repeat: no-repeat;
254
- z-index: 0;
255
  }}
256
 
257
- /* Optional overlay for readability (tune or set to transparent) */
258
- #bg-overlay {{
 
259
  position: fixed;
260
  inset: 0;
261
- background: rgba(0,0,0,0.20);
262
- z-index: 1;
263
  }}
264
 
265
- /* App above the layers, transparent so background shows */
266
  .gradio-container {{
267
  background: transparent !important;
268
  position: relative;
269
- z-index: 2;
270
- color: white;
271
- }}
272
-
273
- /* Nuke any default block/panel backgrounds */
274
- :root {{
275
- --background-fill-primary: transparent !important;
276
- --background-fill-secondary: transparent !important;
277
- --block-background-fill: transparent !important;
278
- --panel-background-fill: transparent !important;
279
- }}
280
-
281
- .gradio-container .prose,
282
- .gradio-container .block,
283
- .gradio-container .panel,
284
- .gradio-container .tabs,
285
- .gradio-container .tabitem,
286
- .gradio-container .form,
287
- .gradio-container .wrap,
288
- .gradio-container .container {{
289
- background: transparent !important;
290
- box-shadow: none !important;
291
- color: white;
292
  }}
293
 
 
294
  .glass-card {{
295
  background: rgba(255, 255, 255, 0.08);
296
  backdrop-filter: blur(6px);
@@ -298,21 +276,17 @@ html, body, #root {{ height: 100%; margin: 0; padding: 0; }}
298
  border-radius: 14px;
299
  padding: 18px;
300
  border: 1px solid rgba(255, 255, 255, 0.12);
301
- color: white;
302
  }}
303
 
304
- /* Headings white */
305
- .gradio-container h1,
306
- .gradio-container h2,
307
- .gradio-container h3 {{
308
  color: white !important;
309
  }}
310
  """
311
 
312
- with gr.Blocks(css=CUSTOM_CSS) as demo:
313
- # Add background layers BEFORE any components
314
- gr.HTML("<div id='bg-layer'></div><div id='bg-overlay'></div>")
315
 
 
316
  with gr.Column(elem_classes=["glass-card"]):
317
  gr.Markdown("# 🍹 AI Bartender — Type a Base + Flavor")
318
  with gr.Row():
 
238
  return "\n\n---\n\n".join(blocks)
239
 
240
  # ========================
241
+ # Background + UI (robust)
242
  # ========================
243
  CUSTOM_CSS = f"""
244
  html, body, #root {{ height: 100%; margin: 0; padding: 0; }}
245
 
246
+ /* Background image */
247
+ body {{
 
 
248
  background-image: url('{BACKGROUND_IMAGE_URL}');
249
  background-size: cover;
250
  background-position: center;
251
+ background-attachment: fixed;
 
252
  }}
253
 
254
+ /* Slightly lighter overlay so the image is visible */
255
+ body::before {{
256
+ content: "";
257
  position: fixed;
258
  inset: 0;
259
+ background: rgba(0,0,0,0.25); /* was 0.45 */
260
+ z-index: 0;
261
  }}
262
 
263
+ /* Make app transparent so image shows through */
264
  .gradio-container {{
265
  background: transparent !important;
266
  position: relative;
267
+ z-index: 1;
268
+ color: white; /* default text white */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
269
  }}
270
 
271
+ /* Glass effect */
272
  .glass-card {{
273
  background: rgba(255, 255, 255, 0.08);
274
  backdrop-filter: blur(6px);
 
276
  border-radius: 14px;
277
  padding: 18px;
278
  border: 1px solid rgba(255, 255, 255, 0.12);
279
+ color: white; /* ensure text inside is white */
280
  }}
281
 
282
+ /* Make markdown headings white */
283
+ .gradio-container h1, .gradio-container h2, .gradio-container h3 {{
 
 
284
  color: white !important;
285
  }}
286
  """
287
 
 
 
 
288
 
289
+ with gr.Blocks(css=CUSTOM_CSS) as demo:
290
  with gr.Column(elem_classes=["glass-card"]):
291
  gr.Markdown("# 🍹 AI Bartender — Type a Base + Flavor")
292
  with gr.Row():