ChenyuRabbitLove commited on
Commit
4d44b71
1 Parent(s): 00cc093

bugfix: fix minor bugs

Browse files
Files changed (3) hide show
  1. app.py +1 -0
  2. css/style.css +4 -4
  3. utils/completion_reward.py +5 -2
app.py CHANGED
@@ -209,6 +209,7 @@ with gr.Blocks(theme=seafoam, css=get_content("css/style.css")) as demo:
209
  interactive=True,
210
  elem_id="player_name",
211
  visible=False,
 
212
  )
213
 
214
  with gr.Row():
 
209
  interactive=True,
210
  elem_id="player_name",
211
  visible=False,
212
+ placeholder="請在這裡輸入暱稱",
213
  )
214
 
215
  with gr.Row():
css/style.css CHANGED
@@ -1,4 +1,4 @@
1
- #personal_report-button {
2
  font-size: 1.5rem !important;
3
  padding: 1.5vh !important;
4
  }
@@ -6,7 +6,7 @@
6
  #completion_reward-button {
7
  font-size: 1.5rem !important;
8
  padding: 1.5vh !important;
9
- }
10
 
11
  #player_avatar_container{
12
  place-items: center !important;
@@ -342,8 +342,8 @@ input[type="range"]::-ms-track {
342
 
343
  .selected {
344
  color: #fff !important;
345
- background: #12d2ab !important;
346
- border: 2px solid #02b28f !important;
347
  border-radius: 8px !important;
348
  }
349
 
 
1
+ /* #personal_report-button {
2
  font-size: 1.5rem !important;
3
  padding: 1.5vh !important;
4
  }
 
6
  #completion_reward-button {
7
  font-size: 1.5rem !important;
8
  padding: 1.5vh !important;
9
+ } */
10
 
11
  #player_avatar_container{
12
  place-items: center !important;
 
342
 
343
  .selected {
344
  color: #fff !important;
345
+ background: #d29512 !important;
346
+ border: 2px solid #b77f0e !important;
347
  border-radius: 8px !important;
348
  }
349
 
utils/completion_reward.py CHANGED
@@ -496,7 +496,8 @@ class ImageProcessor:
496
  for line in paragraph.split("\n"):
497
  wrapped_lines = textwrap.wrap(line, width=60)
498
  for wrapped_line in wrapped_lines:
499
- paragraph_height += body_font.getsize(wrapped_line)[1] + 25
 
500
 
501
  # Calculate box height and top, bottom position
502
  padding = 40 # Additional padding
@@ -518,7 +519,9 @@ class ImageProcessor:
518
  wrapped_lines = textwrap.wrap(line, width=60)
519
  for wrapped_line in wrapped_lines:
520
  draw.text((body_x, body_y), wrapped_line, font=body_font, fill="black")
521
- body_y += body_font.getsize(wrapped_line)[1] + 25
 
 
522
 
523
  def get_md5_hash(text):
524
  return hashlib.md5(text.encode("utf-8")).hexdigest()
 
496
  for line in paragraph.split("\n"):
497
  wrapped_lines = textwrap.wrap(line, width=60)
498
  for wrapped_line in wrapped_lines:
499
+ line_height = draw.textsize(wrapped_line, font=body_font)[1]
500
+ paragraph_height += line_height + 25
501
 
502
  # Calculate box height and top, bottom position
503
  padding = 40 # Additional padding
 
519
  wrapped_lines = textwrap.wrap(line, width=60)
520
  for wrapped_line in wrapped_lines:
521
  draw.text((body_x, body_y), wrapped_line, font=body_font, fill="black")
522
+ body_y += draw.textsize(wrapped_line, font=body_font)[1] + 25
523
+
524
+ # Save the image with the text
525
 
526
  def get_md5_hash(text):
527
  return hashlib.md5(text.encode("utf-8")).hexdigest()