Rahaf2001 commited on
Commit
4c4371c
·
verified ·
1 Parent(s): 7e641bd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +37 -6
app.py CHANGED
@@ -246,18 +246,49 @@ def coach_all_in_one(
246
  # -------------------------------
247
  # UI (Gradio)
248
  # -------------------------------
249
- with gr.Blocks(title="Beginner Gym Coach — Multi-Agent",
250
- css="#motivation{background:#fff6e5;border-left:6px solid #ffa84b;padding:10px 14px;border-radius:8px;font-size:16px;}") as demo:
 
 
 
 
 
 
 
 
 
 
251
  gr.Markdown("## 🏋️ Beginner Gym Coach — Multi-Agent\nGive me your basics and I’ll coach you.")
252
 
253
  banner = gr.Markdown("", elem_id="motivation")
254
  idx = gr.State(0)
255
 
256
- # show something immediately
257
- demo.load(lambda: ("Let’s begin strong! 🚀", 1), outputs=[banner, idx])
258
- # update every 10 seconds
259
- demo.load(rotate_msg, inputs=idx, outputs=[banner, idx], every=10)
260
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
261
  # ... your Tabs ...
262
 
263
 
 
246
  # -------------------------------
247
  # UI (Gradio)
248
  # -------------------------------
249
+ with gr.Blocks(
250
+ title="Beginner Gym Coach — Multi-Agent",
251
+ css="""
252
+ .motivation{
253
+ background:#fff6e5;
254
+ border-left:6px solid #ffa84b;
255
+ padding:10px 14px;
256
+ border-radius:8px;
257
+ font-size:16px;
258
+ }
259
+ """
260
+ ) as demo:
261
  gr.Markdown("## 🏋️ Beginner Gym Coach — Multi-Agent\nGive me your basics and I’ll coach you.")
262
 
263
  banner = gr.Markdown("", elem_id="motivation")
264
  idx = gr.State(0)
265
 
 
 
 
 
266
 
267
+ banner = gr.HTML(
268
+ """
269
+ <div id="motivation" class="motivation">Let’s begin strong! 🚀</div>
270
+ <script>
271
+ const MOTIVATION = [
272
+ "You’re doing great—one step at a time! 💪",
273
+ "Small habits, big results. Keep going. 🔁",
274
+ "Hydrate and move—your future self thanks you. 💧",
275
+ "Form first, weight second. You’ve got this. 🧠",
276
+ "Consistency beats intensity. Show up today. ✅",
277
+ ];
278
+ let i = 0;
279
+ function tick() {
280
+ const el = document.getElementById("motivation");
281
+ if (!el) return;
282
+ el.textContent = MOTIVATION[i % MOTIVATION.length];
283
+ i++;
284
+ }
285
+ tick(); // first line immediately
286
+ setInterval(tick, 10000); // then every 10s
287
+ </script>
288
+ """
289
+ )
290
+
291
+
292
  # ... your Tabs ...
293
 
294