From a3ecf3bb6593ca98ce8263e80263c353a3744315 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Thu, 14 Sep 2023 16:15:08 -0700 Subject: [PATCH] Add cai-chat-square chat style --- css/chat_style-cai-chat-square.css | 19 +++++++++++++++++++ css/chat_style-cai-chat.css | 1 + modules/html_generator.py | 10 ++++++++++ 3 files changed, 30 insertions(+) create mode 100644 css/chat_style-cai-chat-square.css diff --git a/css/chat_style-cai-chat-square.css b/css/chat_style-cai-chat-square.css new file mode 100644 index 0000000..0d64524 --- /dev/null +++ b/css/chat_style-cai-chat-square.css @@ -0,0 +1,19 @@ +@import url("file/css/chat_style-cai-chat.css"); + +.circle-bot, .circle-you { + height: 75px; + border-radius: 8.333px; + background-color: #656565; +} + +.circle-bot img, .circle-you img { + border-radius: 8.333px; +} + +.circle-you { + background-color: #656565; +} + +.message { + padding-bottom: 30px; +} diff --git a/css/chat_style-cai-chat.css b/css/chat_style-cai-chat.css index a1f73b0..6aa088d 100644 --- a/css/chat_style-cai-chat.css +++ b/css/chat_style-cai-chat.css @@ -51,6 +51,7 @@ .dark .message-body p em { color: rgb(138, 138, 138) !important; + font-weight: 500; } .message-body p em { diff --git a/modules/html_generator.py b/modules/html_generator.py index c2e622e..f31bdca 100644 --- a/modules/html_generator.py +++ b/modules/html_generator.py @@ -25,6 +25,16 @@ chat_styles = {} for k in get_available_chat_styles(): chat_styles[k] = open(Path(f'css/chat_style-{k}.css'), 'r').read() +# Handle styles that derive from other styles +for k in chat_styles: + lines = chat_styles[k].split('\n') + input_string = lines[0] + match = re.search(r'chat_style-([a-z\-]*)\.css', input_string) + + if match: + style = match.group(1) + chat_styles[k] = chat_styles.get(style, '') + '\n\n' + '\n'.join(lines[1:]) + def fix_newlines(string): string = string.replace('\n', '\n\n')