From 6afc1a193bb1d68deccd569c89d70ee9bf35246c Mon Sep 17 00:00:00 2001 From: Pete <33569918+jparmstr@users.noreply.github.com> Date: Wed, 2 Aug 2023 11:02:36 -0400 Subject: [PATCH] Add a scrollbar to notebook/default, improve chat scrollbar style (#3403) --------- Co-authored-by: oobabooga <112222186+oobabooga@users.noreply.github.com> --- css/main.css | 30 +++++++++++++++++++++++++++++- css/main.js | 7 +++++++ modules/html_generator.py | 6 +++--- server.py | 12 ++++++------ 4 files changed, 45 insertions(+), 10 deletions(-) diff --git a/css/main.css b/css/main.css index 760e367a..5c17a179 100644 --- a/css/main.css +++ b/css/main.css @@ -154,4 +154,32 @@ button { .markdown ul ol { font-size: 100% !important; -} \ No newline at end of file +} + +.pretty_scrollbar::-webkit-scrollbar { + width: 10px; +} + +.pretty_scrollbar::-webkit-scrollbar-track { + background: transparent; +} + +.pretty_scrollbar::-webkit-scrollbar-thumb, +.pretty_scrollbar::-webkit-scrollbar-thumb:hover { + background: #c5c5d2; + border-radius: 10px; +} + +.dark .pretty_scrollbar::-webkit-scrollbar-thumb, +.dark .pretty_scrollbar::-webkit-scrollbar-thumb:hover { + background: #374151; + border-radius: 10px; +} + +.pretty_scrollbar::-webkit-resizer { + background: #c5c5d2; +} + +.dark .pretty_scrollbar::-webkit-resizer { + background: #374151; +} diff --git a/css/main.js b/css/main.js index 32820ebe..f3b3c05f 100644 --- a/css/main.js +++ b/css/main.js @@ -16,3 +16,10 @@ main_parent.addEventListener('click', function(e) { extensions.style.display = 'none'; } }); + +const textareaElements = document.querySelectorAll('.add_scrollbar textarea'); +for(i = 0; i < textareaElements.length; i++) { + textareaElements[i].classList.remove('scroll-hide'); + textareaElements[i].classList.add('pretty_scrollbar'); + textareaElements[i].style.resize = "none"; +} diff --git a/modules/html_generator.py b/modules/html_generator.py index 4910ffef..ab0aeab0 100644 --- a/modules/html_generator.py +++ b/modules/html_generator.py @@ -150,7 +150,7 @@ def get_image_cache(path): def generate_instruct_html(history): - output = f'