_codeDark.scss
2 years ago
_codeLight.scss
2 years ago
_common.scss
2 years ago
_copybutton.scss
2 years ago
chatgpt.scss
2 years ago
messages.scss
2 years ago
_common.scss
521 lines
| 1 | // main: chatgpt.scss, messages.scss |
| 2 | |
| 3 | @mixin file-upload-icon-sprites { |
| 4 | $icon-size: 32px; |
| 5 | |
| 6 | &.mwai-idle-add { |
| 7 | background-position: -1 * $icon-size -3 * $icon-size; |
| 8 | } |
| 9 | |
| 10 | &.mwai-image-add { |
| 11 | background-position: -1 * $icon-size -0 * $icon-size; |
| 12 | } |
| 13 | |
| 14 | &.mwai-image-up { |
| 15 | background-position: -2 * $icon-size -0 * $icon-size; |
| 16 | } |
| 17 | |
| 18 | &.mwai-image-del { |
| 19 | background-position: -3 * $icon-size -0 * $icon-size; |
| 20 | } |
| 21 | |
| 22 | &.mwai-image-ok { |
| 23 | background-position: -4 * $icon-size -0 * $icon-size; |
| 24 | } |
| 25 | |
| 26 | &.mwai-document-add { |
| 27 | background-position: -1 * $icon-size -2 * $icon-size; |
| 28 | } |
| 29 | |
| 30 | &.mwai-document-up { |
| 31 | background-position: -2 * $icon-size -2 * $icon-size; |
| 32 | } |
| 33 | |
| 34 | &.mwai-document-del { |
| 35 | background-position: -3 * $icon-size -2 * $icon-size; |
| 36 | } |
| 37 | |
| 38 | &.mwai-document-ok { |
| 39 | background-position: -4 * $icon-size -2 * $icon-size; |
| 40 | } |
| 41 | |
| 42 | .mwai-file-upload-progress { |
| 43 | position: absolute; |
| 44 | font-size: 8px; |
| 45 | width: 21px; |
| 46 | top: 24px; |
| 47 | left: 23px; |
| 48 | overflow: hidden; |
| 49 | text-align: center; |
| 50 | font-weight: bold; |
| 51 | color: white; |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | @mixin microphone { |
| 56 | |
| 57 | width: 32px; |
| 58 | height: 32px; |
| 59 | |
| 60 | svg { |
| 61 | width: 32px; |
| 62 | height: 32px; |
| 63 | fill: var(--mwai-fontColor); |
| 64 | opacity: 0.5; |
| 65 | filter: grayscale(100%); |
| 66 | transition: opacity 0.3s ease-out; |
| 67 | padding: 5px 10px; |
| 68 | cursor: pointer; |
| 69 | } |
| 70 | |
| 71 | &[active=true]=true] svg { |
| 72 | opacity: 1; |
| 73 | } |
| 74 | |
| 75 | &[disabled]] svg { |
| 76 | opacity: 0; |
| 77 | cursor: not-allowed; |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | @mixin fullscreen-window { |
| 82 | position: fixed; |
| 83 | left: 0 !important; |
| 84 | right: 0 !important; |
| 85 | bottom: 0 !important; |
| 86 | top: 0 !important; |
| 87 | width: inherit; |
| 88 | height: inherit; |
| 89 | max-height: inherit; |
| 90 | max-width: inherit; |
| 91 | display: flex; |
| 92 | flex-direction: column; |
| 93 | margin: 0; |
| 94 | z-index: 999999; |
| 95 | background-color: var(--mwai-backgroundSecondaryColor); |
| 96 | |
| 97 | .mwai-header { |
| 98 | border-radius: 0; |
| 99 | } |
| 100 | |
| 101 | .mwai-content { |
| 102 | height: 100%; |
| 103 | max-height: inherit; |
| 104 | border-radius: 0; |
| 105 | |
| 106 | .mwai-conversation { |
| 107 | flex: auto; |
| 108 | max-height: none; |
| 109 | } |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | @mixin common-styles { |
| 114 | |
| 115 | // Transitions |
| 116 | |
| 117 | &.mwai-transition, .mwai-transition { |
| 118 | opacity: 0; |
| 119 | transition: opacity 350ms ease-in-out; |
| 120 | } |
| 121 | |
| 122 | &.mwai-transition-visible, .mwai-transition-visible { |
| 123 | opacity: 1; |
| 124 | } |
| 125 | |
| 126 | .mwai-text { |
| 127 | |
| 128 | img { |
| 129 | max-width: 100%; |
| 130 | } |
| 131 | |
| 132 | div { |
| 133 | p:first-child { |
| 134 | margin-top: 0; |
| 135 | } |
| 136 | p:last-child { |
| 137 | margin-bottom: 0; |
| 138 | } |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | // The icon when the chat window is closed. |
| 143 | |
| 144 | .mwai-trigger { |
| 145 | position: absolute; |
| 146 | right: 0; |
| 147 | bottom: 0; |
| 148 | transition: all 0.2s ease-out; |
| 149 | z-index: 9999; |
| 150 | display: flex; |
| 151 | flex-direction: column; |
| 152 | align-items: end; |
| 153 | |
| 154 | .mwai-icon-text-container { |
| 155 | display: flex; |
| 156 | flex-direction: column; |
| 157 | align-items: flex-end; |
| 158 | |
| 159 | .mwai-icon-text { |
| 160 | background: var(--mwai-iconTextBackgroundColor); |
| 161 | color: var(--mwai-iconTextColor); |
| 162 | box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.15); |
| 163 | max-width: 200px; |
| 164 | font-size: 13px; |
| 165 | margin-bottom: 15px; |
| 166 | padding: 10px 15px; |
| 167 | border-radius: 8px; |
| 168 | } |
| 169 | |
| 170 | .mwai-icon-text-close { |
| 171 | color: var(--mwai-iconTextColor); |
| 172 | background: var(--mwai-iconTextBackgroundColor); |
| 173 | padding: 5px; |
| 174 | width: 20px; |
| 175 | height: 20px; |
| 176 | border-radius: 100%; |
| 177 | display: none; |
| 178 | justify-content: center; |
| 179 | align-items: center; |
| 180 | margin-bottom: 3px; |
| 181 | } |
| 182 | |
| 183 | &:hover { |
| 184 | cursor: pointer; |
| 185 | |
| 186 | .mwai-icon-text-close { |
| 187 | display: flex; |
| 188 | font-size: 12px; |
| 189 | |
| 190 | &:hover { |
| 191 | filter: brightness(1.2); |
| 192 | } |
| 193 | } |
| 194 | } |
| 195 | |
| 196 | @media (max-width: 760px) { |
| 197 | .mwai-icon-text-close { |
| 198 | display: flex; |
| 199 | } |
| 200 | } |
| 201 | |
| 202 | } |
| 203 | |
| 204 | .mwai-icon-container { |
| 205 | |
| 206 | .mwai-icon { |
| 207 | filter: drop-shadow(0px 0px 15px rgba(0, 0, 0, 0.15)); |
| 208 | transition: all 0.2s ease-out; |
| 209 | |
| 210 | &:hover { |
| 211 | cursor: pointer; |
| 212 | transform: scale(1.05); |
| 213 | } |
| 214 | } |
| 215 | } |
| 216 | } |
| 217 | |
| 218 | // Handle the chat window and fullscreen. |
| 219 | // Let's keep this common for all themes. |
| 220 | |
| 221 | &.mwai-window { |
| 222 | position: fixed; |
| 223 | right: 30px; |
| 224 | bottom: 30px; |
| 225 | width: var(--mwai-width); |
| 226 | z-index: 9999; |
| 227 | |
| 228 | .mwai-header { |
| 229 | display: none; |
| 230 | justify-content: flex-end; |
| 231 | align-items: center; |
| 232 | border-radius: var(--mwai-borderRadius) var(--mwai-borderRadius) 0 0; |
| 233 | background: var(--mwai-backgroundHeaderColor); |
| 234 | |
| 235 | .mwai-buttons { |
| 236 | display: flex; |
| 237 | align-items: center; |
| 238 | |
| 239 | .mwai-resize-button { |
| 240 | justify-content: center; |
| 241 | height: 32px; |
| 242 | width: 22px; |
| 243 | cursor: pointer; |
| 244 | display: flex; |
| 245 | justify-content: center; |
| 246 | align-items: center; |
| 247 | |
| 248 | &:before { |
| 249 | transition: all 0.2s ease-out; |
| 250 | content: ' '; |
| 251 | cursor: pointer; |
| 252 | position: absolute; |
| 253 | height: 13px; |
| 254 | width: 13px; |
| 255 | border: 1px solid var(--mwai-headerButtonsColor); |
| 256 | } |
| 257 | |
| 258 | &:hover:before { |
| 259 | width: 16px; |
| 260 | height: 16px; |
| 261 | } |
| 262 | } |
| 263 | |
| 264 | .mwai-close-button { |
| 265 | justify-content: center; |
| 266 | height: 32px; |
| 267 | width: 33px; |
| 268 | cursor: pointer; |
| 269 | border-radius: var(--mwai-borderRadius); |
| 270 | |
| 271 | &:before { |
| 272 | transition: all 0.2s ease-out; |
| 273 | transform: translate(16px, 5px) rotate(45deg); |
| 274 | } |
| 275 | &:after { |
| 276 | transition: all 0.2s ease-out; |
| 277 | transform: translate(16px, 5px) rotate(-45deg); |
| 278 | } |
| 279 | } |
| 280 | |
| 281 | .mwai-close-button:before, .mwai-close-button:after { |
| 282 | content: ' '; |
| 283 | cursor: pointer; |
| 284 | position: absolute; |
| 285 | height: 22px; |
| 286 | width: 1px; |
| 287 | background-color: var(--mwai-headerButtonsColor); |
| 288 | } |
| 289 | |
| 290 | .mwai-close-button:hover { |
| 291 | &:before { |
| 292 | opacity: 1; |
| 293 | transform: translate(16px, 5px) rotate(135deg); |
| 294 | } |
| 295 | &:after { |
| 296 | opacity: 1; |
| 297 | transform: translate(16px, 5px) rotate(45deg); |
| 298 | } |
| 299 | } |
| 300 | |
| 301 | } |
| 302 | } |
| 303 | |
| 304 | .mwai-content { |
| 305 | display: none; |
| 306 | opacity: 0; |
| 307 | max-height: var(--mwai-maxHeight); |
| 308 | border-radius: 0 0 var(--mwai-borderRadius) var(--mwai-borderRadius); |
| 309 | overflow: hidden; |
| 310 | } |
| 311 | |
| 312 | &.mwai-bottom-left { |
| 313 | bottom: 30px; |
| 314 | right: inherit; |
| 315 | left: 30px; |
| 316 | |
| 317 | .mwai-open-button { |
| 318 | right: inherit; |
| 319 | left: 0; |
| 320 | } |
| 321 | } |
| 322 | |
| 323 | &.mwai-top-right { |
| 324 | top: 30px; |
| 325 | bottom: inherit; |
| 326 | right: 30px; |
| 327 | |
| 328 | .mwai-open-button { |
| 329 | top: 0; |
| 330 | bottom: inherit; |
| 331 | } |
| 332 | } |
| 333 | |
| 334 | &.mwai-top-left { |
| 335 | top: 30px; |
| 336 | bottom: inherit; |
| 337 | right: inherit; |
| 338 | left: 30px; |
| 339 | |
| 340 | .mwai-open-button { |
| 341 | top: 0; |
| 342 | bottom: inherit; |
| 343 | right: inherit; |
| 344 | left: 0; |
| 345 | } |
| 346 | } |
| 347 | |
| 348 | &.mwai-top-left, &.mwai-bottom-left { |
| 349 | |
| 350 | .mwai-open-button { |
| 351 | align-items: flex-start; |
| 352 | } |
| 353 | } |
| 354 | |
| 355 | &.mwai-top-right, &.mwai-top-left { |
| 356 | |
| 357 | .mwai-open-button { |
| 358 | flex-direction: column-reverse; |
| 359 | |
| 360 | .mwai-icon-text { |
| 361 | margin-bottom: 0; |
| 362 | margin-top: 15px; |
| 363 | } |
| 364 | } |
| 365 | } |
| 366 | } |
| 367 | |
| 368 | // Popup chat is fullscreen |
| 369 | |
| 370 | &.mwai-window.mwai-fullscreen { |
| 371 | |
| 372 | .mwai-header { |
| 373 | |
| 374 | .mwai-buttons { |
| 375 | margin-bottom: 0px; |
| 376 | |
| 377 | .mwai-resize-button { |
| 378 | &:before { |
| 379 | width: 16px; |
| 380 | height: 16px; |
| 381 | } |
| 382 | |
| 383 | &:hover:before { |
| 384 | width: 13px; |
| 385 | height: 13px; |
| 386 | } |
| 387 | } |
| 388 | } |
| 389 | } |
| 390 | } |
| 391 | |
| 392 | // Standard chat is fullscreen |
| 393 | |
| 394 | &.mwai-fullscreen:not(.mwai-window), &.mwai-fullscreen.mwai-window.mwai-open { |
| 395 | @include fullscreen-window; |
| 396 | } |
| 397 | |
| 398 | // Popup chat is open |
| 399 | |
| 400 | &.mwai-window.mwai-open { |
| 401 | |
| 402 | .mwai-header { |
| 403 | display: flex; |
| 404 | } |
| 405 | |
| 406 | .mwai-content { |
| 407 | display: flex; |
| 408 | transition: opacity 200ms ease-in-out 0s; |
| 409 | opacity: 1; |
| 410 | } |
| 411 | |
| 412 | .mwai-open-button { |
| 413 | display: none; |
| 414 | } |
| 415 | } |
| 416 | |
| 417 | .mwai-error { |
| 418 | margin: var(--mwai-spacing); |
| 419 | color: white; |
| 420 | background: rgba(180, 55, 55, 0.55); |
| 421 | padding: var(--mwai-spacing); |
| 422 | border-radius: var(--mwai-borderRadius); |
| 423 | |
| 424 | &:hover { |
| 425 | cursor: pointer; |
| 426 | background: rgba(180, 44, 44, 0.85); |
| 427 | } |
| 428 | } |
| 429 | |
| 430 | &.mwai-bubble .mwai-icon-container { |
| 431 | background: var(--mwai-bubbleColor); |
| 432 | width: 60px; |
| 433 | height: 60px; |
| 434 | border-radius: 100%; |
| 435 | transition: all 0.2s ease-out; |
| 436 | display: flex; |
| 437 | justify-content: center; |
| 438 | align-items: center; |
| 439 | |
| 440 | .mwai-icon { |
| 441 | max-width: 50%; |
| 442 | max-height: 50%; |
| 443 | filter: none; |
| 444 | |
| 445 | &:hover { |
| 446 | transform: none; |
| 447 | } |
| 448 | } |
| 449 | |
| 450 | &:hover { |
| 451 | cursor: pointer; |
| 452 | filter: brightness(1.1); |
| 453 | } |
| 454 | } |
| 455 | |
| 456 | @media (max-width: 760px) { |
| 457 | &.mwai-window.mwai-open { |
| 458 | @include fullscreen-window; |
| 459 | |
| 460 | .mwai-input { |
| 461 | flex-direction: column; |
| 462 | |
| 463 | button { |
| 464 | font-size: 16px; |
| 465 | margin-left: 0; |
| 466 | width: 100%; |
| 467 | } |
| 468 | |
| 469 | .mwai-input-text { |
| 470 | margin-bottom: var(--mwai-spacing); |
| 471 | width: 100%; |
| 472 | |
| 473 | // This is to avoid iOS from zooming in when focusing on an input field. |
| 474 | input, textarea { |
| 475 | font-size: 16px; |
| 476 | } |
| 477 | } |
| 478 | } |
| 479 | |
| 480 | .mwai-content { |
| 481 | display: flex; |
| 482 | transition: opacity 200ms ease-in-out 0s; |
| 483 | opacity: 1; |
| 484 | height: 100%; |
| 485 | max-height: inherit; |
| 486 | |
| 487 | .mwai-conversation { |
| 488 | flex: auto; |
| 489 | max-height: none; |
| 490 | } |
| 491 | } |
| 492 | |
| 493 | .mwai-resize-button { |
| 494 | display: none !important; |
| 495 | } |
| 496 | |
| 497 | .mwai-open-button { |
| 498 | display: none; |
| 499 | } |
| 500 | } |
| 501 | } |
| 502 | |
| 503 | // Keyframes for buttons |
| 504 | |
| 505 | @keyframes mwai-button-spinner { |
| 506 | |
| 507 | from { |
| 508 | transform: rotate(0turn); |
| 509 | } |
| 510 | to { |
| 511 | transform: rotate(1turn); |
| 512 | } |
| 513 | } |
| 514 | |
| 515 | // WordPress Admin Bar |
| 516 | |
| 517 | .admin-bar .mwai-fullscreen:not(.mwai-window), |
| 518 | .admin-bar .mwai-fullscreen.mwai-window.mwai-open { |
| 519 | top: 32px; |
| 520 | } |
| 521 | } |