@quasiris/qsc-chatbot-ui
Version:
A plugin that injects a Chatbot UI with WS/REST support
322 lines (313 loc) • 6.3 kB
CSS
.chatbotContainer {
position: fixed;
bottom: 24px;
right: 24px;
z-index: 9999;
transition: transform 0.3s ease;
}
.toggleButton {
position: relative;
background: #0078d4;
color: white;
border: none;
border-radius: 50%;
width: 64px;
height: 64px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
transition: all 0.3s ease;
font-weight: 600;
font-size: 18px;
}
.toggleButton:hover {
transform: scale(1.05);
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}
.jumpLoop {
animation: smoothJump 1s ease-in-out infinite;
}
@keyframes smoothJump {
0%, 100% { transform: translateY(0); }
50% { transform: translateY(-5px); }
}
.toggleButton img.jumpLoop {
width: 50px;
height: 50px;
border-radius: 50%;
object-fit: cover;
animation: smoothJump 1s ease-in-out infinite;
}
.toggleButton .qsc-span.jumpLoop {
display: inline-block;
animation: smoothJump 1s ease-in-out infinite;
font-size: 24px;
}
.chatWindow {
background: #fff;
border-radius: 12px;
box-shadow: 0 4px 20px rgba(0,0,0,0.1);
width: 380px;
height: 480px;
display: flex;
flex-direction: column;
overflow: hidden;
transform: translateY(20px);
opacity: 1;
animation: fadeInUp 0.3s ease forwards;
}
@keyframes fadeInUp {
to {
opacity: 1;
transform: translateY(0);
}
}
.fullscreen {
width: 100vw ;
height: 100vh ;
border-radius: 0 ;
position: fixed ;
top: 0; left: 0; right: 0; bottom: 0;
z-index: 2147483647 ;
}
.minimized {
min-height: 0 ;
overflow: hidden ;
}
.header {
background: #0078d4;
color: white;
padding: 16px 20px;
display: flex;
align-items: center;
justify-content: space-between;
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
z-index: 10;
}
.headerTitle {
font-weight: 600;
font-size: 18px;
}
.attachBtn {
background: transparent;
border: none;
cursor: pointer;
}
.attachBtn:hover {
background: rgba(0,0,0,0.04);
}
.headerRight, .headerControls {
display: flex;
align-items: center;
gap: 12px;
}
.closeButton, .fullscreenBtn, .minimizeBtn {
background: transparent;
border: none;
color: white;
cursor: pointer;
width: 36px;
height: 36px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 20px;
font-weight: 300;
transition: background 0.2s;
}
.closeButton:hover, .fullscreenBtn:hover, .minimizeBtn:hover {
background: rgba(255,255,255,0.2);
}
.connectionStatus {
display: flex;
align-items: center;
gap: 8px;
font-size: 12px;
opacity: 0.9;
background: rgba(0, 0, 0, 0.2);
padding: 4px 8px;
border-radius: 20px;
}
.statusDot {
width: 8px;
height: 8px;
border-radius: 50%;
}
.statusConnected { background: #107c10; }
.statusConnecting { background: #ffb900; animation: pulse 1.5s infinite; }
.statusError { background: #a80000; }
@keyframes pulse {
0% { opacity: 1; }
50% { opacity: 0.4; }
100% { opacity: 1; }
}
.messages {
flex: 1;
overflow-y: auto;
padding: 20px;
display: flex;
flex-direction: column;
gap: 20px;
background: #f5f5f5;
}
.messageRow { display: flex; }
.botRow { justify-content: flex-start; }
.userRow { justify-content: flex-end; }
.systemRow { justify-content: center; }
.bubble {
padding: 14px 18px;
border-radius: 18px;
max-width: 85%;
position: relative;
box-shadow: 0 2px 8px rgba(0,0,0,0.05);
line-height: 1.5;
animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(10px); }
to { opacity: 1; transform: translateY(0); }
}
.userBubble {
background: #0078d4;
color: white;
border-bottom-right-radius: 4px;
}
.botBubble {
background: #fff;
color: #323130;
border-bottom-left-radius: 4px;
border: 1px solid rgba(0,0,0,0.05);
}
.systemBubble {
background: #fff8e1;
color: #856404;
border-radius: 12px;
display: flex;
align-items: center;
gap: 10px;
max-width: 90%;
}
.systemIcon { font-size: 18px; }
.messageText { flex: 1; }
:global(pre.markdown) {
background: #fff;
padding: 10px;
font-family: monospace;
white-space: pre-wrap;
max-width: 100%;
overflow-x: auto;
color: black ;
}
.timestamp {
font-size: 11px;
color: #605e5c;
margin-top: 6px;
text-align: right;
}
.userBubble .timestamp { color: rgba(255,255,255,0.7); }
.systemBubble .timestamp { text-align: right; }
.inputArea {
display: flex;
border-top: 1px solid rgba(0,0,0,0.08);
padding: 16px;
background: #fff;
gap: 10px;
}
.input {
flex: 1;
border: 1px solid rgba(0,0,0,0.1);
border-radius: 24px;
padding: 12px 18px;
font-size: 15px;
background: #f5f5f5;
color: #323130;
transition: border 0.2s;
}
.input:focus {
outline: none;
border-color: #0078d4;
box-shadow: 0 0 0 3px rgba(0,120,212,0.2);
}
.sendButton {
background: #0078d4;
color: white;
border: none;
border-radius: 50%;
width: 44px;
height: 44px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: background 0.2s, transform 0.2s;
}
.sendButton:hover {
background: #106ebe;
transform: scale(1.05);
}
.sendButton:active {
transform: scale(0.95);
}
.sendIcon {
width: 20px;
height: 20px;
}
.broadcastPopup {
position: fixed;
bottom: 100px;
right: 40px;
background: #fff8e1;
color: #856404;
padding: 14px 20px;
border-radius: 12px;
box-shadow: 0 4px 20px rgba(0,0,0,0.1);
font-size: 14px;
z-index: 10000;
display: flex;
align-items: center;
gap: 10px;
max-width: 300px;
transition: opacity 0.5s ease;
border-left: 4px solid #ffb900;
}
.broadcastIcon {
min-width: 24px;
height: 24px;
background: #ffb900;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-weight: bold;
color: #856404;
}
.fadeOut {
opacity: 0;
}
@media (max-width: 480px) {
.chatbotContainer {
bottom: 16px;
right: 16px;
}
.chatWindow {
width: 100vw;
height: 100vh;
border-radius: 0;
bottom: 0;
right: 0;
position: fixed;
}
.broadcastPopup {
bottom: 90px;
right: 20px;
left: 20px;
max-width: none;
}
.fullscreenBtn,
.minimizeBtn {
display: none ;
}
}