Skip to content

Commit 8dfd178

Browse files
made corners rounded
1 parent 582bb0c commit 8dfd178

File tree

1 file changed

+66
-1
lines changed

1 file changed

+66
-1
lines changed

src/js/chatbot.js

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,51 @@
1313
script.defer = true;
1414
document.head.appendChild(script);
1515

16-
// Add custom styles for purple color
16+
// Add custom styles for purple color and rounded corners
1717
const style = document.createElement('style');
1818
style.textContent = `
1919
#dify-chatbot-bubble-button {
2020
background-color: #4B39EF !important;
2121
bottom: 0.25rem !important;
2222
right: 0.25rem !important;
23+
border-radius: 50% !important;
24+
width: 50px !important;
25+
height: 50px !important;
26+
}
27+
28+
/* Make the main chat window background more translucent to show rounded corners */
29+
.dify-chatbot-widget #dify-chatbot-bubble-window {
30+
background-color: rgba(51, 51, 51, 0.6) !important;
31+
border-radius: 12px !important;
32+
overflow: hidden !important;
33+
}
34+
35+
/* Also target any main container backgrounds */
36+
.dify-chatbot-widget > div {
37+
background-color: rgba(51, 51, 51, 0.6) !important;
38+
border-radius: 12px !important;
39+
overflow: hidden !important;
40+
}
41+
42+
/* Target the main chat container */
43+
.dify-chatbot-widget .dify-chatbot-bubble-window {
44+
background-color: rgba(51, 51, 51, 0.6) !important;
45+
border-radius: 12px !important;
46+
overflow: hidden !important;
47+
}
48+
49+
/* Target any chat window elements */
50+
[id*="chat"], [class*="chat-window"], [class*="bubble-window"] {
51+
background-color: rgba(51, 51, 51, 0.6) !important;
52+
border-radius: 12px !important;
53+
overflow: hidden !important;
54+
}
55+
56+
/* Ensure the chat button is perfectly circular */
57+
[id*="bubble-button"], [class*="bubble-button"] {
58+
border-radius: 50% !important;
59+
width: 60px !important;
60+
height: 60px !important;
2361
}
2462
`;
2563
document.head.appendChild(style);
@@ -88,6 +126,33 @@
88126
element.style.left = 'auto';
89127
}
90128
});
129+
130+
// Make background elements more translucent to show rounded corners
131+
const allElements = document.querySelectorAll('.dify-chatbot-widget *');
132+
allElements.forEach(element => {
133+
const computedStyle = window.getComputedStyle(element);
134+
// Look for dark backgrounds that are likely the main content area
135+
if (computedStyle.backgroundColor &&
136+
(computedStyle.backgroundColor.includes('rgb(51, 51, 51)') ||
137+
computedStyle.backgroundColor.includes('rgb(64, 64, 64)') ||
138+
computedStyle.backgroundColor.includes('rgb(33, 33, 33)') ||
139+
computedStyle.backgroundColor.includes('#333333') ||
140+
computedStyle.backgroundColor.includes('#404040') ||
141+
computedStyle.backgroundColor.includes('#212121'))) {
142+
// Make it more translucent
143+
element.style.backgroundColor = 'rgba(51, 51, 51, 0.5)';
144+
element.style.borderRadius = '12px';
145+
element.style.overflow = 'hidden';
146+
}
147+
});
148+
149+
// Ensure chat button is circular
150+
const chatButtons = document.querySelectorAll('[id*="bubble-button"], [class*="bubble-button"]');
151+
chatButtons.forEach(button => {
152+
button.style.borderRadius = '50%';
153+
button.style.width = '60px';
154+
button.style.height = '60px';
155+
});
91156
}
92157

93158
// Apply positioning after script loads

0 commit comments

Comments
 (0)