Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
keras-team
GitHub Repository: keras-team/keras-io
Path: blob/master/theme/css/chatbot.css
17129 views
1
/* Prof. Keras Chatbot Widget */
2
3
/* Floating Action Button */
4
#keras-chatbot-btn {
5
align-items: center;
6
background: linear-gradient(135deg, #D00101, #A30000);
7
border: none;
8
border-radius: 50%;
9
bottom: 28px;
10
box-shadow: 0 4px 16px rgba(163, 0, 0, 0.4);
11
color: #fff;
12
cursor: pointer;
13
display: flex;
14
height: 60px;
15
justify-content: center;
16
position: fixed;
17
right: 28px;
18
transition: transform 0.2s ease, box-shadow 0.2s ease;
19
width: 60px;
20
z-index: 9998;
21
}
22
23
#keras-chatbot-btn:hover {
24
box-shadow: 0 6px 24px rgba(163, 0, 0, 0.5);
25
transform: scale(1.08);
26
}
27
28
#keras-chatbot-btn.chatbot-open {
29
transform: rotate(45deg) scale(1.08);
30
}
31
32
#keras-chatbot-btn svg {
33
fill: #fff;
34
height: 28px;
35
width: 28px;
36
transition: transform 0.2s ease;
37
}
38
39
#keras-chatbot-btn.chatbot-open svg {
40
transform: rotate(-45deg);
41
}
42
43
/* Chat Window */
44
#keras-chatbot-window {
45
background: #fff;
46
border: 1px solid #ddd;
47
border-radius: 16px;
48
bottom: 100px;
49
box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
50
display: none;
51
flex-direction: column;
52
height: 520px;
53
max-height: calc(100vh - 140px);
54
overflow: hidden;
55
position: fixed;
56
right: 28px;
57
width: 400px;
58
z-index: 9999;
59
}
60
61
#keras-chatbot-window.chatbot-visible {
62
display: flex;
63
animation: chatbot-slide-up 0.25s ease-out;
64
}
65
66
@keyframes chatbot-slide-up {
67
from {
68
opacity: 0;
69
transform: translateY(16px);
70
}
71
to {
72
opacity: 1;
73
transform: translateY(0);
74
}
75
}
76
77
/* Header */
78
.chatbot-header {
79
align-items: center;
80
background: linear-gradient(135deg, #D00101, #8A0000);
81
color: #fff;
82
display: flex;
83
flex-shrink: 0;
84
justify-content: space-between;
85
padding: 14px 18px;
86
}
87
88
.chatbot-header-title {
89
align-items: center;
90
display: flex;
91
font-family: 'Montserrat', 'Open Sans', sans-serif;
92
font-size: 1rem;
93
font-weight: 700;
94
gap: 8px;
95
letter-spacing: 0.3px;
96
}
97
98
.chatbot-header-title img {
99
border-radius: 50%;
100
height: 28px;
101
width: 28px;
102
}
103
104
.chatbot-header-subtitle {
105
font-size: 0.7rem;
106
font-weight: 400;
107
opacity: 0.85;
108
}
109
110
.chatbot-close-btn {
111
background: rgba(255, 255, 255, 0.15);
112
border: none;
113
border-radius: 50%;
114
color: #fff;
115
cursor: pointer;
116
font-size: 1.2rem;
117
height: 32px;
118
line-height: 1;
119
transition: background 0.2s;
120
width: 32px;
121
}
122
123
.chatbot-close-btn:hover {
124
background: rgba(255, 255, 255, 0.3);
125
}
126
127
/* Messages Area */
128
.chatbot-messages {
129
flex: 1;
130
overflow-y: auto;
131
padding: 16px;
132
scroll-behavior: smooth;
133
}
134
135
.chatbot-messages::-webkit-scrollbar {
136
width: 5px;
137
}
138
139
.chatbot-messages::-webkit-scrollbar-track {
140
background: transparent;
141
}
142
143
.chatbot-messages::-webkit-scrollbar-thumb {
144
background: #ccc;
145
border-radius: 3px;
146
}
147
148
/* Individual Message */
149
.chatbot-msg {
150
animation: chatbot-msg-in 0.2s ease-out;
151
margin-bottom: 12px;
152
max-width: 88%;
153
}
154
155
@keyframes chatbot-msg-in {
156
from {
157
opacity: 0;
158
transform: translateY(6px);
159
}
160
to {
161
opacity: 1;
162
transform: translateY(0);
163
}
164
}
165
166
.chatbot-msg-user {
167
margin-left: auto;
168
}
169
170
.chatbot-msg-bot {
171
margin-right: auto;
172
}
173
174
.chatbot-msg-bubble {
175
border-radius: 14px;
176
font-family: 'Montserrat', 'Open Sans', sans-serif;
177
font-size: 0.85rem;
178
line-height: 1.55;
179
padding: 10px 14px;
180
word-wrap: break-word;
181
overflow-wrap: break-word;
182
}
183
184
.chatbot-msg-user .chatbot-msg-bubble {
185
background: #292321;
186
border-bottom-right-radius: 4px;
187
color: #fff;
188
}
189
190
.chatbot-msg-bot .chatbot-msg-bubble {
191
background: #F3F3F3;
192
border-bottom-left-radius: 4px;
193
color: #292321;
194
}
195
196
/* Bot message content styling */
197
.chatbot-msg-bot .chatbot-msg-bubble p {
198
margin: 0 0 8px 0;
199
}
200
201
.chatbot-msg-bot .chatbot-msg-bubble p:last-child {
202
margin-bottom: 0;
203
}
204
205
.chatbot-msg-bot .chatbot-msg-bubble code {
206
background: rgba(163, 0, 0, 0.08);
207
border-radius: 3px;
208
color: #A30000;
209
font-family: 'Roboto Mono', monospace;
210
font-size: 0.8rem;
211
padding: 1px 5px;
212
}
213
214
.chatbot-msg-bot .chatbot-msg-bubble pre {
215
background: #292321;
216
border-radius: 8px;
217
margin: 8px 0;
218
overflow-x: auto;
219
padding: 10px 12px;
220
}
221
222
.chatbot-msg-bot .chatbot-msg-bubble pre code {
223
background: none;
224
color: #ccc;
225
font-size: 0.78rem;
226
padding: 0;
227
}
228
229
.chatbot-msg-bot .chatbot-msg-bubble a {
230
color: #A30000;
231
text-decoration: underline;
232
}
233
234
.chatbot-msg-bot .chatbot-msg-bubble a:hover {
235
color: #D00101;
236
}
237
238
.chatbot-msg-bot .chatbot-msg-bubble ul,
239
.chatbot-msg-bot .chatbot-msg-bubble ol {
240
margin: 4px 0 8px 0;
241
padding-left: 20px;
242
}
243
244
.chatbot-msg-bot .chatbot-msg-bubble li {
245
margin-bottom: 2px;
246
}
247
248
.chatbot-msg-bot .chatbot-msg-bubble strong {
249
font-weight: 700;
250
}
251
252
/* Typing Indicator */
253
.chatbot-typing-indicator {
254
align-items: center;
255
display: flex;
256
gap: 4px;
257
padding: 4px 0;
258
}
259
260
.chatbot-typing-indicator span {
261
animation: chatbot-bounce 1.2s infinite;
262
background: #999;
263
border-radius: 50%;
264
display: block;
265
height: 7px;
266
width: 7px;
267
}
268
269
.chatbot-typing-indicator span:nth-child(2) {
270
animation-delay: 0.15s;
271
}
272
273
.chatbot-typing-indicator span:nth-child(3) {
274
animation-delay: 0.3s;
275
}
276
277
@keyframes chatbot-bounce {
278
0%, 60%, 100% {
279
transform: translateY(0);
280
}
281
30% {
282
transform: translateY(-6px);
283
}
284
}
285
286
/* Input Area */
287
.chatbot-input-area {
288
border-top: 1px solid #E7E7E7;
289
display: flex;
290
flex-shrink: 0;
291
gap: 8px;
292
padding: 12px 14px;
293
}
294
295
.chatbot-input {
296
background: #F3F3F3;
297
border: 1px solid #ddd;
298
border-radius: 20px;
299
color: #292321;
300
flex: 1;
301
font-family: 'Montserrat', 'Open Sans', sans-serif;
302
font-size: 0.85rem;
303
outline: none;
304
padding: 10px 16px;
305
transition: border-color 0.2s;
306
}
307
308
.chatbot-input:focus {
309
border-color: #A30000;
310
box-shadow: 0 0 0 2px rgba(163, 0, 0, 0.1);
311
}
312
313
.chatbot-input::placeholder {
314
color: #999;
315
}
316
317
.chatbot-send-btn {
318
align-items: center;
319
background: linear-gradient(135deg, #D00101, #A30000);
320
border: none;
321
border-radius: 50%;
322
color: #fff;
323
cursor: pointer;
324
display: flex;
325
flex-shrink: 0;
326
height: 40px;
327
justify-content: center;
328
transition: transform 0.15s, opacity 0.15s;
329
width: 40px;
330
}
331
332
.chatbot-send-btn:hover {
333
transform: scale(1.05);
334
}
335
336
.chatbot-send-btn:disabled {
337
cursor: not-allowed;
338
opacity: 0.5;
339
}
340
341
.chatbot-send-btn svg {
342
fill: #fff;
343
height: 18px;
344
width: 18px;
345
}
346
347
/* Error message */
348
.chatbot-error {
349
color: #A30000;
350
font-size: 0.78rem;
351
font-style: italic;
352
}
353
354
/* Powered-by footer */
355
.chatbot-powered {
356
color: #999;
357
font-size: 0.65rem;
358
padding: 0 14px 8px;
359
text-align: center;
360
}
361
362
/* Mobile Responsive */
363
@media screen and (max-width: 500px) {
364
#keras-chatbot-window {
365
border-radius: 0;
366
bottom: 0;
367
height: 100%;
368
left: 0;
369
max-height: 100vh;
370
right: 0;
371
width: 100%;
372
}
373
374
#keras-chatbot-btn {
375
bottom: 16px;
376
height: 52px;
377
right: 16px;
378
width: 52px;
379
}
380
381
#keras-chatbot-btn svg {
382
height: 24px;
383
width: 24px;
384
}
385
}
386
387