Omnibus commited on
Commit
a948a8c
1 Parent(s): 04133ab

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -17,7 +17,7 @@ css="""
17
 
18
  }
19
  .bot_chat{
20
- background: #1c3c9b;
21
  border-radius: 10px 10px 10px 0px;
22
  padding: 10px;
23
  max-width: 100%;
@@ -27,8 +27,8 @@ css="""
27
 
28
  }
29
  .chat_card{
30
- background: #253251; #background_c
31
- color:#FFFFFF; #font_c;
32
  border-radius: 15px;
33
  border-width: thin;
34
  padding: 15px;
@@ -72,7 +72,7 @@ def get_screenshot(chat,css_in,w,h,user_c,bot_c,background_c,font_c):
72
  print(user_c)
73
  if user_c:
74
  user_c=user_c.strip('""').strip("''")
75
- css_in=css_in.replace("$user_c",user_c)
76
  html_body=""
77
  for user,bot in chat:
78
  html_body += html_user.replace("$chat",user)
@@ -146,11 +146,11 @@ with gr.Blocks(css=css) as app:
146
  im_height=gr.Number(label="Height",value=1000)
147
  im_width=gr.Number(label="Width",value=500)
148
  with gr.Row():
149
- user_c=gr.ColorPicker(value="#367bb9")
150
- bot_c=gr.ColorPicker(value="#1c3c9b")
151
  with gr.Row():
152
- background_c=gr.ColorPicker(value="#253251")
153
- font_c=gr.ColorPicker(value="#FFFFFF")
154
  chatblock=gr.Dropdown(label="Chatblocks",choices=[c for c in range(1,40)],multiselect=True)
155
 
156
  im_btn=gr.Button("Screenshot")
 
17
 
18
  }
19
  .bot_chat{
20
+ background: $bot_c;
21
  border-radius: 10px 10px 10px 0px;
22
  padding: 10px;
23
  max-width: 100%;
 
27
 
28
  }
29
  .chat_card{
30
+ background: $background_c;
31
+ color: $font_c;
32
  border-radius: 15px;
33
  border-width: thin;
34
  padding: 15px;
 
72
  print(user_c)
73
  if user_c:
74
  user_c=user_c.strip('""').strip("''")
75
+ css_in=css_in.replace("$user_c",user_c).replace("$bot_c",bot_c).replace("$background_c",background_c).replace("$font_c",font_c)
76
  html_body=""
77
  for user,bot in chat:
78
  html_body += html_user.replace("$chat",user)
 
146
  im_height=gr.Number(label="Height",value=1000)
147
  im_width=gr.Number(label="Width",value=500)
148
  with gr.Row():
149
+ user_c=gr.ColorPicker(label="User Color",value="#367bb9")
150
+ bot_c=gr.ColorPicker(label="Bot Color",value="#1c3c9b")
151
  with gr.Row():
152
+ background_c=gr.ColorPicker(label="Background Color",value="#253251")
153
+ font_c=gr.ColorPicker(label="Font Color",value="#ffffff")
154
  chatblock=gr.Dropdown(label="Chatblocks",choices=[c for c in range(1,40)],multiselect=True)
155
 
156
  im_btn=gr.Button("Screenshot")