Spaces:
Sleeping

byte-vortex commited on
Commit
9a7deef
·
verified ·
1 Parent(s): 982b9c8

Deploy Myco from CI

Browse files
Files changed (1) hide show
  1. ui/renderers.py +22 -7
ui/renderers.py CHANGED
@@ -456,9 +456,28 @@ def _mystery_goal_line(active_mystery, count: int) -> str:
456
  return f"**Mystery:** {remaining} clue discoveries until **{active_mystery.name}** — {active_mystery.clue}"
457
 
458
 
 
 
 
 
 
 
 
 
 
459
  def myco_footer_panel() -> str:
460
  """Render a polished, low-profile footer panel featuring the glowing moon."""
461
- return """
 
 
 
 
 
 
 
 
 
 
462
  <div class="myco-hero footer-variant">
463
  <div class="home-moon">🌙</div>
464
  <div class="myco-footer-content">
@@ -468,7 +487,7 @@ def myco_footer_panel() -> str:
468
  </div>
469
 
470
  <div class="myco-footer-media">
471
- <img src="./../assets/images/Myco.png" alt="Myco the mushroom companion" class="footer-hero-img" />
472
  </div>
473
 
474
  <div class="myco-footer-body">
@@ -484,9 +503,5 @@ def myco_footer_panel() -> str:
484
  <p class="myco-copyright"><span style="font-size: 0.8em;">&copy; 2026 Myco Game. Built with intuition.</span></p>
485
  </div>
486
  </div>
487
- """
488
-
489
- # Now your debug code lives safely outside the function!
490
- import os
491
- print("IMAGE EXISTS:", os.path.exists("./../assets/images/Myco.png"))
492
 
 
456
  return f"**Mystery:** {remaining} clue discoveries until **{active_mystery.name}** — {active_mystery.clue}"
457
 
458
 
459
+ import os
460
+ import base64
461
+
462
+ # 1. Find exactly where renderers.py lives in the system
463
+ HERE = os.path.dirname(os.path.abspath(__file__))
464
+
465
+ # 2. Go up one level (..) to the root, then into assets/images/Myco.png
466
+ IMAGE_PATH = os.path.abspath(os.path.join(HERE, "..", "assets", "images", "Myco.png"))
467
+
468
  def myco_footer_panel() -> str:
469
  """Render a polished, low-profile footer panel featuring the glowing moon."""
470
+
471
+ # Read and encode the image so Gradio doesn't block the local file
472
+ img_src = ""
473
+ if os.path.exists(IMAGE_PATH):
474
+ with open(IMAGE_PATH, "rb") as image_file:
475
+ encoded_string = base64.b64encode(image_file.read()).decode("utf-8")
476
+ img_src = f"data:image/png;base64,{encoded_string}"
477
+ else:
478
+ print(f"WARNING: Image still not found at {IMAGE_PATH}")
479
+
480
+ return f"""
481
  <div class="myco-hero footer-variant">
482
  <div class="home-moon">🌙</div>
483
  <div class="myco-footer-content">
 
487
  </div>
488
 
489
  <div class="myco-footer-media">
490
+ <img src="{img_src}" alt="Myco the mushroom companion" class="footer-hero-img" />
491
  </div>
492
 
493
  <div class="myco-footer-body">
 
503
  <p class="myco-copyright"><span style="font-size: 0.8em;">&copy; 2026 Myco Game. Built with intuition.</span></p>
504
  </div>
505
  </div>
506
+ """
 
 
 
 
507