Skip to content

Commit 2637337

Browse files
committed
fix(assistant): High-resolution icon for the assistant
1 parent 9e54a91 commit 2637337

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

frontend/public/assistant.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
;(function () {
1+
; (function () {
22
window.sqlbot_assistant_handler = window.sqlbot_assistant_handler || {}
33
const defaultData = {
44
id: '1',
@@ -170,6 +170,13 @@
170170
chat_button_img = root.querySelector('.sqlbot-assistant-chat-button > img')
171171
}
172172
chat_button_img.style.display = 'block'
173+
function resizeImg() {
174+
const rate = window.outerWidth / window.innerWidth;
175+
chat_button_img.style.width = `${30 * (1 / rate)}px`;
176+
chat_button_img.style.height = `${30 * (1 / rate)}px`;
177+
}
178+
resizeImg()
179+
window.addEventListener('resize', resizeImg);
173180
// 对话框元素
174181
const chat_container = root.querySelector('#sqlbot-assistant-chat-container')
175182
// 引导层

0 commit comments

Comments
 (0)