Hansimov commited on
Commit
c60e6fd
1 Parent(s): 404b568

:zap: [Enhance] Replace some bootstrap styles with pure css, and improve color palettes

Browse files
components/chat_operator.js CHANGED
@@ -60,9 +60,7 @@ export function get_latest_assistant_messager() {
60
  }
61
 
62
  export function start_latest_message_animation() {
63
- get_latest_assistant_messager()
64
- .find(".content-displayer")
65
- .addClass("inferring");
66
  get_latest_assistant_messager()
67
  .find(".button-group")
68
  .find(".regenerate-button")
@@ -71,9 +69,7 @@ export function start_latest_message_animation() {
71
  }
72
 
73
  export function stop_latest_message_animation() {
74
- get_latest_assistant_messager()
75
- .find(".content-displayer")
76
- .removeClass("inferring");
77
  get_latest_assistant_messager()
78
  .find(".button-group")
79
  .find(".regenerate-button")
 
60
  }
61
 
62
  export function start_latest_message_animation() {
63
+ get_latest_assistant_messager().addClass("inferring");
 
 
64
  get_latest_assistant_messager()
65
  .find(".button-group")
66
  .find(".regenerate-button")
 
69
  }
70
 
71
  export function stop_latest_message_animation() {
72
+ get_latest_assistant_messager().removeClass("inferring");
 
 
73
  get_latest_assistant_messager()
74
  .find(".button-group")
75
  .find(".regenerate-button")
components/messager.js CHANGED
@@ -5,7 +5,7 @@ class MessagerViewer {
5
  }
6
  create_elements() {
7
  this.container = $("<div>")
8
- .addClass("mt-2 row no-gutters message-viewer position-relative")
9
  .addClass(`message-${this.message.role}`);
10
  this.create_role_displayer();
11
  this.create_content_displayer();
@@ -17,11 +17,8 @@ class MessagerViewer {
17
  }
18
  create_role_displayer() {
19
  this.role_displayer = $("<div>")
20
- .addClass("position-absolute px-2")
21
  .addClass("role-displayer")
22
- .css("z-index", "1")
23
- .css("padding", "auto")
24
- .css("color", "red");
25
  if (this.message.role === "user") {
26
  this.role_displayer.append("You");
27
  } else {
@@ -30,7 +27,6 @@ class MessagerViewer {
30
  }
31
  create_content_displayer() {
32
  this.content_displayer = $("<div>")
33
- .addClass("col-12 px-2 pt-4")
34
  .addClass("content-displayer")
35
  .addClass(`chat-${this.message.role}`);
36
  this.content_displayer.text(this.message.content);
 
5
  }
6
  create_elements() {
7
  this.container = $("<div>")
8
+ .addClass("row no-gutters message-viewer position-relative")
9
  .addClass(`message-${this.message.role}`);
10
  this.create_role_displayer();
11
  this.create_content_displayer();
 
17
  }
18
  create_role_displayer() {
19
  this.role_displayer = $("<div>")
 
20
  .addClass("role-displayer")
21
+ .css("z-index", "1");
 
 
22
  if (this.message.role === "user") {
23
  this.role_displayer.append("You");
24
  } else {
 
27
  }
28
  create_content_displayer() {
29
  this.content_displayer = $("<div>")
 
30
  .addClass("content-displayer")
31
  .addClass(`chat-${this.message.role}`);
32
  this.content_displayer.text(this.message.content);
css/default.css CHANGED
@@ -9,24 +9,45 @@
9
  }
10
 
11
  body {
12
- background-image: linear-gradient(90deg, #cdd9fd, #cdd9fd);
13
  }
14
 
15
- .content-displayer {
16
- box-shadow: 4px 4px 8px 0px rgba(122, 122, 122, 0.2);
17
- background-image: linear-gradient(90deg, #e3eaff, #d6e0fd);
18
  border-radius: 5px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  }
20
 
21
  #user-interactions {
22
- box-shadow: 4px 4px 8px 0px rgba(122, 122, 122, 0.2);
23
- background-image: linear-gradient(30deg, #e3eaff, #d6e0fd);
24
  border-radius: 10px;
25
  }
26
 
27
  #chat-history-sidebar {
28
- box-shadow: 4px 4px 8px 0px rgba(122, 122, 122, 0.2);
29
- background-image: linear-gradient(90deg, #cdd9fd, #d6e0fd);
30
  border-width: 0px;
31
  opacity: 0.8;
32
  }
@@ -52,6 +73,7 @@ body {
52
  #chat-session-container {
53
  overflow-y: auto;
54
  overflow-x: hidden;
 
55
  }
56
 
57
  #user-input {
@@ -61,14 +83,14 @@ body {
61
 
62
  .chat-user {
63
  color: black;
64
- border: lightgray 1px solid;
65
- background-color: #eafaf1;
66
  white-space: pre-wrap;
67
  }
68
 
69
  .chat-assistant {
70
  /* color: blue; */
71
- border: lightgray 1px solid;
72
  }
73
 
74
  #available-models-select {
@@ -130,10 +152,6 @@ body {
130
  animation: blink 2s infinite;
131
  }
132
 
133
- .inferring {
134
- background-color: rgba(255, 147, 40, 0.25);
135
- }
136
-
137
  .fa:hover {
138
  color: lightsalmon;
139
  transform: scale(1.25);
 
9
  }
10
 
11
  body {
12
+ background-image: linear-gradient(90deg, #eef3ff, #ecf1ff);
13
  }
14
 
15
+ .message-user,
16
+ .message-assistant {
17
+ box-shadow: 0px 0px 8px 0px rgba(122, 122, 122, 0.4);
18
  border-radius: 5px;
19
+ margin: 30px 0px 30px 0px;
20
+ padding: 5px 0px 5px 0px;
21
+ margin: 0px 0px 12px 0px;
22
+ }
23
+
24
+ .message-user {
25
+ background-image: linear-gradient(-45deg, #f6f8fe, #e9efff);
26
+ }
27
+ .message-user .role-displayer {
28
+ color: #1679db;
29
+ }
30
+
31
+ .message-assistant {
32
+ background-image: linear-gradient(-45deg, #f4f6fe, #ecedff);
33
+ }
34
+ .message-assistant .role-displayer {
35
+ color: #d03afe;
36
+ }
37
+
38
+ .inferring {
39
+ background-image: linear-gradient(-45deg, #f6f8fe, #fff5e5);
40
  }
41
 
42
  #user-interactions {
43
+ box-shadow: 0px 2px 8px 0px rgba(122, 122, 122, 0.4);
44
+ background-image: linear-gradient(-45deg, #eef3ff, #e9efff);
45
  border-radius: 10px;
46
  }
47
 
48
  #chat-history-sidebar {
49
+ box-shadow: 0px 0px 8px 0px rgba(122, 122, 122, 0.4);
50
+ background-image: linear-gradient(-45deg, #eef3ff, #e9efff);
51
  border-width: 0px;
52
  opacity: 0.8;
53
  }
 
73
  #chat-session-container {
74
  overflow-y: auto;
75
  overflow-x: hidden;
76
+ padding: 0px;
77
  }
78
 
79
  #user-input {
 
83
 
84
  .chat-user {
85
  color: black;
86
+ /* border: lightgray 1px solid; */
87
+ /* background-color: #eafaf1; */
88
  white-space: pre-wrap;
89
  }
90
 
91
  .chat-assistant {
92
  /* color: blue; */
93
+ /* border: lightgray 1px solid; */
94
  }
95
 
96
  #available-models-select {
 
152
  animation: blink 2s infinite;
153
  }
154
 
 
 
 
 
155
  .fa:hover {
156
  color: lightsalmon;
157
  transform: scale(1.25);
index.html CHANGED
@@ -44,7 +44,7 @@
44
  </div>
45
  </div>
46
  <div id="chat-session-container" class="container">
47
- <div id="messagers-container" class="container my-3 py-1"></div>
48
  </div>
49
  <div id="user-interactions" class="container fixed-bottom mb-3">
50
  <div id="endpoint-and-api-key-items">
 
44
  </div>
45
  </div>
46
  <div id="chat-session-container" class="container">
47
+ <div id="messagers-container" class="container mt-3 py-1"></div>
48
  </div>
49
  <div id="user-interactions" class="container fixed-bottom mb-3">
50
  <div id="endpoint-and-api-key-items">