most-family-63466
06/25/2025, 1:34 AMmost-family-63466
06/25/2025, 2:06 AMbig-wire-17689
06/25/2025, 8:40 AMmost-family-63466
06/25/2025, 3:20 PMbig-wire-17689
06/25/2025, 4:57 PMmost-family-63466
06/25/2025, 5:10 PMmost-family-63466
06/25/2025, 5:36 PMjavascript
const messages = [
"👋 Hi! Need help with computer issues?",
"I can help troubleshoot technical problems instantly! 💻",
];
// ####################################################
// just some logic for the animations for the chat bubbles but they coould just be static
useEffect(() => {
if (!isMounted || !showBubbles) return;
const timeouts: NodeJS.Timeout[] = [];
messages.forEach((_, index) => {
const timeout = setTimeout(() => {
setVisibleMessages((prev) => [...prev, index]);
}, index * 1500);
timeouts.push(timeout);
});
return () => {
timeouts.forEach((timeout) => clearTimeout(timeout));
};
}, [isMounted, showBubbles, messages.length]);
//######################################################
{showBubbles && (
<div id="chatbase-message-bubbles">
<div className="close-button" onClick={closeBubbles}>
✕
</div>
{visibleMessages.map((messageIndex) => (
<div key={messageIndex} className="message-bubble-container">
<div className="message-bubble" onClick={toggleWebchat}>
{messages[messageIndex]}
</div>
</div>
))}
</div>
)}most-family-63466
06/25/2025, 5:36 PMcss
/* Message bubbles container */
#chatbase-message-bubbles {
position: fixed;
bottom: 85px;
right: 1rem;
border-radius: 10px;
font-family: sans-serif;
font-size: 16px;
z-index: 2147483644;
cursor: pointer;
flex-direction: column;
gap: 8px;
max-width: 70vw;
display: block;
}
/* Close button */
.close-button {
position: absolute;
top: -7px;
right: -7px;
font-weight: bold;
display: flex;
justify-content: center;
align-items: center;
z-index: 2147483645;
width: 22px;
height: 22px;
border-radius: 50%;
text-align: center;
font-size: 12px;
cursor: pointer;
background-color: rgb(224, 224, 224);
color: black;
box-shadow: rgba(150, 150, 150, 0.15) 0px 6px 24px 0px,
rgba(150, 150, 150, 0.15) 0px 0px 0px 1px;
transition: all 0.2s ease;
}
.close-button:hover {
background-color: rgb(200, 200, 200);
transform: scale(1.1);
}most-family-63466
06/25/2025, 5:36 PMcss
/* Message bubble container */
.message-bubble-container {
display: flex;
justify-content: flex-end;
margin: 8px 0;
}
/* Individual message bubble */
.message-bubble {
background-color: white;
color: black;
box-shadow: rgba(150, 150, 150, 0.2) 0px 10px 30px 0px,
rgba(150, 150, 150, 0.2) 0px 0px 0px 1px;
border-radius: 10px;
padding: 20px;
margin: 8px;
font-size: 14px;
opacity: 1;
transform: scale(1);
transition: opacity 0.5s ease, transform 0.5s ease,
box-shadow 0.3s ease;
cursor: pointer;
animation: messageSlideIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
max-width: 280px;
}
.message-bubble:hover {
transform: scale(1.02) translateY(-2px);
box-shadow: rgba(150, 150, 150, 0.3) 0px 15px 40px 0px,
rgba(150, 150, 150, 0.3) 0px 0px 0px 1px;
}
/* Animation keyframes */
@keyframes messageSlideIn {
0% {
opacity: 0;
transform: translateY(20px) scale(0.9);
}
100% {
opacity: 1;
transform: translateY(0) scale(1);
}
}
/* Responsive design */
@media (max-width: 768px) {
#chatbase-message-bubbles {
max-width: 85vw;
right: 0.5rem;
}
.message-bubble {
max-width: 240px;
padding: 16px;
font-size: 13px;
}
}most-family-63466
06/25/2025, 5:36 PM