ChenyuRabbitLove commited on
Commit
ed3be34
1 Parent(s): 1679f35

bugfix: fix minor bugs

Browse files
Files changed (2) hide show
  1. app.py +12 -10
  2. css/style.css +45 -5
app.py CHANGED
@@ -98,7 +98,7 @@ with gr.Blocks(theme=seafoam, css=get_content("css/style.css")) as demo:
98
  completion_reward = gr.State(init_reward)
99
  player_activity_tracker = gr.State(create_new_player_activity)
100
 
101
- with gr.Tab("個人化戰報"):
102
  with gr.Row():
103
  with gr.Column(
104
  scale=1,
@@ -178,10 +178,10 @@ with gr.Blocks(theme=seafoam, css=get_content("css/style.css")) as demo:
178
  pull_newest_player_data = gr.Textbox("", visible=False)
179
  update_status = gr.Textbox("", visible=False)
180
 
181
- with gr.Tab("完賽獎勵"):
182
  with gr.Row():
183
  start_make_reward = gr.Button(
184
- "開始製作完賽獎勵!", visible=True, elem_id="start_make_reward"
185
  )
186
 
187
  with gr.Row():
@@ -296,10 +296,10 @@ with gr.Blocks(theme=seafoam, css=get_content("css/style.css")) as demo:
296
  )
297
 
298
  with gr.Row():
299
- bot1 = gr.Chatbot(visible=False)
300
- bot2 = gr.Chatbot(visible=False)
301
- bot3 = gr.Chatbot(visible=False)
302
- bot4 = gr.Chatbot(visible=False)
303
 
304
  with gr.Row():
305
  select_story = gr.Radio(
@@ -336,14 +336,16 @@ with gr.Blocks(theme=seafoam, css=get_content("css/style.css")) as demo:
336
  fn=render_finished,
337
  inputs=[player_activity_tracker, player_info],
338
  outputs=None,
 
339
  )
340
 
341
- player_info_query_btn.click(get_player_info, player_backend_id, player_info).then(
342
- get_player_logs, player_backend_id, player_logs
343
- ).then(
344
  render_player_data,
345
  player_info,
346
  [avatar, pet_gallery, badge_gallery, adventure_log, achievements, adventure],
 
347
  ).then(
348
  **send_player_login_info
349
  )
 
98
  completion_reward = gr.State(init_reward)
99
  player_activity_tracker = gr.State(create_new_player_activity)
100
 
101
+ with gr.Tab("個人化戰報", elem_id="personal_report"):
102
  with gr.Row():
103
  with gr.Column(
104
  scale=1,
 
178
  pull_newest_player_data = gr.Textbox("", visible=False)
179
  update_status = gr.Textbox("", visible=False)
180
 
181
+ with gr.Tab("完賽獎勵", elem_id="completion_reward"):
182
  with gr.Row():
183
  start_make_reward = gr.Button(
184
+ "開始製作完賽獎勵!", visible=False, elem_id="start_make_reward"
185
  )
186
 
187
  with gr.Row():
 
296
  )
297
 
298
  with gr.Row():
299
+ bot1 = gr.Chatbot(visible=False, elem_id="bot1")
300
+ bot2 = gr.Chatbot(visible=False, elem_id="bot2")
301
+ bot3 = gr.Chatbot(visible=False, elem_id="bot3")
302
+ bot4 = gr.Chatbot(visible=False, elem_id="bot4")
303
 
304
  with gr.Row():
305
  select_story = gr.Radio(
 
336
  fn=render_finished,
337
  inputs=[player_activity_tracker, player_info],
338
  outputs=None,
339
+ queue=False,
340
  )
341
 
342
+ player_info_query_btn.click(get_player_info, player_backend_id, player_info, queue=False).then(
343
+ get_player_logs, player_backend_id, player_logs, queue=False
344
+ ).then(lambda: gr.update(visible=True), None, start_make_reward, queue=False).then(
345
  render_player_data,
346
  player_info,
347
  [avatar, pet_gallery, badge_gallery, adventure_log, achievements, adventure],
348
+ queue=False,
349
  ).then(
350
  **send_player_login_info
351
  )
css/style.css CHANGED
@@ -1,3 +1,13 @@
 
 
 
 
 
 
 
 
 
 
1
  #player_avatar_container{
2
  place-items: center !important;
3
  }
@@ -337,8 +347,23 @@ input[type="range"]::-ms-track {
337
  border-radius: 8px !important;
338
  }
339
 
340
- .message {
341
- background: rgba(0,0,0,0.05) !important;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
342
  border: None !important;
343
  }
344
 
@@ -355,7 +380,7 @@ input[type="range"]::-ms-track {
355
  margin: 1vh 1vw 1vh 1vw;
356
  }
357
 
358
- .code_wrap prep {
359
  background: none;
360
  }
361
 
@@ -376,8 +401,7 @@ input[type="range"]::-ms-track {
376
  }
377
 
378
  #select_story label{
379
- background: #48A1DD;
380
- color: #fff;
381
  }
382
 
383
  #select_story input{
@@ -387,4 +411,20 @@ input[type="range"]::-ms-track {
387
  #select_story [data-testid="block-info"] {
388
  color: #000;
389
  margin: auto;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
390
  }
 
1
+ #personal_report {
2
+ font-size: 1.5rem !important;
3
+ padding: 1.5vh !important;
4
+ }
5
+
6
+ #completion_reward {
7
+ font-size: 1.5rem !important;
8
+ padding: 1.5vh !important;
9
+ }
10
+
11
  #player_avatar_container{
12
  place-items: center !important;
13
  }
 
347
  border-radius: 8px !important;
348
  }
349
 
350
+ .bot1 .message {
351
+ background: rgba(255,255,255,0.4) !important;
352
+ border: None !important;
353
+ }
354
+
355
+ .bot2 .message {
356
+ background: rgba(252, 208, 28, 0.4) !important;
357
+ border: None !important;
358
+ }
359
+
360
+ .bot3 .message {
361
+ background: rgba(99, 162, 98, 0.4) !important;
362
+ border: None !important;
363
+ }
364
+
365
+ .bot4 .message {
366
+ background: rgba(66, 130, 227, 0.4) !important;
367
  border: None !important;
368
  }
369
 
 
380
  margin: 1vh 1vw 1vh 1vw;
381
  }
382
 
383
+ .code_wrap pre {
384
  background: none;
385
  }
386
 
 
401
  }
402
 
403
  #select_story label{
404
+ color: #000;
 
405
  }
406
 
407
  #select_story input{
 
411
  #select_story [data-testid="block-info"] {
412
  color: #000;
413
  margin: auto;
414
+ }
415
+
416
+ [data-testid="露米娜-radio-label"] {
417
+ background: rgba(255,255,255,0.4) !important;
418
+ }
419
+
420
+ [data-testid="索拉拉-radio-label"] {
421
+ background: rgba(252, 208, 28, 0.4) !important;
422
+ }
423
+
424
+ [data-testid="薇丹特-radio-label"] {
425
+ background: rgba(99, 162, 98, 0.4) !important;
426
+ }
427
+
428
+ [data-testid="蔚藍-radio-label"] {
429
+ background: rgba(66, 130, 227, 0.4) !important;
430
  }