AnatoliiG commited on
Commit
e7d8d34
·
1 Parent(s): 5a5a38b

Update styles.py

Browse files
Files changed (1) hide show
  1. src/ui/styles.py +29 -5
src/ui/styles.py CHANGED
@@ -1,16 +1,24 @@
1
  CSS = """
2
- /* 1. Глобальный фон страницы */
3
  html, body, .gradio-container {
4
  background-color: #212121 !important;
5
  margin: 0 !important;
6
  padding: 0 !important;
 
 
 
 
7
  }
8
 
9
- /* 2. Главный ряд (сайдбар + чат) */
10
  #main-row {
11
  margin: 0 !important;
12
  gap: 0 !important;
13
  background-color: #212121 !important;
 
 
 
 
14
  }
15
 
16
  /* 3. Боковая панель */
@@ -18,6 +26,8 @@ html, body, .gradio-container {
18
  background-color: #171717 !important;
19
  border-right: 1px solid #2f2f2f !important;
20
  padding: 1.5rem 1.25rem !important;
 
 
21
  }
22
 
23
  /* Кнопка сворачивания/разворачивания сайдбара */
@@ -42,14 +52,20 @@ html, body, .gradio-container {
42
  background-color: #2f2f2f !important;
43
  }
44
 
45
- /* 4. Колонка чата */
46
  #col-chat-main {
47
  background-color: #212121 !important;
48
  padding: 0 !important;
49
  margin: 0 !important;
 
 
 
 
 
 
50
  }
51
 
52
- /* Стилизация компонента Chatbot */
53
  #chatbot {
54
  background-color: transparent !important;
55
  border: none !important;
@@ -57,11 +73,17 @@ html, body, .gradio-container {
57
  max-width: 800px !important;
58
  margin: 0 auto !important;
59
  width: 100% !important;
 
 
 
60
  }
61
 
62
  #chatbot > .wrapper {
63
  background: transparent !important;
64
  border: none !important;
 
 
 
65
  }
66
 
67
  /* 5. Настройки пузырей сообщений и текста */
@@ -106,13 +128,15 @@ html, body, .gradio-container {
106
  color: #ececec !important;
107
  }
108
 
109
- /* 6. Поле ввода (ChatGPT стиль) */
110
  #input-area {
111
  max-width: 800px !important;
 
112
  margin: 0 auto 1.5rem auto !important;
113
  padding: 0 1rem !important;
114
  background: transparent !important;
115
  border: none !important;
 
116
  }
117
 
118
  #input-area > div,
 
1
  CSS = """
2
+ /* 1. Блокировка высоты и скролла всей страницы (как в ChatGPT) */
3
  html, body, .gradio-container {
4
  background-color: #212121 !important;
5
  margin: 0 !important;
6
  padding: 0 !important;
7
+ height: 100vh !important;
8
+ min-height: 100vh !important;
9
+ max-height: 100vh !important;
10
+ overflow: hidden !important; /* Убирает бесконечный скролл страницы */
11
  }
12
 
13
+ /* 2. Главный ряд на всю высоту экрана */
14
  #main-row {
15
  margin: 0 !important;
16
  gap: 0 !important;
17
  background-color: #212121 !important;
18
+ height: 100vh !important;
19
+ min-height: 100vh !important;
20
+ max-height: 100vh !important;
21
+ overflow: hidden !important;
22
  }
23
 
24
  /* 3. Боковая панель */
 
26
  background-color: #171717 !important;
27
  border-right: 1px solid #2f2f2f !important;
28
  padding: 1.5rem 1.25rem !important;
29
+ height: 100vh !important;
30
+ overflow-y: auto !important;
31
  }
32
 
33
  /* Кнопка сворачивания/разворачивания сайдбара */
 
52
  background-color: #2f2f2f !important;
53
  }
54
 
55
+ /* 4. Колонка чата (принудительно прижимает ввод вниз) */
56
  #col-chat-main {
57
  background-color: #212121 !important;
58
  padding: 0 !important;
59
  margin: 0 !important;
60
+ height: 100vh !important;
61
+ max-height: 100vh !important;
62
+ display: flex !important;
63
+ flex-direction: column !important;
64
+ justify-content: space-between !important; /* Чат сверху, ввод строго снизу */
65
+ overflow: hidden !important;
66
  }
67
 
68
+ /* Область сообщений занимает все свободное пространство */
69
  #chatbot {
70
  background-color: transparent !important;
71
  border: none !important;
 
73
  max-width: 800px !important;
74
  margin: 0 auto !important;
75
  width: 100% !important;
76
+ flex: 1 1 auto !important; /* Растягивается на максимум */
77
+ min-height: 0 !important; /* Предотвращает раздувание */
78
+ overflow-y: auto !important; /* Скролл только внутри чата */
79
  }
80
 
81
  #chatbot > .wrapper {
82
  background: transparent !important;
83
  border: none !important;
84
+ display: flex !important;
85
+ flex-direction: column !important;
86
+ height: 100% !important;
87
  }
88
 
89
  /* 5. Настройки пузырей сообщений и текста */
 
128
  color: #ececec !important;
129
  }
130
 
131
+ /* 6. Поле ввода прижатое к низу */
132
  #input-area {
133
  max-width: 800px !important;
134
+ width: 100% !important;
135
  margin: 0 auto 1.5rem auto !important;
136
  padding: 0 1rem !important;
137
  background: transparent !important;
138
  border: none !important;
139
+ flex-shrink: 0 !important; /* Не позволяет сжимать поле ввода */
140
  }
141
 
142
  #input-area > div,