byte-vortex commited on
Commit
a2137cb
·
verified ·
1 Parent(s): 902d765

Deploy Myco from CI

Browse files
Files changed (2) hide show
  1. ui/interface.py +14 -14
  2. ui/styles.py +30 -28
ui/interface.py CHANGED
@@ -198,23 +198,23 @@ def render_shroom_tab():
198
  end up in a separate Blocks graph that never gets launched, so the tab
199
  renders empty and the Timer never fires.
200
  """
201
- with gr.Tabs():
202
- with gr.Tab("✨ Magic Mushroom Garden"):
203
- # The pure animation
204
- gr.HTML(value=cute_mushroom_garden_html())
205
 
206
- # Subtle attribution
 
 
 
 
 
 
 
 
207
  gr.Markdown(
208
  "<sub>*Story generated by Myco AI*</sub>",
209
  elem_id="ai-attribution"
210
  )
211
 
212
- # Define the narrative component ONCE
213
- narrative = gr.Markdown(
214
- value="Myco is searching for a story hidden in the moss...",
215
- elem_id="narrative-card"
216
- )
217
-
218
- # Timer updates the ONE narrative component
219
- gr.Timer(20).tick(fn=get_myco_narrative, outputs=narrative)
220
-
 
198
  end up in a separate Blocks graph that never gets launched, so the tab
199
  renders empty and the Timer never fires.
200
  """
201
+ with gr.Tab("✨ Magic Mushroom Garden"):
202
+ # 1. The full-page background animation
203
+ gr.HTML(value=cute_mushroom_garden_html())
 
204
 
205
+ # 2. Container holding BOTH narrative text and attribution
206
+ with gr.Group(elem_id="narrative-card"):
207
+
208
+ # The updating narrative text
209
+ narrative = gr.Markdown(
210
+ value="Myco is searching for a story hidden in the moss..."
211
+ )
212
+
213
+ # The subtle attribution nested inside the box
214
  gr.Markdown(
215
  "<sub>*Story generated by Myco AI*</sub>",
216
  elem_id="ai-attribution"
217
  )
218
 
219
+ # 3. Timer updates the narrative component safely
220
+ gr.Timer(20).tick(fn=get_myco_narrative, outputs=narrative)
 
 
 
 
 
 
 
ui/styles.py CHANGED
@@ -875,54 +875,56 @@ div.gradio-html { background: transparent !important; }
875
  }
876
 
877
  /* Magic Mushroom */
878
- /* Floating Narrative Card on the Upper Left Side */
879
  #narrative-card {
880
  position: absolute;
881
  top: 1.5rem;
882
  left: 1.5rem;
883
- z-index: 10; /* Forces text to sit on top of the HTML animation */
884
  max-width: 320px;
885
- color: #ffffff; /* Ensures text remains readable */
886
 
887
- /* Green gradient starting at 0% opacity */
888
- background-image: linear-gradient(
889
  135deg,
890
- rgba(30, 130, 76, 0) 0%,
891
- rgba(46, 204, 113, 0) 100%
892
- );
893
- backdrop-filter: blur(8px);
894
- -webkit-backdrop-filter: blur(8px);
 
895
 
896
  padding: 1.2rem;
897
  border-radius: 12px;
898
- border: 1px solid rgba(46, 204, 113, 0.15); /* Subtle green border */
899
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
900
 
901
- /* Smooth transition effect for the gradient and border */
902
- transition: background-image 0.4s ease, border-color 0.4s ease;
903
-
904
- /* Modern layout layout to separate body text and attribution */
905
  display: flex;
906
  flex-direction: column;
907
- gap: 0.75rem; /* Creates clean spacing before the attribution */
 
 
908
  }
909
 
910
- /* Smoothly fades into a rich green gradient on hover */
911
  #narrative-card:hover {
912
- background-image: linear-gradient(
913
- 135deg,
914
- rgba(30, 130, 76, 0.4) 0%, /* Deep emerald green at 40% opacity */
915
- rgba(46, 204, 113, 0.15) 100% /* Light mint green at 15% opacity */
916
- );
917
- border-color: rgba(46, 204, 113, 0.5); /* Brightens the green border */
 
 
 
 
 
918
  }
919
 
920
- /* Floating Attribution now inside the text box */
921
  #ai-attribution {
922
- /* Removed absolute tracking so it rests inside the card flow */
923
- color: rgba(255, 255, 255, 0.5); /* Slightly dimmer for hierarchy */
924
- font-size: 0.85rem; /* Slightly smaller text size */
925
- align-self: flex-start; /* Aligns left cleanly */
926
  }
927
 
928
  """
 
875
  }
876
 
877
  /* Magic Mushroom */
878
+ /* Container holding everything on the Upper Left Side */
879
  #narrative-card {
880
  position: absolute;
881
  top: 1.5rem;
882
  left: 1.5rem;
883
+ z-index: 10;
884
  max-width: 320px;
 
885
 
886
+ /* FIX: Force Gradio's internal wrapper block to let our gradient shine through */
887
+ background: linear-gradient(
888
  135deg,
889
+ rgba(30, 130, 76, 0.45) 0%, /* Visible emerald green */
890
+ rgba(46, 204, 113, 0.2) 100% /* Visible mint green */
891
+ ) !important;
892
+
893
+ backdrop-filter: blur(8px) !important;
894
+ -webkit-backdrop-filter: blur(8px) !important;
895
 
896
  padding: 1.2rem;
897
  border-radius: 12px;
898
+ border: 1px solid rgba(46, 204, 113, 0.4) !important; /* Subtle green border */
899
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
900
 
 
 
 
 
901
  display: flex;
902
  flex-direction: column;
903
+ gap: 0.75rem;
904
+
905
+ transition: filter 0.3s ease;
906
  }
907
 
908
+ /* Optional interactive glow effect when hovered */
909
  #narrative-card:hover {
910
+ filter: brightness(1.2);
911
+ }
912
+
913
+ /* Forces ALL text inside the card to be solid white */
914
+ #narrative-card,
915
+ #narrative-card p,
916
+ #narrative-card span,
917
+ #narrative-card sub,
918
+ #narrative-card .prose,
919
+ #narrative-card * {
920
+ color: #ffffff !important;
921
  }
922
 
923
+ /* Keeps the attribution white, but gives it a subtle text shadow for readability */
924
  #ai-attribution {
925
+ font-size: 0.85rem;
926
+ text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
927
+ opacity: 0.7;
 
928
  }
929
 
930
  """