Spaces:
Sleeping
Sleeping
Keldos
commited on
Commit
·
374ce0c
1
Parent(s):
f6180c8
WIP: fix
Browse files
web_assets/html/header_title.html
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<div class="gb_hd gb_7c gb_8c"
|
2 |
style="display:inline-flex;">
|
3 |
<buttom id="chuanhu-menu-btn" onclick='menuClick()' class="gb_Ec" aria-expanded="false" aria-label="Main menu" role="button" tabindex="0"
|
4 |
-
style="visibility: visible; width:32px; height:32px; margin-right:5px;"><svg focusable="false" viewBox="0 0 24 24">
|
5 |
<path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"></path>
|
6 |
</svg>
|
7 |
</div>
|
|
|
1 |
<div class="gb_hd gb_7c gb_8c"
|
2 |
style="display:inline-flex;">
|
3 |
<buttom id="chuanhu-menu-btn" onclick='menuClick()' class="gb_Ec" aria-expanded="false" aria-label="Main menu" role="button" tabindex="0"
|
4 |
+
style="visibility: visible; width:32px; height:32px; margin-right:5px;"><svg focusable="false" viewBox="0 0 24 24" fill="currentColor">
|
5 |
<path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"></path>
|
6 |
</svg>
|
7 |
</div>
|
web_assets/javascript/ChuanhuChat.js
CHANGED
@@ -94,6 +94,7 @@ function initialize() {
|
|
94 |
setChatbotHeight();
|
95 |
setChatbotScroll();
|
96 |
setPopupBoxPosition();
|
|
|
97 |
setSlider();
|
98 |
setAvatar();
|
99 |
if (!historyLoaded) loadHistoryHtml();
|
@@ -212,11 +213,26 @@ function adjustDarkMode() {
|
|
212 |
});
|
213 |
}
|
214 |
|
|
|
215 |
function setChatAreaWidth() {
|
216 |
const screenWidth = window.innerWidth;
|
217 |
-
const
|
218 |
-
const
|
219 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
220 |
}
|
221 |
|
222 |
function setPopupBoxPosition() {
|
@@ -317,7 +333,7 @@ window.addEventListener("DOMContentLoaded", function () {
|
|
317 |
isInIframe = (window.self !== window.top);
|
318 |
historyLoaded = false;
|
319 |
});
|
320 |
-
window.addEventListener('resize', ()=>{setChatbotHeight();setPopupBoxPosition()});
|
321 |
window.addEventListener('scroll', ()=>{setChatbotHeight(); setUpdateWindowHeight();setPopupBoxPosition();});
|
322 |
window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", adjustDarkMode);
|
323 |
|
|
|
94 |
setChatbotHeight();
|
95 |
setChatbotScroll();
|
96 |
setPopupBoxPosition();
|
97 |
+
setChatAreaWidth();
|
98 |
setSlider();
|
99 |
setAvatar();
|
100 |
if (!historyLoaded) loadHistoryHtml();
|
|
|
213 |
});
|
214 |
}
|
215 |
|
216 |
+
|
217 |
function setChatAreaWidth() {
|
218 |
const screenWidth = window.innerWidth;
|
219 |
+
const menuArea = gradioApp().querySelector('#menu-area');
|
220 |
+
const chatbotArea = gradioApp().querySelector('#chatbot-area');
|
221 |
+
// const menuWidth = menuArea.offsetWidth;
|
222 |
+
const chatbotAreaWidth = chatbotArea.offsetWidth;
|
223 |
+
return;
|
224 |
+
if (menuArea.classList.contains('hideSide')) {
|
225 |
+
// // chatbotArea.style.width = `${chatbotAreaWidth}px`;
|
226 |
+
// chatbotArea.style.flexBasis = '75%'
|
227 |
+
// } else {
|
228 |
+
// chatbotArea.style.flexBasis = `50%`;
|
229 |
+
// if (screenWidth > 499) {
|
230 |
+
// // chatbotArea.style.width = `${screenWidth - menuWidth}px`;
|
231 |
+
// chatbotArea.style.width = `800px`;
|
232 |
+
// } else {
|
233 |
+
// // chatbotArea.style.width = `${chatbotAreaWidth}px`;
|
234 |
+
// }
|
235 |
+
}
|
236 |
}
|
237 |
|
238 |
function setPopupBoxPosition() {
|
|
|
333 |
isInIframe = (window.self !== window.top);
|
334 |
historyLoaded = false;
|
335 |
});
|
336 |
+
window.addEventListener('resize', ()=>{setChatbotHeight();setPopupBoxPosition();});
|
337 |
window.addEventListener('scroll', ()=>{setChatbotHeight(); setUpdateWindowHeight();setPopupBoxPosition();});
|
338 |
window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", adjustDarkMode);
|
339 |
|
web_assets/javascript/webui.js
CHANGED
@@ -2,6 +2,7 @@ function openSettingBox() {
|
|
2 |
chuanhuPopup.classList.add('showBox');
|
3 |
popupWrapper.classList.add('showBox');
|
4 |
settingBox.classList.remove('hideBox');
|
|
|
5 |
showMask();
|
6 |
|
7 |
}
|
@@ -10,6 +11,7 @@ function openTrainingBox() {
|
|
10 |
chuanhuPopup.classList.add('showBox');
|
11 |
popupWrapper.classList.add('showBox');
|
12 |
trainingBox.classList.remove('hideBox');
|
|
|
13 |
showMask();
|
14 |
}
|
15 |
|
@@ -42,6 +44,7 @@ function menuClick() {
|
|
42 |
menu.classList.add('hideSide');
|
43 |
// menuBtn.classList.remove('active');
|
44 |
}
|
|
|
45 |
}
|
46 |
|
47 |
function setHistroyPanel() {
|
|
|
2 |
chuanhuPopup.classList.add('showBox');
|
3 |
popupWrapper.classList.add('showBox');
|
4 |
settingBox.classList.remove('hideBox');
|
5 |
+
trainingBox.classList.add('hideBox');
|
6 |
showMask();
|
7 |
|
8 |
}
|
|
|
11 |
chuanhuPopup.classList.add('showBox');
|
12 |
popupWrapper.classList.add('showBox');
|
13 |
trainingBox.classList.remove('hideBox');
|
14 |
+
settingBox.classList.add('hideBox');
|
15 |
showMask();
|
16 |
}
|
17 |
|
|
|
44 |
menu.classList.add('hideSide');
|
45 |
// menuBtn.classList.remove('active');
|
46 |
}
|
47 |
+
setChatAreaWidth();
|
48 |
}
|
49 |
|
50 |
function setHistroyPanel() {
|
web_assets/stylesheet/ChuanhuChat.css
CHANGED
@@ -159,19 +159,39 @@ body.popup-open {
|
|
159 |
.hideBox {
|
160 |
display: none;
|
161 |
}
|
|
|
162 |
.hideSide {
|
163 |
width: 0 !important;
|
|
|
164 |
display: none !important;
|
165 |
}
|
166 |
|
167 |
#chatbot-area {
|
168 |
-
transition:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
169 |
}
|
170 |
-
|
|
|
|
|
|
|
|
|
|
|
171 |
position: relative;
|
172 |
box-shadow: unset;
|
173 |
overflow: hidden;
|
174 |
-
}
|
175 |
.chuanhu-history-panel {
|
176 |
height: 500px;
|
177 |
overflow: auto;
|
|
|
159 |
.hideBox {
|
160 |
display: none;
|
161 |
}
|
162 |
+
|
163 |
.hideSide {
|
164 |
width: 0 !important;
|
165 |
+
/* flex-basis: 0 !important; */
|
166 |
display: none !important;
|
167 |
}
|
168 |
|
169 |
#chatbot-area {
|
170 |
+
transition: flex-basis 0.5s ease;
|
171 |
+
}
|
172 |
+
#chatbot-area, #menu-area, #toolbox-area {
|
173 |
+
/* flex: none;
|
174 |
+
flex-grow: unset !important;
|
175 |
+
width: auto;
|
176 |
+
min-width: unset !important;
|
177 |
+
transition: flex-basis 0.5s ease; */
|
178 |
+
}
|
179 |
+
#chatbot-area {
|
180 |
+
|
181 |
+
}
|
182 |
+
#menu-area {
|
183 |
+
|
184 |
}
|
185 |
+
#toolbox-area {
|
186 |
+
|
187 |
+
}
|
188 |
+
|
189 |
+
|
190 |
+
/* .chuanhu-history-panel ul.options {
|
191 |
position: relative;
|
192 |
box-shadow: unset;
|
193 |
overflow: hidden;
|
194 |
+
} */
|
195 |
.chuanhu-history-panel {
|
196 |
height: 500px;
|
197 |
overflow: auto;
|