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

:zap: [Enhance] Prettify UI by adding box-shadow and background-image linear-gradient

Browse files
Files changed (3) hide show
  1. components/inputs_binder.js +13 -7
  2. css/default.css +22 -2
  3. index.html +1 -1
components/inputs_binder.js CHANGED
@@ -1,7 +1,7 @@
1
  import { setup_temperature_on_select } from "../components/llm_models_loader.js";
2
 
3
  export class InputsBinder {
4
- constructor() { }
5
  bind() {
6
  setup_temperature_on_select();
7
  let user_input_resizer = new UserInputResizer();
@@ -16,7 +16,7 @@ export class InputsBinder {
16
  }
17
 
18
  class UserInputResizer {
19
- constructor() { }
20
  bind() {
21
  // https://stackoverflow.com/questions/37629860/automatically-resizing-textarea-in-bootstrap
22
  document.getElementById("user-input").addEventListener(
@@ -31,7 +31,7 @@ class UserInputResizer {
31
  }
32
 
33
  class ChatSessionContainerResizeBinder {
34
- constructor() { }
35
  bind() {
36
  this.resize();
37
  $(window).resize(this.resize.bind(this));
@@ -49,7 +49,7 @@ class ChatSessionContainerResizeBinder {
49
  class ChatHistorySidebarResizeBinder {
50
  constructor() {
51
  this.USER_INTERACTIONS_MAX_WIDTH = 900;
52
- this.SIDEBAR_GAP = 10;
53
  this.SIDEBAR_MAX_WIDTH = 300;
54
  this.SIDEBAR_MIN_WIDTH = 120;
55
  }
@@ -64,11 +64,17 @@ class ChatHistorySidebarResizeBinder {
64
  return $("#user-interactions").width();
65
  }
66
  get_side_margin() {
67
- return (this.get_window_width() - this.get_user_interations_width()) / 2 - this.SIDEBAR_GAP;
 
 
 
68
  }
69
  need_to_show() {
70
  let sidebar = $("#chat-history-sidebar");
71
- return (!sidebar.hasClass("show")) && localStorage.getItem("show_chat_history_sidebar") === "true";
 
 
 
72
  }
73
  resize() {
74
  let sidebar = $("#chat-history-sidebar");
@@ -93,4 +99,4 @@ class ChatHistorySidebarResizeBinder {
93
  sidebar.css("min-width", this.SIDEBAR_MIN_WIDTH + "px");
94
  }
95
  }
96
- }
 
1
  import { setup_temperature_on_select } from "../components/llm_models_loader.js";
2
 
3
  export class InputsBinder {
4
+ constructor() {}
5
  bind() {
6
  setup_temperature_on_select();
7
  let user_input_resizer = new UserInputResizer();
 
16
  }
17
 
18
  class UserInputResizer {
19
+ constructor() {}
20
  bind() {
21
  // https://stackoverflow.com/questions/37629860/automatically-resizing-textarea-in-bootstrap
22
  document.getElementById("user-input").addEventListener(
 
31
  }
32
 
33
  class ChatSessionContainerResizeBinder {
34
+ constructor() {}
35
  bind() {
36
  this.resize();
37
  $(window).resize(this.resize.bind(this));
 
49
  class ChatHistorySidebarResizeBinder {
50
  constructor() {
51
  this.USER_INTERACTIONS_MAX_WIDTH = 900;
52
+ this.SIDEBAR_GAP = 20;
53
  this.SIDEBAR_MAX_WIDTH = 300;
54
  this.SIDEBAR_MIN_WIDTH = 120;
55
  }
 
64
  return $("#user-interactions").width();
65
  }
66
  get_side_margin() {
67
+ return (
68
+ (this.get_window_width() - this.get_user_interations_width()) / 2 -
69
+ this.SIDEBAR_GAP
70
+ );
71
  }
72
  need_to_show() {
73
  let sidebar = $("#chat-history-sidebar");
74
+ return (
75
+ !sidebar.hasClass("show") &&
76
+ localStorage.getItem("show_chat_history_sidebar") === "true"
77
+ );
78
  }
79
  resize() {
80
  let sidebar = $("#chat-history-sidebar");
 
99
  sidebar.css("min-width", this.SIDEBAR_MIN_WIDTH + "px");
100
  }
101
  }
102
+ }
css/default.css CHANGED
@@ -8,8 +8,27 @@
8
  max-width: 100vw;
9
  }
10
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  #chat-history-sidebar {
12
- background-color: rgba(255, 255, 255, 0.5);
 
 
 
13
  }
14
 
15
  /* Adaptation for mobile */
@@ -117,6 +136,7 @@
117
 
118
  .fa:hover {
119
  color: lightsalmon;
 
120
  }
121
 
122
  .fa-small {
@@ -127,4 +147,4 @@
127
 
128
  .icon-success {
129
  color: green;
130
- }
 
8
  max-width: 100vw;
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
  }
33
 
34
  /* Adaptation for mobile */
 
136
 
137
  .fa:hover {
138
  color: lightsalmon;
139
+ transform: scale(1.25);
140
  }
141
 
142
  .fa-small {
 
147
 
148
  .icon-success {
149
  color: green;
150
+ }
index.html CHANGED
@@ -82,7 +82,7 @@
82
  </button>
83
  </div>
84
  </div>
85
- <div class="mt-2 row no-gutters">
86
  <div class="col-auto pr-0">
87
  <button id="new-chat-session" class="btn px-0">
88
  <i class="fa fa-compass"></i>
 
82
  </button>
83
  </div>
84
  </div>
85
+ <div class="my-2 row no-gutters">
86
  <div class="col-auto pr-0">
87
  <button id="new-chat-session" class="btn px-0">
88
  <i class="fa fa-compass"></i>