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
422 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); |
| 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 | > span > p > *:first-child { |
| 129 | margin-top: 0; |
| 130 | } |
| 131 | |
| 132 | // > span > p > *:last-child { |
| 133 | // margin-bottom: 0; |
| 134 | // } |
| 135 | |
| 136 | a { |
| 137 | color: #2196f3; |
| 138 | } |
| 139 | |
| 140 | h1 { |
| 141 | font-size: 200%; |
| 142 | } |
| 143 | |
| 144 | h2 { |
| 145 | font-size: 160%; |
| 146 | } |
| 147 | |
| 148 | h3 { |
| 149 | font-size: 140%; |
| 150 | } |
| 151 | |
| 152 | h4 { |
| 153 | font-size: 120%; |
| 154 | } |
| 155 | |
| 156 | p { |
| 157 | font-size: var(--mwai-fontSize); |
| 158 | line-height: var(--mwai-lineHeight); |
| 159 | |
| 160 | code { |
| 161 | background: var(--mwai-backgroundAiSecondaryColor); |
| 162 | padding: 2px 6px; |
| 163 | border-radius: 8px; |
| 164 | font-size: 90%; |
| 165 | font-family: system-ui; |
| 166 | } |
| 167 | } |
| 168 | |
| 169 | pre { |
| 170 | color: var(--mwai-fontColor); |
| 171 | border-radius: var(--mwai-borderRadius); |
| 172 | break-after: auto; |
| 173 | white-space: pre-wrap; |
| 174 | max-width: 100%; |
| 175 | width: 100%; |
| 176 | font-family: system-ui; |
| 177 | background: var(--mwai-backgroundAiSecondaryColor); |
| 178 | padding: var(--mwai-spacing); |
| 179 | |
| 180 | code { |
| 181 | padding: 0 !important; |
| 182 | font-family: system-ui; |
| 183 | background: var(--mwai-backgroundAiSecondaryColor); |
| 184 | } |
| 185 | } |
| 186 | |
| 187 | ol { |
| 188 | padding: 0; |
| 189 | margin: 0 0 0 20px; |
| 190 | } |
| 191 | |
| 192 | table { |
| 193 | width: 100%; |
| 194 | border: 2px solid var(--mwai-backgroundAiSecondaryColor); |
| 195 | border-collapse: collapse |
| 196 | } |
| 197 | |
| 198 | thead { |
| 199 | background: var(--mwai-backgroundAiSecondaryColor); |
| 200 | } |
| 201 | |
| 202 | tr, td { |
| 203 | padding: 2px 5px; |
| 204 | } |
| 205 | |
| 206 | td { |
| 207 | border: 2px solid var(--mwai-backgroundAiSecondaryColor); |
| 208 | } |
| 209 | |
| 210 | .mwai-typewriter { |
| 211 | display: inline-block; |
| 212 | |
| 213 | > :first-child { |
| 214 | margin-top: 0; |
| 215 | } |
| 216 | } |
| 217 | |
| 218 | > * { |
| 219 | &:first-child { |
| 220 | margin-top: 0; |
| 221 | |
| 222 | } |
| 223 | &:last-child { |
| 224 | margin-bottom: 0; |
| 225 | } |
| 226 | } |
| 227 | } |
| 228 | |
| 229 | .mwai-avatar { |
| 230 | img { |
| 231 | width: 24px; |
| 232 | border-radius: 5px; |
| 233 | } |
| 234 | } |
| 235 | |
| 236 | .mwai-input { |
| 237 | display: flex; |
| 238 | align-items: center; |
| 239 | padding: var(--mwai-spacing); |
| 240 | |
| 241 | .mwai-input-text { |
| 242 | flex: auto; |
| 243 | position: relative; |
| 244 | display: flex; |
| 245 | background: var(--mwai-backgroundPrimaryColor); |
| 246 | border-radius: var(--mwai-borderRadius); |
| 247 | border: 1px solid var(--mwai-backgroundAiSecondaryColor); |
| 248 | overflow: hidden; |
| 249 | |
| 250 | textarea { |
| 251 | background: var(--mwai-backgroundPrimaryColor); |
| 252 | color: var(--mwai-fontColor); |
| 253 | flex: auto; |
| 254 | padding: var(--mwai-spacing); |
| 255 | border: none; |
| 256 | font-size: var(--mwai-fontSize); |
| 257 | resize: none; |
| 258 | font-family: inherit; |
| 259 | margin: 0; |
| 260 | overflow: hidden; |
| 261 | |
| 262 | &:focus { |
| 263 | outline: none; |
| 264 | box-shadow: none; |
| 265 | } |
| 266 | |
| 267 | &::placeholder { |
| 268 | color: var(--mwai-fontColor); |
| 269 | opacity: 0.5; |
| 270 | } |
| 271 | } |
| 272 | |
| 273 | .mwai-microphone, .mwai-file-upload { |
| 274 | display: flex; |
| 275 | align-items: center; |
| 276 | justify-content: center; |
| 277 | height: 100%; |
| 278 | cursor: pointer; |
| 279 | |
| 280 | svg { |
| 281 | fill: var(--mwai-fontColor); |
| 282 | width: 34px; |
| 283 | height: 34px; |
| 284 | fill: var(--mwai-fontColor); |
| 285 | opacity: 0.5; |
| 286 | transition: opacity 0.3s ease-out; |
| 287 | } |
| 288 | |
| 289 | &[active=true]=true] { |
| 290 | svg { |
| 291 | opacity: 1; |
| 292 | } |
| 293 | } |
| 294 | |
| 295 | &[disabled]] { |
| 296 | svg { |
| 297 | opacity: 0; |
| 298 | } |
| 299 | } |
| 300 | } |
| 301 | |
| 302 | .mwai-file-upload { |
| 303 | margin-left: 5px; |
| 304 | margin-right: -5px; |
| 305 | |
| 306 | svg { |
| 307 | width: 42px; |
| 308 | height: 42px; |
| 309 | padding: 5px; |
| 310 | } |
| 311 | |
| 312 | span { |
| 313 | position: absolute; |
| 314 | font-size: 55%; |
| 315 | } |
| 316 | |
| 317 | &.enabled { |
| 318 | svg { |
| 319 | opacity: 1; |
| 320 | filter: none; |
| 321 | } |
| 322 | } |
| 323 | } |
| 324 | |
| 325 | .mwai-microphone { |
| 326 | |
| 327 | svg { |
| 328 | padding: 5px 10px; |
| 329 | } |
| 330 | } |
| 331 | } |
| 332 | |
| 333 | button { |
| 334 | margin-left: var(--mwai-spacing); |
| 335 | padding: 5px 15px; |
| 336 | background-color: var(--mwai-backgroundUserColor); |
| 337 | color: white; |
| 338 | border: none; |
| 339 | border-radius: var(--mwai-borderRadius); |
| 340 | cursor: pointer; |
| 341 | height: 32px; |
| 342 | width: 110px; |
| 343 | display: flex; |
| 344 | justify-content: center; |
| 345 | align-items: center; |
| 346 | |
| 347 | .mwai-timer { |
| 348 | margin-left: 5px; |
| 349 | margin-right: 5px; |
| 350 | font-size: 11px; |
| 351 | } |
| 352 | |
| 353 | &:hover { |
| 354 | filter: brightness(1.2); |
| 355 | } |
| 356 | } |
| 357 | } |
| 358 | |
| 359 | button[disabled]] { |
| 360 | cursor: not-allowed; |
| 361 | |
| 362 | span { |
| 363 | opacity: 0.5; |
| 364 | } |
| 365 | |
| 366 | &.mwai-busy { |
| 367 | |
| 368 | span { |
| 369 | display: none; |
| 370 | } |
| 371 | |
| 372 | &:before { |
| 373 | content: ''; |
| 374 | width: 18px; |
| 375 | height: 18px; |
| 376 | margin: auto; |
| 377 | border: 3px solid transparent; |
| 378 | border-top-color: var(--mwai-fontColor); |
| 379 | border-radius: 50%; |
| 380 | animation: mwai-button-spinner 1s ease infinite; |
| 381 | } |
| 382 | } |
| 383 | } |
| 384 | |
| 385 | .mwai-compliance { |
| 386 | opacity: 0.50; |
| 387 | margin-top: calc( -1 * var(--mwai-spacing)); |
| 388 | padding: calc(var(--mwai-spacing) / 1.5) var(--mwai-spacing); |
| 389 | font-size: smaller; |
| 390 | color: var(--mwai-fontColor); |
| 391 | text-align: left; |
| 392 | } |
| 393 | |
| 394 | .mwai-gallery { |
| 395 | display: grid; |
| 396 | grid-template-columns: repeat(3, 1fr); |
| 397 | grid-gap: 5px; |
| 398 | |
| 399 | img { |
| 400 | width: 100%; |
| 401 | } |
| 402 | } |
| 403 | } |
| 404 | |
| 405 | @import '_common.scss'; |
| 406 | @import '_copybutton.scss'; |
| 407 | @import '_codeLight.scss'; |
| 408 | |
| 409 | .mwai-copy-button { |
| 410 | position: absolute; |
| 411 | left: 15px; |
| 412 | zoom: 0.5; |
| 413 | top: 18px; |
| 414 | filter: revert; |
| 415 | } |
| 416 | |
| 417 | .mwai-ai .mwai-copy-button { |
| 418 | right: 15px; |
| 419 | left: inherit; |
| 420 | filter: brightness(0.4); |
| 421 | } |
| 422 |