assistants.php
3 years ago
chatbot-chatgpt.css
3 years ago
chatbot-chatgpt.scss
3 years ago
chatbot.php
3 years ago
chatbot-chatgpt.css
416 lines
| 1 | #mwai-chat-id { |
| 2 | --mwai-spacing: 15px; |
| 3 | --mwai-fontSize: 15px; |
| 4 | --mwai-borderRadius: 10px; |
| 5 | --mwai-fontColor: #FFFFFF; |
| 6 | --mwai-backgroundPrimaryColor: #454654; |
| 7 | --mwai-backgroundSecondaryColor: #343541; |
| 8 | --mwai-aiAvatarBackgroundColor: #10a37f; |
| 9 | --mwai-userAvatarBackgroundColor: #135ea4; |
| 10 | --mwai-headerButtonsColor: #FFFFFF; |
| 11 | } |
| 12 | |
| 13 | #mwai-chat-id .mwai-open-button { |
| 14 | position: absolute; |
| 15 | right: 0; |
| 16 | bottom: 0; |
| 17 | transition: all 0.2s ease-out; |
| 18 | z-index: 9999; |
| 19 | } |
| 20 | |
| 21 | #mwai-chat-id .mwai-open-button:hover { |
| 22 | cursor: pointer; |
| 23 | filter: saturate(2.5) hue-rotate(5deg); |
| 24 | } |
| 25 | |
| 26 | #mwai-chat-id .mwai-content { |
| 27 | background: var(--mwai-backgroundSecondaryColor); |
| 28 | color: var(--mwai-fontColor); |
| 29 | font-size: var(--mwai-fontSize); |
| 30 | border-radius: var(--mwai-borderRadius); |
| 31 | overflow: hidden; |
| 32 | display: flex; |
| 33 | flex-direction: column; |
| 34 | } |
| 35 | |
| 36 | #mwai-chat-id .mwai-conversation { |
| 37 | overflow: auto; |
| 38 | } |
| 39 | |
| 40 | #mwai-chat-id * { |
| 41 | box-sizing: border-box; |
| 42 | } |
| 43 | |
| 44 | #mwai-chat-id a { |
| 45 | color: #2196f3; |
| 46 | } |
| 47 | |
| 48 | #mwai-chat-id h1 { |
| 49 | font-size: 200%; |
| 50 | } |
| 51 | |
| 52 | #mwai-chat-id h2 { |
| 53 | font-size: 160%; |
| 54 | } |
| 55 | |
| 56 | #mwai-chat-id h3 { |
| 57 | font-size: 140%; |
| 58 | } |
| 59 | |
| 60 | #mwai-chat-id h4 { |
| 61 | font-size: 120%; |
| 62 | } |
| 63 | |
| 64 | #mwai-chat-id pre { |
| 65 | color: var(--mwai-fontColor); |
| 66 | border-radius: var(--mwai-borderRadius); |
| 67 | padding: calc(var(--mwai-spacing) * 2 / 3) var(--mwai-spacing); |
| 68 | break-after: auto; |
| 69 | font-size: 95%; |
| 70 | font-family: system-ui; |
| 71 | background: #343541; |
| 72 | } |
| 73 | |
| 74 | #mwai-chat-id pre code { |
| 75 | padding: 0 !important; |
| 76 | font-family: system-ui; |
| 77 | background: #343541; |
| 78 | } |
| 79 | |
| 80 | #mwai-chat-id ol { |
| 81 | padding: 0; |
| 82 | margin: 0 0 0 20px; |
| 83 | } |
| 84 | |
| 85 | #mwai-chat-id .mwai-reply { |
| 86 | display: flex; |
| 87 | padding: var(--mwai-spacing); |
| 88 | } |
| 89 | |
| 90 | #mwai-chat-id .mwai-ai, #mwai-chat-id .mwai-system { |
| 91 | background: var(--mwai-backgroundPrimaryColor); |
| 92 | } |
| 93 | |
| 94 | #mwai-chat-id .mwai-name { |
| 95 | color: #a0a0a0; |
| 96 | margin-right: 20px; |
| 97 | } |
| 98 | |
| 99 | #mwai-chat-id .mwai-name .mwai-avatar { |
| 100 | width: 40px; |
| 101 | height: 40px; |
| 102 | background: var(--mwai-aiAvatarBackgroundColor); |
| 103 | display: flex; |
| 104 | align-items: center; |
| 105 | justify-content: center; |
| 106 | border-radius: 5px; |
| 107 | overflow: hidden; |
| 108 | } |
| 109 | |
| 110 | #mwai-chat-id .mwai-name .mwai-avatar img { |
| 111 | max-width: 100%; |
| 112 | max-height: 100%; |
| 113 | } |
| 114 | |
| 115 | #mwai-chat-id .mwai-name .mwai-avatar.mwai-svg img { |
| 116 | width: 28px; |
| 117 | height: 28px; |
| 118 | filter: brightness(0) invert(1); |
| 119 | } |
| 120 | |
| 121 | #mwai-chat-id .mwai-user .mwai-name .mwai-avatar { |
| 122 | background: var(--mwai-userAvatarBackgroundColor); |
| 123 | } |
| 124 | |
| 125 | #mwai-chat-id .mwai-text { |
| 126 | flex: auto; |
| 127 | } |
| 128 | |
| 129 | #mwai-chat-id .mwai-text > *:first-child { |
| 130 | margin-top: 0; |
| 131 | } |
| 132 | |
| 133 | #mwai-chat-id .mwai-text > *:last-child { |
| 134 | margin-bottom: 0; |
| 135 | } |
| 136 | |
| 137 | #mwai-chat-id .mwai-input { |
| 138 | display: flex; |
| 139 | padding: var(--mwai-spacing); |
| 140 | border-top: 1px solid var(--mwai-backgroundPrimaryColor); |
| 141 | } |
| 142 | |
| 143 | #mwai-chat-id .mwai-input textarea { |
| 144 | background: var(--mwai-backgroundPrimaryColor); |
| 145 | color: var(--mwai-fontColor); |
| 146 | flex: auto; |
| 147 | padding: calc(var(--mwai-spacing) / 2) var(--mwai-spacing); |
| 148 | border: none; |
| 149 | border-radius: 5px; |
| 150 | font-size: var(--mwai-fontSize); |
| 151 | resize: none; |
| 152 | font-family: inherit; |
| 153 | line-height: calc(var(--mwai-spacing) * 2); |
| 154 | } |
| 155 | |
| 156 | #mwai-chat-id .mwai-input textarea:focus { |
| 157 | outline: none; |
| 158 | } |
| 159 | |
| 160 | #mwai-chat-id .mwai-input button { |
| 161 | background: none; |
| 162 | color: var(--mwai-fontColor); |
| 163 | background-color: var(--mwai-backgroundSecondaryColor); |
| 164 | border: 1px solid var(--mwai-backgroundPrimaryColor); |
| 165 | margin-left: var(--mwai-spacing); |
| 166 | width: 80px; |
| 167 | border-radius: 5px; |
| 168 | cursor: pointer; |
| 169 | transition: all 0.2s ease-out; |
| 170 | max-height: 60px; |
| 171 | } |
| 172 | |
| 173 | #mwai-chat-id .mwai-input button:hover { |
| 174 | background: var(--mwai-backgroundPrimaryColor); |
| 175 | } |
| 176 | |
| 177 | #mwai-chat-id button { |
| 178 | position: relative; |
| 179 | } |
| 180 | |
| 181 | #mwai-chat-id button[disabled] span { |
| 182 | display: none; |
| 183 | } |
| 184 | |
| 185 | #mwai-chat-id button[disabled]::after { |
| 186 | content: ''; |
| 187 | position: absolute; |
| 188 | width: 18px; |
| 189 | height: 18px; |
| 190 | top: 0; |
| 191 | left: 0; |
| 192 | right: 0; |
| 193 | bottom: 0; |
| 194 | margin: auto; |
| 195 | border: 3px solid transparent; |
| 196 | border-top-color: var(--mwai-fontColor); |
| 197 | border-radius: 50%; |
| 198 | animation: mwai-button-spinner 1s ease infinite; |
| 199 | } |
| 200 | |
| 201 | #mwai-chat-id.mwai-window { |
| 202 | position: fixed; |
| 203 | right: 30px; |
| 204 | bottom: 30px; |
| 205 | width: 460px; |
| 206 | z-index: 9999; |
| 207 | } |
| 208 | |
| 209 | #mwai-chat-id.mwai-window .mwai-header { |
| 210 | display: none; |
| 211 | justify-content: flex-end; |
| 212 | align-items: center; |
| 213 | } |
| 214 | |
| 215 | #mwai-chat-id.mwai-window .mwai-header .mwai-resize-button { |
| 216 | justify-content: center; |
| 217 | height: 40px; |
| 218 | width: 36px; |
| 219 | cursor: pointer; |
| 220 | display: flex; |
| 221 | justify-content: center; |
| 222 | align-items: center; |
| 223 | } |
| 224 | |
| 225 | #mwai-chat-id.mwai-window .mwai-header .mwai-resize-button:before { |
| 226 | transition: all 0.2s ease-out; |
| 227 | content: ' '; |
| 228 | cursor: pointer; |
| 229 | position: absolute; |
| 230 | height: 15px; |
| 231 | width: 15px; |
| 232 | opacity: 0.75; |
| 233 | border: 2px solid var(--mwai-headerButtonsColor); |
| 234 | } |
| 235 | |
| 236 | #mwai-chat-id.mwai-window .mwai-header .mwai-resize-button:hover:before { |
| 237 | width: 20px; |
| 238 | height: 20px; |
| 239 | } |
| 240 | |
| 241 | #mwai-chat-id.mwai-window .mwai-header .mwai-close-button { |
| 242 | justify-content: center; |
| 243 | height: 40px; |
| 244 | width: 35px; |
| 245 | cursor: pointer; |
| 246 | } |
| 247 | |
| 248 | #mwai-chat-id.mwai-window .mwai-header .mwai-close-button:before, #mwai-chat-id.mwai-window .mwai-header .mwai-close-button:after { |
| 249 | content: ' '; |
| 250 | cursor: pointer; |
| 251 | position: absolute; |
| 252 | height: 30px; |
| 253 | width: 2px; |
| 254 | background-color: var(--mwai-headerButtonsColor); |
| 255 | opacity: 0.75; |
| 256 | } |
| 257 | |
| 258 | #mwai-chat-id.mwai-window .mwai-header .mwai-close-button:before { |
| 259 | transition: all 0.2s ease-out; |
| 260 | transform: translate(16px, 5px) rotate(45deg); |
| 261 | } |
| 262 | |
| 263 | #mwai-chat-id.mwai-window .mwai-header .mwai-close-button:after { |
| 264 | transition: all 0.2s ease-out; |
| 265 | transform: translate(16px, 5px) rotate(-45deg); |
| 266 | } |
| 267 | |
| 268 | #mwai-chat-id.mwai-window .mwai-header .mwai-close-button:hover:before { |
| 269 | opacity: 1; |
| 270 | transform: translate(16px, 5px) rotate(135deg); |
| 271 | } |
| 272 | |
| 273 | #mwai-chat-id.mwai-window .mwai-header .mwai-close-button:hover:after { |
| 274 | opacity: 1; |
| 275 | transform: translate(16px, 5px) rotate(45deg); |
| 276 | } |
| 277 | |
| 278 | #mwai-chat-id.mwai-window .mwai-content { |
| 279 | display: flex; |
| 280 | opacity: 0; |
| 281 | max-height: 40vh; |
| 282 | } |
| 283 | |
| 284 | #mwai-chat-id.mwai-window.mwai-bottom-left { |
| 285 | bottom: 30px; |
| 286 | right: inherit; |
| 287 | left: 30px; |
| 288 | } |
| 289 | |
| 290 | #mwai-chat-id.mwai-window.mwai-bottom-left .mwai-open-button { |
| 291 | right: inherit; |
| 292 | left: 0; |
| 293 | } |
| 294 | |
| 295 | #mwai-chat-id.mwai-window.mwai-top-right { |
| 296 | top: 30px; |
| 297 | bottom: inherit; |
| 298 | right: 30px; |
| 299 | } |
| 300 | |
| 301 | #mwai-chat-id.mwai-window.mwai-top-right .mwai-open-button { |
| 302 | top: 0; |
| 303 | bottom: inherit; |
| 304 | } |
| 305 | |
| 306 | #mwai-chat-id.mwai-window.mwai-top-left { |
| 307 | top: 30px; |
| 308 | bottom: inherit; |
| 309 | right: inherit; |
| 310 | left: 30px; |
| 311 | } |
| 312 | |
| 313 | #mwai-chat-id.mwai-window.mwai-top-left .mwai-open-button { |
| 314 | top: 0; |
| 315 | bottom: inherit; |
| 316 | right: inherit; |
| 317 | left: 0; |
| 318 | } |
| 319 | |
| 320 | #mwai-chat-id .mwai-gallery { |
| 321 | display: grid; |
| 322 | grid-template-columns: repeat(3, 1fr); |
| 323 | grid-gap: 5px; |
| 324 | } |
| 325 | |
| 326 | #mwai-chat-id .mwai-gallery img { |
| 327 | width: 100%; |
| 328 | } |
| 329 | |
| 330 | #mwai-chat-id.mwai-window.mwai-fullscreen .mwai-resize-button:before { |
| 331 | width: 20px; |
| 332 | height: 20px; |
| 333 | } |
| 334 | |
| 335 | #mwai-chat-id.mwai-window.mwai-fullscreen .mwai-resize-button:hover:before { |
| 336 | width: 15px; |
| 337 | height: 15px; |
| 338 | } |
| 339 | |
| 340 | #mwai-chat-id.mwai-fullscreen:not(.mwai-window), #mwai-chat-id.mwai-fullscreen.mwai-window.mwai-open { |
| 341 | position: fixed; |
| 342 | left: 0; |
| 343 | right: 0; |
| 344 | bottom: 0; |
| 345 | top: 0; |
| 346 | width: inherit; |
| 347 | height: inherit; |
| 348 | max-height: inherit; |
| 349 | max-width: inherit; |
| 350 | display: flex; |
| 351 | flex-direction: column; |
| 352 | margin: 0; |
| 353 | } |
| 354 | |
| 355 | #mwai-chat-id.mwai-fullscreen:not(.mwai-window) .mwai-content, #mwai-chat-id.mwai-fullscreen.mwai-window.mwai-open .mwai-content { |
| 356 | height: 100%; |
| 357 | max-height: inherit; |
| 358 | border-radius: inherit; |
| 359 | } |
| 360 | |
| 361 | #mwai-chat-id.mwai-fullscreen:not(.mwai-window) .mwai-content .mwai-conversation, #mwai-chat-id.mwai-fullscreen.mwai-window.mwai-open .mwai-content .mwai-conversation { |
| 362 | flex: auto; |
| 363 | } |
| 364 | |
| 365 | #mwai-chat-id.mwai-window.mwai-open .mwai-header { |
| 366 | display: flex; |
| 367 | } |
| 368 | |
| 369 | #mwai-chat-id.mwai-window.mwai-open .mwai-content { |
| 370 | display: flex; |
| 371 | transition: opacity 200ms ease-in-out 0s; |
| 372 | opacity: 1; |
| 373 | } |
| 374 | |
| 375 | #mwai-chat-id.mwai-window.mwai-open .mwai-open-button { |
| 376 | display: none; |
| 377 | } |
| 378 | |
| 379 | @media (max-width: 760px) { |
| 380 | #mwai-chat-id.mwai-window { |
| 381 | left: 10px; |
| 382 | right: 10px; |
| 383 | bottom: 10px; |
| 384 | width: inherit; |
| 385 | } |
| 386 | #mwai-chat-id .mwai-reply { |
| 387 | flex-direction: column; |
| 388 | } |
| 389 | #mwai-chat-id .mwai-input { |
| 390 | flex-direction: column; |
| 391 | } |
| 392 | #mwai-chat-id .mwai-input button { |
| 393 | margin: 15px 0 0 0; |
| 394 | height: 40px; |
| 395 | width: inherit; |
| 396 | } |
| 397 | #mwai-chat-id .mwai-name { |
| 398 | margin-right: 0; |
| 399 | max-width: inherit; |
| 400 | } |
| 401 | } |
| 402 | |
| 403 | @keyframes mwai-button-spinner { |
| 404 | from { |
| 405 | transform: rotate(0turn); |
| 406 | } |
| 407 | to { |
| 408 | transform: rotate(1turn); |
| 409 | } |
| 410 | } |
| 411 | |
| 412 | .admin-bar #mwai-chat-id.mwai-fullscreen:not(.mwai-window), |
| 413 | .admin-bar #mwai-chat-id.mwai-fullscreen.mwai-window.mwai-open { |
| 414 | top: 32px; |
| 415 | } |
| 416 |