Shreemahor commited on
Commit
3dbfcb7
ยท
verified ยท
1 Parent(s): 4626c1a

Update gradio_frontend.py

Browse files
Files changed (1) hide show
  1. gradio_frontend.py +16 -14
gradio_frontend.py CHANGED
@@ -77,12 +77,14 @@ CSS = """
77
  --bg-dark: #0f1116;
78
  --gold-primary: #FFD700;
79
  --gold-secondary: #FF8C00;
80
- --purple-dark: #2e0249;
81
- --purple-deep: #1a0b2e;
82
  }
83
 
 
 
84
  .readout-box {
85
- background: var(--purple-dark) !important;
86
  color: #ffffff !important;
87
  border: 1px solid rgba(255, 215, 0, 0.35) !important;
88
  border-radius: 12px;
@@ -131,7 +133,7 @@ body {
131
 
132
  /* Dropdown popup background + text */
133
  .gradio-container [role="listbox"] {
134
- background: var(--purple-deep) !important;
135
  border: 1px solid var(--gold-primary) !important;
136
  }
137
 
@@ -163,17 +165,14 @@ body {
163
  inset: 0;
164
  display: grid;
165
  place-items: center;
166
- z-index: 9999;
 
167
  pointer-events: none;
168
 
169
  opacity: 0;
170
  transition: opacity 0.35s ease, filter 1.5s ease;
171
  }
172
 
173
- #crystal-ball-bg {
174
- z-index: 9999 !important;
175
- }
176
-
177
  #crystal-ball-bg, #crystal-ball-bg * {
178
  pointer-events: none !important;
179
  }
@@ -191,6 +190,8 @@ body {
191
  #crystal-ball-bg.zoomed-in {
192
  transform: scale(20);
193
  filter: blur(0px) brightness(1);
 
 
194
  }
195
 
196
  #ball-content {
@@ -204,8 +205,9 @@ body {
204
 
205
  /* CRYSTAL BALLL SIZE ADJUSTS MENTS IS HERE*/
206
  #crystal-ball-bg lottie-player {
207
- width: 600px;
208
- height: 600px;
 
209
  filter: drop-shadow(0 0 30px rgba(91, 139, 255, 0.3));
210
  }
211
 
@@ -388,7 +390,7 @@ def build_demo(*, on_user_message, on_begin_story, on_begin_story_checked, on_co
388
  ],
389
  "grimdark": [
390
  ("Plague Doctor ๐ŸŽญ", "plague_doctor"),
391
- ("Broken Knight โš”๏ธ", "broken_knight"),
392
  ("Famine Scavenger ๐ŸŽ’", "famine_scavenger"),
393
  ("Penitent Zealot ๐Ÿ•ฏ๏ธ", "penitent_zealot"),
394
  ("Grave Robber ๐Ÿ”ฆ", "grave_robber"),
@@ -440,7 +442,7 @@ def build_demo(*, on_user_message, on_begin_story, on_begin_story_checked, on_co
440
  with title_screen:
441
  with gr.Group(elem_classes=["screen-inner"]):
442
  gr.Image(
443
- value="frontend/title.png",
444
  show_label=False,
445
  interactive=False,
446
  container=False,
@@ -559,7 +561,7 @@ def build_demo(*, on_user_message, on_begin_story, on_begin_story_checked, on_co
559
  )
560
  textbox = gr.Textbox(
561
  label="Your action",
562
- placeholder="Describe your move, or click below to let fate decide...",
563
  show_label=False,
564
  elem_id="action-box",
565
  )
 
77
  --bg-dark: #0f1116;
78
  --gold-primary: #FFD700;
79
  --gold-secondary: #FF8C00;
80
+ --rebecca-purple: #663399;
81
+ --rebecca-purple: #663399;
82
  }
83
 
84
+ /* In some places there might be purple dark, and sometimes rebecca purple but both are okay*/
85
+
86
  .readout-box {
87
+ background: var(--rebecca-purple) !important;
88
  color: #ffffff !important;
89
  border: 1px solid rgba(255, 215, 0, 0.35) !important;
90
  border-radius: 12px;
 
133
 
134
  /* Dropdown popup background + text */
135
  .gradio-container [role="listbox"] {
136
+ background: var(--rebecca-purple) !important;
137
  border: 1px solid var(--gold-primary) !important;
138
  }
139
 
 
165
  inset: 0;
166
  display: grid;
167
  place-items: center;
168
+ /* Keep the crystal ball behind the UI by default (small screens especially). */
169
+ z-index: 1;
170
  pointer-events: none;
171
 
172
  opacity: 0;
173
  transition: opacity 0.35s ease, filter 1.5s ease;
174
  }
175
 
 
 
 
 
176
  #crystal-ball-bg, #crystal-ball-bg * {
177
  pointer-events: none !important;
178
  }
 
190
  #crystal-ball-bg.zoomed-in {
191
  transform: scale(20);
192
  filter: blur(0px) brightness(1);
193
+ /* During the zoom transition, it should sit on top. */
194
+ z-index: 9999;
195
  }
196
 
197
  #ball-content {
 
205
 
206
  /* CRYSTAL BALLL SIZE ADJUSTS MENTS IS HERE*/
207
  #crystal-ball-bg lottie-player {
208
+ /* Responsive sizing: scales to the device while keeping a sane min/max. */
209
+ width: clamp(220px, 70vmin, 600px);
210
+ height: clamp(220px, 70vmin, 600px);
211
  filter: drop-shadow(0 0 30px rgba(91, 139, 255, 0.3));
212
  }
213
 
 
390
  ],
391
  "grimdark": [
392
  ("Plague Doctor ๐ŸŽญ", "plague_doctor"),
393
+ ("Broken Knight ๐Ÿ’”", "broken_knight"),
394
  ("Famine Scavenger ๐ŸŽ’", "famine_scavenger"),
395
  ("Penitent Zealot ๐Ÿ•ฏ๏ธ", "penitent_zealot"),
396
  ("Grave Robber ๐Ÿ”ฆ", "grave_robber"),
 
442
  with title_screen:
443
  with gr.Group(elem_classes=["screen-inner"]):
444
  gr.Image(
445
+ value="frontend/improved-title.png",
446
  show_label=False,
447
  interactive=False,
448
  container=False,
 
561
  )
562
  textbox = gr.Textbox(
563
  label="Your action",
564
+ placeholder="Describe your move, or click below to let fate decide...",
565
  show_label=False,
566
  elem_id="action-box",
567
  )