_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
chatgpt.scss
508 lines
| 1 | // out: ../chatgpt.css |
| 2 | @import '_common.scss'; |
| 3 | |
| 4 | // Chatbot |
| 5 | .mwai-chatgpt-theme { |
| 6 | --mwai-spacing: 15px; |
| 7 | --mwai-fontSize: 15px; |
| 8 | --mwai-lineHeight: 1.5; |
| 9 | --mwai-borderRadius: 10px; |
| 10 | --mwai-width: 460px; |
| 11 | --mwai-maxHeight: 40vh; |
| 12 | --mwai-iconTextColor: white; |
| 13 | --mwai-iconTextBackgroundColor: #343541; |
| 14 | --mwai-fontColor: #FFFFFF; |
| 15 | --mwai-backgroundPrimaryColor: #454654; |
| 16 | --mwai-backgroundHeaderColor: #343541; |
| 17 | --mwai-bubbleColor: #343541; |
| 18 | --mwai-headerButtonsColor: #FFFFFF; |
| 19 | --mwai-conversationsBackgroundColor: #202123; |
| 20 | --mwai-conversationsTextColor: #FFFFFF; |
| 21 | --mwai-backgroundSecondaryColor: #343541; |
| 22 | --mwai-errorBackgroundColor: #6d2f2a; |
| 23 | --mwai-errorTextColor: #FFFFFF; |
| 24 | |
| 25 | * { |
| 26 | box-sizing: border-box; |
| 27 | } |
| 28 | |
| 29 | .mwai-content { |
| 30 | background: var(--mwai-backgroundSecondaryColor); |
| 31 | color: var(--mwai-fontColor); |
| 32 | font-size: var(--mwai-fontSize); |
| 33 | overflow: hidden; |
| 34 | display: flex; |
| 35 | flex-direction: column; |
| 36 | border-radius: var(--mwai-borderRadius); |
| 37 | } |
| 38 | |
| 39 | .mwai-conversation { |
| 40 | overflow: auto; |
| 41 | } |
| 42 | |
| 43 | .mwai-reply { |
| 44 | display: flex; |
| 45 | padding: var(--mwai-spacing); |
| 46 | position: relative; |
| 47 | line-height: var(--mwai-lineHeight); |
| 48 | transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1); |
| 49 | |
| 50 | .mwai-copy-button { |
| 51 | opacity: 0; |
| 52 | transition: all 0.3s ease-out; |
| 53 | width: 22px; |
| 54 | height: 22px; |
| 55 | position: absolute; |
| 56 | right: var(--mwai-spacing); |
| 57 | |
| 58 | .mwai-copy-button-one, .mwai-copy-button-two { |
| 59 | position: absolute; |
| 60 | width: 16px; |
| 61 | height: 16px; |
| 62 | background: white; |
| 63 | opacity: 0.4; |
| 64 | transition: all 0.2s ease-in; |
| 65 | cursor: pointer; |
| 66 | border-radius: 2px; |
| 67 | } |
| 68 | |
| 69 | .mwai-copy-button-one { |
| 70 | margin-top: 0; |
| 71 | margin-left: 0; |
| 72 | } |
| 73 | |
| 74 | .mwai-copy-button-two { |
| 75 | margin-top: 6px; |
| 76 | margin-left: 6px; |
| 77 | opacity: 0.6; |
| 78 | } |
| 79 | |
| 80 | &:hover { |
| 81 | .mwai-copy-button-one { |
| 82 | opacity: 0.6; |
| 83 | margin-top: 0; |
| 84 | margin-left: 6px; |
| 85 | } |
| 86 | |
| 87 | .mwai-copy-button-two { |
| 88 | opacity: 1; |
| 89 | margin-top: 6px; |
| 90 | margin-left: 0; |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | &.mwai-animate { |
| 95 | .mwai-copy-button-one { |
| 96 | opacity: 0; |
| 97 | } |
| 98 | |
| 99 | .mwai-copy-button-two { |
| 100 | width: 18px; |
| 101 | height: 18px; |
| 102 | margin-top: 2px; |
| 103 | margin-left: 2px; |
| 104 | opacity: 1; |
| 105 | } |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | &.mwai-fade-out { |
| 110 | opacity: 0; |
| 111 | } |
| 112 | |
| 113 | &:hover .mwai-copy-button { |
| 114 | display: block; |
| 115 | opacity: 1; |
| 116 | } |
| 117 | |
| 118 | &.mwai-user { |
| 119 | background: var(--mwai-backgroundSecondaryColor); |
| 120 | } |
| 121 | |
| 122 | &.mwai-ai { |
| 123 | background: var(--mwai-backgroundPrimaryColor); |
| 124 | } |
| 125 | |
| 126 | .mwai-name { |
| 127 | color: var(--mwai-fontColor); |
| 128 | margin-right: 5px; |
| 129 | |
| 130 | .mwai-name-text { |
| 131 | opacity: 0.50; |
| 132 | white-space: nowrap; |
| 133 | } |
| 134 | |
| 135 | .mwai-avatar { |
| 136 | margin-right: 10px; |
| 137 | display: flex; |
| 138 | align-items: center; |
| 139 | justify-content: center; |
| 140 | border-radius: 5px; |
| 141 | overflow: hidden; |
| 142 | |
| 143 | img { |
| 144 | width: 32px; |
| 145 | height: 32px; |
| 146 | } |
| 147 | |
| 148 | &.mwai-svg img { |
| 149 | width: 28px; |
| 150 | height: 28px; |
| 151 | filter: brightness(0) invert(1); |
| 152 | } |
| 153 | } |
| 154 | } |
| 155 | |
| 156 | .mwai-text { |
| 157 | flex: auto; |
| 158 | font-size: var(--mwai-fontSize); |
| 159 | line-height: var(--mwai-lineHeight); |
| 160 | color: var(--mwai-fontColor); |
| 161 | |
| 162 | .mwai-image { |
| 163 | display: block; |
| 164 | max-width: 250px; |
| 165 | height: auto; |
| 166 | margin: 0 0 10px 0; |
| 167 | border-radius: var(--mwai-borderRadius); |
| 168 | } |
| 169 | |
| 170 | .mwai-filename { |
| 171 | display: flex; |
| 172 | text-decoration: none; |
| 173 | border: 1px solid var(--mwai-backgroundPrimaryColor); |
| 174 | border-radius: var(--mwai-borderRadius); |
| 175 | padding: 5px 10px; |
| 176 | margin-bottom: 10px; |
| 177 | } |
| 178 | |
| 179 | * { |
| 180 | font-size: var(--mwai-fontSize); |
| 181 | } |
| 182 | |
| 183 | > span > *:first-child { |
| 184 | margin-top: 0; |
| 185 | } |
| 186 | |
| 187 | > span > *:last-child { |
| 188 | margin-bottom: 0; |
| 189 | } |
| 190 | |
| 191 | a { |
| 192 | color: #2196f3; |
| 193 | } |
| 194 | |
| 195 | h1 { |
| 196 | font-size: 200%; |
| 197 | } |
| 198 | |
| 199 | h2 { |
| 200 | font-size: 160%; |
| 201 | } |
| 202 | |
| 203 | h3 { |
| 204 | font-size: 140%; |
| 205 | } |
| 206 | |
| 207 | h4 { |
| 208 | font-size: 120%; |
| 209 | } |
| 210 | |
| 211 | p { |
| 212 | code { |
| 213 | background: var(--mwai-backgroundSecondaryColor); |
| 214 | padding: 2px 6px; |
| 215 | border-radius: 8px; |
| 216 | font-size: 90%; |
| 217 | font-family: system-ui; |
| 218 | } |
| 219 | } |
| 220 | |
| 221 | pre { |
| 222 | color: var(--mwai-fontColor); |
| 223 | border-radius: var(--mwai-borderRadius); |
| 224 | padding: calc(var(--mwai-spacing) * 2 / 3) var(--mwai-spacing); |
| 225 | break-after: auto; |
| 226 | white-space: pre-wrap; |
| 227 | font-size: 95%; |
| 228 | max-width: 100%; |
| 229 | width: 100%; |
| 230 | font-family: system-ui; |
| 231 | background: #343541; |
| 232 | |
| 233 | code { |
| 234 | padding: 0 !important; |
| 235 | font-family: system-ui; |
| 236 | background: #343541; |
| 237 | } |
| 238 | } |
| 239 | |
| 240 | ul, ol { |
| 241 | padding: 0; |
| 242 | } |
| 243 | |
| 244 | ol { |
| 245 | margin: 0 0 0 20px; |
| 246 | } |
| 247 | |
| 248 | table { |
| 249 | width: 100%; |
| 250 | border: 2px solid var(--mwai-backgroundSecondaryColor); |
| 251 | border-collapse: collapse; |
| 252 | } |
| 253 | |
| 254 | thead { |
| 255 | background: var(--mwai-backgroundSecondaryColor); |
| 256 | } |
| 257 | |
| 258 | tr, td { |
| 259 | padding: 2px 5px; |
| 260 | } |
| 261 | |
| 262 | td { |
| 263 | border: 2px solid var(--mwai-backgroundSecondaryColor); |
| 264 | } |
| 265 | |
| 266 | .mwai-typewriter { |
| 267 | display: inline-block; |
| 268 | |
| 269 | > :first-child { |
| 270 | margin-top: 0; |
| 271 | } |
| 272 | } |
| 273 | |
| 274 | >*:first-child { |
| 275 | margin-top: 0; |
| 276 | } |
| 277 | |
| 278 | >*:last-child { |
| 279 | margin-bottom: 0; |
| 280 | } |
| 281 | } |
| 282 | |
| 283 | &.mwai-system { |
| 284 | background: var(--mwai-errorBackgroundColor); |
| 285 | color: var(--mwai-errorFontColor); |
| 286 | |
| 287 | .mwai-name { |
| 288 | display: none; |
| 289 | } |
| 290 | } |
| 291 | } |
| 292 | |
| 293 | .mwai-input { |
| 294 | display: flex; |
| 295 | padding: var(--mwai-spacing); |
| 296 | border-top: 1px solid var(--mwai-backgroundPrimaryColor); |
| 297 | |
| 298 | .mwai-input-text { |
| 299 | flex: auto; |
| 300 | position: relative; |
| 301 | background: var(--mwai-backgroundPrimaryColor); |
| 302 | border-radius: var(--mwai-borderRadius); |
| 303 | overflow: hidden; |
| 304 | display: flex; |
| 305 | padding: calc(var(--mwai-spacing) / 2); |
| 306 | |
| 307 | &.mwai-blocked { |
| 308 | background: var(--mwai-errorBackgroundColor); |
| 309 | } |
| 310 | |
| 311 | &.mwai-dragging { |
| 312 | filter: brightness(1.2); |
| 313 | } |
| 314 | |
| 315 | textarea { |
| 316 | background: inherit; |
| 317 | color: var(--mwai-fontColor); |
| 318 | padding-left: calc(var(--mwai-spacing) / 2); |
| 319 | flex: auto; |
| 320 | border: none; |
| 321 | font-size: var(--mwai-fontSize); |
| 322 | line-height: var(--mwai-lineHeight); |
| 323 | resize: none; |
| 324 | font-family: inherit; |
| 325 | margin: 0; |
| 326 | overflow: hidden; |
| 327 | |
| 328 | &:focus { |
| 329 | outline: none; |
| 330 | box-shadow: none; |
| 331 | } |
| 332 | |
| 333 | &::placeholder { |
| 334 | color: var(--mwai-fontColor); |
| 335 | opacity: 0.5; |
| 336 | } |
| 337 | } |
| 338 | |
| 339 | .mwai-microphone { |
| 340 | @include microphone; |
| 341 | } |
| 342 | |
| 343 | .mwai-file-upload-icon { |
| 344 | $icon-size: 32px; |
| 345 | background: url('icons/dark-icons.svg'); |
| 346 | background-size: 500%; // 5 icons in the row |
| 347 | background-position: -0 * $icon-size -3 * $icon-size; |
| 348 | width: $icon-size; |
| 349 | height: $icon-size; |
| 350 | z-index: 100; |
| 351 | @include file-upload-icon-sprites; |
| 352 | } |
| 353 | } |
| 354 | |
| 355 | button { |
| 356 | margin-left: var(--mwai-spacing); |
| 357 | } |
| 358 | } |
| 359 | |
| 360 | .mwai-compliance { |
| 361 | opacity: 0.50; |
| 362 | margin-top: calc(-1 * var(--mwai-spacing)); |
| 363 | padding: calc(var(--mwai-spacing) / 1.5) var(--mwai-spacing); |
| 364 | font-size: smaller; |
| 365 | color: var(--mwai-fontColor); |
| 366 | text-align: left; |
| 367 | } |
| 368 | |
| 369 | .mwai-gallery { |
| 370 | display: grid; |
| 371 | grid-template-columns: repeat(3, 1fr); |
| 372 | grid-gap: 5px; |
| 373 | |
| 374 | img { |
| 375 | width: 100%; |
| 376 | } |
| 377 | } |
| 378 | |
| 379 | button { |
| 380 | color: var(--mwai-fontColor); |
| 381 | background: var(--mwai-backgroundSecondaryColor); |
| 382 | border: 1px solid var(--mwai-backgroundPrimaryColor); |
| 383 | padding: calc(var(--mwai-spacing) / 2) var(--mwai-spacing); |
| 384 | min-width: 90px; |
| 385 | border-radius: 5px; |
| 386 | cursor: pointer; |
| 387 | transition: all 0.2s ease-out; |
| 388 | display: flex; |
| 389 | align-items: center; |
| 390 | justify-content: center; |
| 391 | font-size: 90%; |
| 392 | position: relative; |
| 393 | |
| 394 | .mwai-timer { |
| 395 | margin-left: 5px; |
| 396 | margin-right: 5px; |
| 397 | font-size: 11px; |
| 398 | } |
| 399 | |
| 400 | &:hover { |
| 401 | background: var(--mwai-backgroundPrimaryColor); |
| 402 | } |
| 403 | } |
| 404 | |
| 405 | button[disabled]] { |
| 406 | cursor: not-allowed; |
| 407 | |
| 408 | span { |
| 409 | opacity: 0.5; |
| 410 | } |
| 411 | |
| 412 | &.mwai-busy { |
| 413 | span { |
| 414 | display: none; |
| 415 | } |
| 416 | |
| 417 | &:before { |
| 418 | content: ''; |
| 419 | width: 18px; |
| 420 | height: 18px; |
| 421 | margin: auto; |
| 422 | border: 3px solid transparent; |
| 423 | border-top-color: var(--mwai-fontColor); |
| 424 | border-radius: 50%; |
| 425 | animation: mwai-button-spinner 1s ease infinite; |
| 426 | } |
| 427 | } |
| 428 | } |
| 429 | } |
| 430 | |
| 431 | // Discussions |
| 432 | .mwai-chatgpt-theme.mwai-discussions { |
| 433 | border-radius: var(--mwai-borderRadius); |
| 434 | background: var(--mwai-backgroundHeaderColor); |
| 435 | overflow: hidden; |
| 436 | |
| 437 | * { |
| 438 | box-sizing: border-box; |
| 439 | } |
| 440 | |
| 441 | .mwai-header { |
| 442 | color: var(--mwai-headerButtonsColor); |
| 443 | padding: var(--mwai-spacing); |
| 444 | display: flex; |
| 445 | justify-content: space-between; |
| 446 | align-items: center; |
| 447 | } |
| 448 | |
| 449 | .mwai-content { |
| 450 | background: var(--mwai-conversationsBackgroundColor); |
| 451 | list-style: none; |
| 452 | padding: calc(var(--mwai-spacing) / 2); |
| 453 | margin: 0; |
| 454 | |
| 455 | .mwai-discussion { |
| 456 | margin: 0; |
| 457 | } |
| 458 | |
| 459 | li { |
| 460 | color: var(--mwai-conversationsTextColor); |
| 461 | font-size: 75%; |
| 462 | padding: calc(var(--mwai-spacing) / 2); |
| 463 | opacity: 0.65; |
| 464 | |
| 465 | &.mwai-active, &:hover { |
| 466 | background: var(--mwai-backgroundPrimaryColor); |
| 467 | border-radius: var(--mwai-borderRadius); |
| 468 | opacity: 1; |
| 469 | cursor: pointer; |
| 470 | } |
| 471 | } |
| 472 | } |
| 473 | } |
| 474 | |
| 475 | // Common |
| 476 | .mwai-chatgpt-theme { |
| 477 | @include common-styles; |
| 478 | @import '_copybutton.scss'; |
| 479 | @import '_codeDark.scss'; |
| 480 | } |
| 481 | |
| 482 | // Mobile |
| 483 | .mwai-chatgpt-theme { |
| 484 | @media (max-width: 760px) { |
| 485 | .mwai-chat { |
| 486 | .mwai-input button { |
| 487 | margin: 15px 0 0 0; |
| 488 | height: 40px; |
| 489 | width: inherit; |
| 490 | } |
| 491 | |
| 492 | .mwai-name { |
| 493 | margin-right: 0; |
| 494 | max-width: inherit; |
| 495 | } |
| 496 | |
| 497 | &.mwai-window { |
| 498 | width: calc(100% - 40px); |
| 499 | z-index: 9999999999; |
| 500 | } |
| 501 | |
| 502 | .mwai-input { |
| 503 | flex-direction: column; |
| 504 | } |
| 505 | } |
| 506 | } |
| 507 | } |
| 508 |