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