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