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