Liori25 commited on
Commit
d44698a
·
verified ·
1 Parent(s): 159aab3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -4
app.py CHANGED
@@ -198,6 +198,7 @@ footer { display: none !important; }
198
  overflow-y: auto;
199
  scrollbar-width: none;
200
  }
 
201
 
202
  .col-feed {
203
  flex-grow: 1;
@@ -211,11 +212,12 @@ footer { display: none !important; }
211
  flex-shrink: 0;
212
  display: none;
213
  position: sticky;
214
- top: 76px;
215
  height: calc(100vh - 80px);
216
  overflow-y: auto;
217
  scrollbar-width: none;
218
  }
 
219
 
220
  /* 3. CARD STYLING */
221
  .fb-card {
@@ -399,8 +401,8 @@ with gr.Blocks(title="CookBook") as demo:
399
  gr.HTML("<div style='height:10px'></div>")
400
  magic_btn = gr.Button("✨ Convert to Text", variant="primary")
401
 
402
- # --- LARGE SPACER TO SEPARATE CARDS ---
403
- gr.HTML("<div style='height: 25px;'></div>")
404
 
405
  # SECTION B: TEXT OUTPUT
406
  with gr.Group(elem_classes=["fb-card"]):
@@ -447,8 +449,9 @@ with gr.Blocks(title="CookBook") as demo:
447
  with gr.Column(visible=False) as feed_view:
448
  gr.Markdown("### 🍽️ Explore Our Recipes")
449
 
 
450
  if not df_recipes.empty:
451
- feed_samples = df_recipes.sample(10)
452
  for index, row in feed_samples.iterrows():
453
  user_name = random.choice(["Grandma Rose", "Chef Mike", "Sarah J."])
454
  emoji = random.choice(["🥘", "🥗", "🍰", "🌮"])
@@ -480,6 +483,9 @@ with gr.Blocks(title="CookBook") as demo:
480
  gr.Button("👍 Like", elem_classes=["action-btn"], size="sm")
481
  gr.Button("💬 Comment", elem_classes=["action-btn"], size="sm")
482
  gr.Button("↪ Share", elem_classes=["action-btn"], size="sm")
 
 
 
483
  else:
484
  gr.Markdown("⚠️ Database is empty.")
485
 
 
198
  overflow-y: auto;
199
  scrollbar-width: none;
200
  }
201
+ .col-left::-webkit-scrollbar { display: none; } /* Hide Chrome scrollbar */
202
 
203
  .col-feed {
204
  flex-grow: 1;
 
212
  flex-shrink: 0;
213
  display: none;
214
  position: sticky;
215
+ top: 76px;
216
  height: calc(100vh - 80px);
217
  overflow-y: auto;
218
  scrollbar-width: none;
219
  }
220
+ .col-right::-webkit-scrollbar { display: none; } /* Hide Chrome scrollbar */
221
 
222
  /* 3. CARD STYLING */
223
  .fb-card {
 
401
  gr.HTML("<div style='height:10px'></div>")
402
  magic_btn = gr.Button("✨ Convert to Text", variant="primary")
403
 
404
+ # --- 9 PIXEL SPACER ---
405
+ gr.HTML("<div style='height: 9px;'></div>")
406
 
407
  # SECTION B: TEXT OUTPUT
408
  with gr.Group(elem_classes=["fb-card"]):
 
449
  with gr.Column(visible=False) as feed_view:
450
  gr.Markdown("### 🍽️ Explore Our Recipes")
451
 
452
+ # FIXED: Only show 2 posts to prevent endless scrolling feeling
453
  if not df_recipes.empty:
454
+ feed_samples = df_recipes.sample(2)
455
  for index, row in feed_samples.iterrows():
456
  user_name = random.choice(["Grandma Rose", "Chef Mike", "Sarah J."])
457
  emoji = random.choice(["🥘", "🥗", "🍰", "🌮"])
 
483
  gr.Button("👍 Like", elem_classes=["action-btn"], size="sm")
484
  gr.Button("💬 Comment", elem_classes=["action-btn"], size="sm")
485
  gr.Button("↪ Share", elem_classes=["action-btn"], size="sm")
486
+
487
+ # Added a "Load More" button visual (non-functional in this demo, but improves UX)
488
+ gr.Button("Load More...", variant="secondary")
489
  else:
490
  gr.Markdown("⚠️ Database is empty.")
491