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