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