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