assistants.php
3 years ago
chatbot-chatgpt.css
3 years ago
chatbot-chatgpt.scss
3 years ago
chatbot.php
3 years ago
chatbot_logs.php
3 years ago
chatbot-chatgpt.scss
617 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 | .mwai-open-button { |
| 13 | position: absolute; |
| 14 | right: 0; |
| 15 | bottom: 0; |
| 16 | transition: all 0.2s ease-out; |
| 17 | z-index: 9999; |
| 18 | display: flex; |
| 19 | flex-direction: column; |
| 20 | align-items: end; |
| 21 | |
| 22 | .mwai-icon-text { |
| 23 | background: var(--mwai-backgroundPrimaryColor); |
| 24 | color: var(--mwai-headerButtonsColor); |
| 25 | max-width: 200px; |
| 26 | font-size: 13px; |
| 27 | margin-bottom: 15px; |
| 28 | padding: 5px 10px; |
| 29 | border-radius: 8px; |
| 30 | } |
| 31 | |
| 32 | &:hover { |
| 33 | cursor: pointer; |
| 34 | filter: saturate(2.5) hue-rotate(5deg); |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | .mwai-content { |
| 39 | background: var(--mwai-backgroundSecondaryColor); |
| 40 | color: var(--mwai-fontColor); |
| 41 | font-size: var(--mwai-fontSize); |
| 42 | border-radius: var(--mwai-borderRadius); |
| 43 | overflow: hidden; |
| 44 | display: flex; |
| 45 | flex-direction: column; |
| 46 | } |
| 47 | |
| 48 | .mwai-conversation { |
| 49 | overflow: auto; |
| 50 | } |
| 51 | |
| 52 | * { |
| 53 | box-sizing: border-box; |
| 54 | } |
| 55 | |
| 56 | a { |
| 57 | color: #2196f3; |
| 58 | } |
| 59 | |
| 60 | h1 { |
| 61 | font-size: 200%; |
| 62 | } |
| 63 | |
| 64 | h2 { |
| 65 | font-size: 160%; |
| 66 | } |
| 67 | |
| 68 | h3 { |
| 69 | font-size: 140%; |
| 70 | } |
| 71 | |
| 72 | h4 { |
| 73 | font-size: 120%; |
| 74 | } |
| 75 | |
| 76 | pre { |
| 77 | color: var(--mwai-fontColor); |
| 78 | border-radius: var(--mwai-borderRadius); |
| 79 | padding: calc(var(--mwai-spacing) * 2 / 3) var(--mwai-spacing); |
| 80 | break-after: auto; |
| 81 | font-size: 95%; |
| 82 | font-family: system-ui; |
| 83 | background: #343541; |
| 84 | |
| 85 | code { |
| 86 | padding: 0 !important; |
| 87 | font-family: system-ui; |
| 88 | background: #343541; |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | ol { |
| 93 | padding: 0; |
| 94 | margin: 0 0 0 20px; |
| 95 | } |
| 96 | .mwai-reply { |
| 97 | display: flex; |
| 98 | padding: var(--mwai-spacing); |
| 99 | position: relative; |
| 100 | |
| 101 | .mwai-copy-button { |
| 102 | opacity: 0; |
| 103 | transition: all 0.3s ease-out; |
| 104 | width: 22px; |
| 105 | height: 22px; |
| 106 | position: absolute; |
| 107 | right: var(--mwai-spacing); |
| 108 | |
| 109 | .mwai-copy-button-one { |
| 110 | position: absolute; |
| 111 | width: 16px; |
| 112 | height: 16px; |
| 113 | margin-top: 0px; |
| 114 | margin-left: 0px; |
| 115 | background: white; |
| 116 | opacity: 0.4; |
| 117 | transition: all 0.2s ease-in; |
| 118 | cursor: pointer; |
| 119 | border-radius: 2px; |
| 120 | } |
| 121 | |
| 122 | .mwai-copy-button-two { |
| 123 | position: absolute; |
| 124 | width: 16px; |
| 125 | height: 16px; |
| 126 | margin-top: 6px; |
| 127 | margin-left: 6px; |
| 128 | background: white; |
| 129 | opacity: 0.6; |
| 130 | transition: all 0.2s ease-in; |
| 131 | cursor: pointer; |
| 132 | border-radius: 2px; |
| 133 | } |
| 134 | |
| 135 | &:hover { |
| 136 | .mwai-copy-button-one { |
| 137 | opacity: 0.6; |
| 138 | margin-top: 0px; |
| 139 | margin-left: 6px; |
| 140 | } |
| 141 | |
| 142 | .mwai-copy-button-two { |
| 143 | opacity: 1; |
| 144 | margin-top: 6px; |
| 145 | margin-left: 0px; |
| 146 | } |
| 147 | } |
| 148 | |
| 149 | &.mwai-animate { |
| 150 | |
| 151 | .mwai-copy-button-one { |
| 152 | opacity: 0; |
| 153 | } |
| 154 | |
| 155 | .mwai-copy-button-two { |
| 156 | width: 18px; |
| 157 | height: 18px; |
| 158 | margin-top: 2px; |
| 159 | margin-left: 2px; |
| 160 | opacity: 1; |
| 161 | } |
| 162 | } |
| 163 | } |
| 164 | |
| 165 | &:hover { |
| 166 | .mwai-copy-button { |
| 167 | display: block; |
| 168 | opacity: 1; |
| 169 | } |
| 170 | } |
| 171 | } |
| 172 | |
| 173 | .mwai-ai, .mwai-system { |
| 174 | background: var(--mwai-backgroundPrimaryColor); |
| 175 | } |
| 176 | |
| 177 | .mwai-name { |
| 178 | color: var(--mwai-fontColor); |
| 179 | margin-right: 5px; |
| 180 | |
| 181 | .mwai-name-text { |
| 182 | opacity: 0.50; |
| 183 | white-space: nowrap; |
| 184 | } |
| 185 | |
| 186 | .mwai-avatar { |
| 187 | margin-right: 10px; |
| 188 | width: 40px; |
| 189 | height: 40px; |
| 190 | background: var(--mwai-aiAvatarBackgroundColor); |
| 191 | display: flex; |
| 192 | align-items: center; |
| 193 | justify-content: center; |
| 194 | border-radius: 5px; |
| 195 | overflow: hidden; |
| 196 | |
| 197 | img { |
| 198 | max-width: 100%; |
| 199 | max-height: 100%; |
| 200 | } |
| 201 | |
| 202 | &.mwai-svg img { |
| 203 | width: 28px; |
| 204 | height: 28px; |
| 205 | filter: brightness(0) invert(1); |
| 206 | } |
| 207 | } |
| 208 | } |
| 209 | |
| 210 | .mwai-user { |
| 211 | |
| 212 | .mwai-name { |
| 213 | |
| 214 | .mwai-avatar { |
| 215 | background: var(--mwai-userAvatarBackgroundColor); |
| 216 | } |
| 217 | } |
| 218 | } |
| 219 | |
| 220 | .mwai-text { |
| 221 | flex: auto; |
| 222 | |
| 223 | *:first-child { |
| 224 | margin-top: 0; |
| 225 | } |
| 226 | |
| 227 | *:last-child { |
| 228 | margin-bottom: 0; |
| 229 | } |
| 230 | |
| 231 | table { |
| 232 | width: 100%; |
| 233 | border: 2px solid var(--mwai-backgroundSecondaryColor); |
| 234 | border-collapse: collapse |
| 235 | } |
| 236 | |
| 237 | thead { |
| 238 | background: var(--mwai-backgroundSecondaryColor); |
| 239 | } |
| 240 | |
| 241 | tr, td { |
| 242 | padding: 2px 5px; |
| 243 | } |
| 244 | |
| 245 | td { |
| 246 | border: 2px solid var(--mwai-backgroundSecondaryColor); |
| 247 | } |
| 248 | |
| 249 | .mwai-typewriter { |
| 250 | display: inline-block; |
| 251 | |
| 252 | > :first-child { |
| 253 | margin-top: 0; |
| 254 | } |
| 255 | } |
| 256 | |
| 257 | >* { |
| 258 | &:first-child { |
| 259 | margin-top: 0; |
| 260 | |
| 261 | } |
| 262 | &:last-child { |
| 263 | margin-bottom: 0; |
| 264 | } |
| 265 | } |
| 266 | } |
| 267 | |
| 268 | .mwai-system .mwai-name { |
| 269 | display: none; |
| 270 | } |
| 271 | |
| 272 | .mwai-input { |
| 273 | display: flex; |
| 274 | padding: var(--mwai-spacing); |
| 275 | border-top: 1px solid var(--mwai-backgroundPrimaryColor); |
| 276 | |
| 277 | textarea { |
| 278 | background: var(--mwai-backgroundPrimaryColor); |
| 279 | color: var(--mwai-fontColor); |
| 280 | flex: auto; |
| 281 | padding: calc(var(--mwai-spacing) / 2) var(--mwai-spacing); |
| 282 | border: none; |
| 283 | border-radius: 5px; |
| 284 | font-size: var(--mwai-fontSize); |
| 285 | resize: none; |
| 286 | font-family: inherit; |
| 287 | line-height: calc(var(--mwai-spacing) * 2); |
| 288 | margin: 0; |
| 289 | overflow: hidden; |
| 290 | |
| 291 | &:focus { |
| 292 | outline: none; |
| 293 | } |
| 294 | } |
| 295 | } |
| 296 | |
| 297 | .mwai-compliance { |
| 298 | opacity: 0.50; |
| 299 | margin-top: calc( -1 * var(--mwai-spacing)); |
| 300 | padding: calc(var(--mwai-spacing) / 1.5) var(--mwai-spacing); |
| 301 | font-size: smaller; |
| 302 | color: var(--mwai-fontColor); |
| 303 | text-align: left; |
| 304 | } |
| 305 | |
| 306 | button { |
| 307 | background: none; |
| 308 | color: var(--mwai-fontColor); |
| 309 | background-color: var(--mwai-backgroundSecondaryColor); |
| 310 | border: 1px solid var(--mwai-backgroundPrimaryColor); |
| 311 | margin-left: var(--mwai-spacing); |
| 312 | width: 90px; |
| 313 | border-radius: 5px; |
| 314 | cursor: pointer; |
| 315 | transition: all 0.2s ease-out; |
| 316 | display: flex; |
| 317 | align-items: center; |
| 318 | justify-content: center; |
| 319 | |
| 320 | .mwai-timer { |
| 321 | margin-left: 5px; |
| 322 | margin-right: 5px; |
| 323 | font-size: 11px; |
| 324 | } |
| 325 | |
| 326 | &:hover { |
| 327 | background: var(--mwai-backgroundPrimaryColor); |
| 328 | } |
| 329 | } |
| 330 | |
| 331 | button { |
| 332 | position: relative; |
| 333 | } |
| 334 | |
| 335 | button[disabled]] { |
| 336 | |
| 337 | span { |
| 338 | display: none; |
| 339 | } |
| 340 | |
| 341 | &::before { |
| 342 | content: ''; |
| 343 | width: 18px; |
| 344 | height: 18px; |
| 345 | margin: auto; |
| 346 | border: 3px solid transparent; |
| 347 | border-top-color: var(--mwai-fontColor); |
| 348 | border-radius: 50%; |
| 349 | animation: mwai-button-spinner 1s ease infinite; |
| 350 | } |
| 351 | } |
| 352 | } |
| 353 | |
| 354 | #mwai-chat-id.mwai-window { |
| 355 | position: fixed; |
| 356 | right: 30px; |
| 357 | bottom: 30px; |
| 358 | width: 460px; |
| 359 | z-index: 9999; |
| 360 | |
| 361 | .mwai-header { |
| 362 | display: none; |
| 363 | justify-content: flex-end; |
| 364 | align-items: center; |
| 365 | |
| 366 | .mwai-buttons { |
| 367 | display: flex; |
| 368 | align-items: center; |
| 369 | margin-bottom: 5px; |
| 370 | |
| 371 | .mwai-resize-button { |
| 372 | justify-content: center; |
| 373 | height: 32px; |
| 374 | width: 33px; |
| 375 | cursor: pointer; |
| 376 | display: flex; |
| 377 | justify-content: center; |
| 378 | align-items: center; |
| 379 | background-color: var(--mwai-backgroundSecondaryColor); |
| 380 | border-radius: var(--mwai-borderRadius); |
| 381 | |
| 382 | &:before { |
| 383 | transition: all 0.2s ease-out; |
| 384 | content: ' '; |
| 385 | cursor: pointer; |
| 386 | position: absolute; |
| 387 | height: 13px; |
| 388 | width: 13px; |
| 389 | opacity: 0.75; |
| 390 | border: 2px solid var(--mwai-headerButtonsColor); |
| 391 | } |
| 392 | |
| 393 | &:hover:before { |
| 394 | width: 16px; |
| 395 | height: 16px; |
| 396 | } |
| 397 | } |
| 398 | |
| 399 | .mwai-close-button { |
| 400 | margin-left: 5px; |
| 401 | justify-content: center; |
| 402 | height: 32px; |
| 403 | width: 33px; |
| 404 | cursor: pointer; |
| 405 | background-color: var(--mwai-backgroundSecondaryColor); |
| 406 | border-radius: var(--mwai-borderRadius); |
| 407 | |
| 408 | &:before { |
| 409 | transition: all 0.2s ease-out; |
| 410 | transform: translate(16px, 5px) rotate(45deg); |
| 411 | } |
| 412 | &:after { |
| 413 | transition: all 0.2s ease-out; |
| 414 | transform: translate(16px, 5px) rotate(-45deg); |
| 415 | } |
| 416 | } |
| 417 | |
| 418 | .mwai-close-button:before, .mwai-close-button:after { |
| 419 | content: ' '; |
| 420 | cursor: pointer; |
| 421 | position: absolute; |
| 422 | height: 22px; |
| 423 | width: 2px; |
| 424 | background-color: var(--mwai-headerButtonsColor); |
| 425 | opacity: 0.75; |
| 426 | } |
| 427 | |
| 428 | .mwai-close-button:hover { |
| 429 | &:before { |
| 430 | opacity: 1; |
| 431 | transform: translate(16px, 5px) rotate(135deg); |
| 432 | } |
| 433 | &:after { |
| 434 | opacity: 1; |
| 435 | transform: translate(16px, 5px) rotate(45deg); |
| 436 | } |
| 437 | } |
| 438 | |
| 439 | } |
| 440 | } |
| 441 | |
| 442 | .mwai-content { |
| 443 | display: none; |
| 444 | opacity: 0; |
| 445 | max-height: 40vh; |
| 446 | } |
| 447 | |
| 448 | &.mwai-bottom-left { |
| 449 | bottom: 30px; |
| 450 | right: inherit; |
| 451 | left: 30px; |
| 452 | |
| 453 | .mwai-open-button { |
| 454 | right: inherit; |
| 455 | left: 0; |
| 456 | } |
| 457 | } |
| 458 | |
| 459 | &.mwai-top-right { |
| 460 | top: 30px; |
| 461 | bottom: inherit; |
| 462 | right: 30px; |
| 463 | |
| 464 | .mwai-open-button { |
| 465 | top: 0; |
| 466 | bottom: inherit; |
| 467 | } |
| 468 | } |
| 469 | |
| 470 | &.mwai-top-left { |
| 471 | top: 30px; |
| 472 | bottom: inherit; |
| 473 | right: inherit; |
| 474 | left: 30px; |
| 475 | |
| 476 | .mwai-open-button { |
| 477 | top: 0; |
| 478 | bottom: inherit; |
| 479 | right: inherit; |
| 480 | left: 0; |
| 481 | } |
| 482 | } |
| 483 | } |
| 484 | |
| 485 | // GALLERY |
| 486 | |
| 487 | #mwai-chat-id .mwai-gallery { |
| 488 | display: grid; |
| 489 | grid-template-columns: repeat(3, 1fr); |
| 490 | grid-gap: 5px; |
| 491 | |
| 492 | img { |
| 493 | width: 100%; |
| 494 | } |
| 495 | } |
| 496 | |
| 497 | // FULLSCREEN & WINDOW |
| 498 | |
| 499 | #mwai-chat-id.mwai-window.mwai-fullscreen { |
| 500 | |
| 501 | .mwai-header { |
| 502 | |
| 503 | .mwai-buttons { |
| 504 | margin-bottom: 0px; |
| 505 | |
| 506 | .mwai-resize-button { |
| 507 | &:before { |
| 508 | width: 16px; |
| 509 | height: 16px; |
| 510 | } |
| 511 | |
| 512 | &:hover:before { |
| 513 | width: 13px; |
| 514 | height: 13px; |
| 515 | } |
| 516 | } |
| 517 | |
| 518 | .mwai-close-button { |
| 519 | margin-left: -5px; |
| 520 | } |
| 521 | } |
| 522 | } |
| 523 | } |
| 524 | |
| 525 | #mwai-chat-id.mwai-fullscreen:not(.mwai-window), #mwai-chat-id.mwai-fullscreen.mwai-window.mwai-open { |
| 526 | position: fixed; |
| 527 | left: 0 !important; |
| 528 | right: 0 !important; |
| 529 | bottom: 0 !important; |
| 530 | top: 0 !important; |
| 531 | width: inherit; |
| 532 | height: inherit; |
| 533 | max-height: inherit; |
| 534 | max-width: inherit; |
| 535 | display: flex; |
| 536 | flex-direction: column; |
| 537 | margin: 0; |
| 538 | z-index: 999999; |
| 539 | background-color: var(--mwai-backgroundSecondaryColor); |
| 540 | |
| 541 | .mwai-content { |
| 542 | height: 100%; |
| 543 | max-height: inherit; |
| 544 | border-radius: inherit; |
| 545 | |
| 546 | .mwai-conversation { |
| 547 | flex: auto; |
| 548 | } |
| 549 | } |
| 550 | } |
| 551 | |
| 552 | #mwai-chat-id.mwai-window.mwai-open { |
| 553 | |
| 554 | .mwai-header { |
| 555 | display: flex; |
| 556 | } |
| 557 | |
| 558 | .mwai-content { |
| 559 | display: flex; |
| 560 | transition: opacity 200ms ease-in-out 0s; |
| 561 | opacity: 1; |
| 562 | } |
| 563 | |
| 564 | .mwai-open-button { |
| 565 | display: none; |
| 566 | } |
| 567 | } |
| 568 | |
| 569 | @media (max-width: 760px) { |
| 570 | |
| 571 | #mwai-chat-id { |
| 572 | |
| 573 | &.mwai-window { |
| 574 | left: 10px; |
| 575 | right: 10px; |
| 576 | bottom: 10px; |
| 577 | width: calc(100% - 20px); |
| 578 | z-index: 9999999999; |
| 579 | } |
| 580 | |
| 581 | .mwai-reply { |
| 582 | flex-direction: column; |
| 583 | } |
| 584 | |
| 585 | .mwai-input { |
| 586 | flex-direction: column; |
| 587 | |
| 588 | button { |
| 589 | margin: 15px 0 0 0; |
| 590 | height: 40px; |
| 591 | width: inherit; |
| 592 | } |
| 593 | } |
| 594 | |
| 595 | .mwai-name { |
| 596 | margin-right: 0; |
| 597 | max-width: inherit; |
| 598 | } |
| 599 | } |
| 600 | } |
| 601 | |
| 602 | @keyframes mwai-button-spinner { |
| 603 | |
| 604 | from { |
| 605 | transform: rotate(0turn); |
| 606 | } |
| 607 | to { |
| 608 | transform: rotate(1turn); |
| 609 | } |
| 610 | } |
| 611 | |
| 612 | // WordPress Admin Bar |
| 613 | |
| 614 | .admin-bar #mwai-chat-id.mwai-fullscreen:not(.mwai-window), |
| 615 | .admin-bar #mwai-chat-id.mwai-fullscreen.mwai-window.mwai-open { |
| 616 | top: 32px; |
| 617 | } |