Ali Abid commited on
Commit
0ea320c
1 Parent(s): 4752626
Files changed (2) hide show
  1. run.py +9 -0
  2. style.css +1 -0
run.py CHANGED
@@ -42,6 +42,7 @@ with gr.Blocks(css="style.css") as app:
42
  placeholder="Answer any clue here...",
43
  elem_id="guess",
44
  )
 
45
  prev_answers = gr.DataFrame(
46
  headers=None, row_count=1, col_count=3, label="Previous Answers"
47
  )
@@ -75,6 +76,14 @@ with gr.Blocks(css="style.css") as app:
75
  _js="""() => {document.querySelector("gradio-app").shadowRoot.querySelector("#guess textarea").setSelectionRange(0, 9999)}""",
76
  status_tracker=None,
77
  )
 
 
 
 
 
 
 
 
78
 
79
  def update_game(data):
80
  if data[room_name] is None or data[room_name] not in games:
 
42
  placeholder="Answer any clue here...",
43
  elem_id="guess",
44
  )
45
+ submit_guess = gr.Button("Guess")
46
  prev_answers = gr.DataFrame(
47
  headers=None, row_count=1, col_count=3, label="Previous Answers"
48
  )
 
76
  _js="""() => {document.querySelector("gradio-app").shadowRoot.querySelector("#guess textarea").setSelectionRange(0, 9999)}""",
77
  status_tracker=None,
78
  )
79
+ submit_guess.click(submit_guess, {room_name, player, guess}, None)
80
+ submit_guess.click(
81
+ None,
82
+ None,
83
+ None,
84
+ _js="""() => {document.querySelector("gradio-app").shadowRoot.querySelector("#guess textarea").setSelectionRange(0, 9999)}""",
85
+ status_tracker=None,
86
+ )
87
 
88
  def update_game(data):
89
  if data[room_name] is None or data[room_name] not in games:
style.css CHANGED
@@ -58,6 +58,7 @@
58
  }
59
  #clue-1 textarea, #clue-2 textarea, #clue-3 textarea {
60
  font-size: 1.4em;
 
61
  }
62
  .dark .clue-1.clue-2 {
63
  background: linear-gradient(45deg, darkred 50%, darkgreen 50%);
 
58
  }
59
  #clue-1 textarea, #clue-2 textarea, #clue-3 textarea {
60
  font-size: 1.4em;
61
+ color: black;
62
  }
63
  .dark .clue-1.clue-2 {
64
  background: linear-gradient(45deg, darkred 50%, darkgreen 50%);