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
_common.scss
316 lines
| 1 | // main: ChatGPT.module.scss,Messages.module.scss |
| 2 | |
| 3 | .mwai-text { |
| 4 | |
| 5 | img { |
| 6 | max-width: 100%; |
| 7 | } |
| 8 | } |
| 9 | |
| 10 | // The icon when the chat window is closed. |
| 11 | |
| 12 | .mwai-open-button { |
| 13 | position: absolute; |
| 14 | right: 0; |
| 15 | bottom: 0; |
| 16 | transition: all 0.2s ease-out; |
| 17 | z-index: 9999; |
| 18 | display: flex; |
| 19 | flex-direction: column; |
| 20 | align-items: end; |
| 21 | |
| 22 | .mwai-icon-text { |
| 23 | background: var(--mwai-iconTextBackgroundColor); |
| 24 | color: var(--mwai-iconTextColor); |
| 25 | max-width: 200px; |
| 26 | font-size: 13px; |
| 27 | margin-bottom: 15px; |
| 28 | padding: 5px 10px; |
| 29 | border-radius: 8px; |
| 30 | } |
| 31 | |
| 32 | img { |
| 33 | filter: drop-shadow(0px 0px 15px rgba(0, 0, 0, 0.15)); |
| 34 | } |
| 35 | |
| 36 | &:hover { |
| 37 | cursor: pointer; |
| 38 | filter: saturate(2.5) hue-rotate(5deg); |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | // Handle the chat window and fullscreen. |
| 43 | // Let's keep this common for all themes. |
| 44 | |
| 45 | .mwai-window { |
| 46 | position: fixed; |
| 47 | right: 30px; |
| 48 | bottom: 30px; |
| 49 | width: var(--mwai-width); |
| 50 | z-index: 9999; |
| 51 | |
| 52 | .mwai-header { |
| 53 | display: none; |
| 54 | justify-content: flex-end; |
| 55 | align-items: center; |
| 56 | border-radius: var(--mwai-borderRadius) var(--mwai-borderRadius) 0 0; |
| 57 | background: var(--mwai-backgroundHeaderColor); |
| 58 | |
| 59 | .mwai-buttons { |
| 60 | display: flex; |
| 61 | align-items: center; |
| 62 | |
| 63 | .mwai-resize-button { |
| 64 | justify-content: center; |
| 65 | height: 32px; |
| 66 | width: 22px; |
| 67 | cursor: pointer; |
| 68 | display: flex; |
| 69 | justify-content: center; |
| 70 | align-items: center; |
| 71 | |
| 72 | &:before { |
| 73 | transition: all 0.2s ease-out; |
| 74 | content: ' '; |
| 75 | cursor: pointer; |
| 76 | position: absolute; |
| 77 | height: 13px; |
| 78 | width: 13px; |
| 79 | border: 1px solid var(--mwai-headerButtonsColor); |
| 80 | } |
| 81 | |
| 82 | &:hover:before { |
| 83 | width: 16px; |
| 84 | height: 16px; |
| 85 | } |
| 86 | } |
| 87 | |
| 88 | .mwai-close-button { |
| 89 | justify-content: center; |
| 90 | height: 32px; |
| 91 | width: 33px; |
| 92 | cursor: pointer; |
| 93 | border-radius: var(--mwai-borderRadius); |
| 94 | |
| 95 | &:before { |
| 96 | transition: all 0.2s ease-out; |
| 97 | transform: translate(16px, 5px) rotate(45deg); |
| 98 | } |
| 99 | &:after { |
| 100 | transition: all 0.2s ease-out; |
| 101 | transform: translate(16px, 5px) rotate(-45deg); |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | .mwai-close-button:before, .mwai-close-button:after { |
| 106 | content: ' '; |
| 107 | cursor: pointer; |
| 108 | position: absolute; |
| 109 | height: 22px; |
| 110 | width: 1px; |
| 111 | background-color: var(--mwai-headerButtonsColor); |
| 112 | } |
| 113 | |
| 114 | .mwai-close-button:hover { |
| 115 | &:before { |
| 116 | opacity: 1; |
| 117 | transform: translate(16px, 5px) rotate(135deg); |
| 118 | } |
| 119 | &:after { |
| 120 | opacity: 1; |
| 121 | transform: translate(16px, 5px) rotate(45deg); |
| 122 | } |
| 123 | } |
| 124 | |
| 125 | } |
| 126 | } |
| 127 | |
| 128 | .mwai-content { |
| 129 | display: none; |
| 130 | opacity: 0; |
| 131 | max-height: var(--mwai-maxHeight); |
| 132 | border-radius: 0 0 var(--mwai-borderRadius) var(--mwai-borderRadius); |
| 133 | overflow: hidden; |
| 134 | } |
| 135 | |
| 136 | &.mwai-bottom-left { |
| 137 | bottom: 30px; |
| 138 | right: inherit; |
| 139 | left: 30px; |
| 140 | |
| 141 | .mwai-open-button { |
| 142 | right: inherit; |
| 143 | left: 0; |
| 144 | } |
| 145 | } |
| 146 | |
| 147 | &.mwai-top-right { |
| 148 | top: 30px; |
| 149 | bottom: inherit; |
| 150 | right: 30px; |
| 151 | |
| 152 | .mwai-open-button { |
| 153 | top: 0; |
| 154 | bottom: inherit; |
| 155 | } |
| 156 | } |
| 157 | |
| 158 | &.mwai-top-left { |
| 159 | top: 30px; |
| 160 | bottom: inherit; |
| 161 | right: inherit; |
| 162 | left: 30px; |
| 163 | |
| 164 | .mwai-open-button { |
| 165 | top: 0; |
| 166 | bottom: inherit; |
| 167 | right: inherit; |
| 168 | left: 0; |
| 169 | } |
| 170 | } |
| 171 | |
| 172 | &.mwai-top-left, &.mwai-bottom-left { |
| 173 | |
| 174 | .mwai-open-button { |
| 175 | align-items: flex-start; |
| 176 | } |
| 177 | } |
| 178 | |
| 179 | &.mwai-top-right, &.mwai-top-left { |
| 180 | |
| 181 | .mwai-open-button { |
| 182 | flex-direction: column-reverse; |
| 183 | |
| 184 | .mwai-icon-text { |
| 185 | margin-bottom: 0; |
| 186 | margin-top: 15px; |
| 187 | } |
| 188 | } |
| 189 | } |
| 190 | } |
| 191 | |
| 192 | // Popup chat is fullscreen |
| 193 | |
| 194 | .mwai-window.mwai-fullscreen { |
| 195 | |
| 196 | .mwai-header { |
| 197 | |
| 198 | .mwai-buttons { |
| 199 | margin-bottom: 0px; |
| 200 | |
| 201 | .mwai-resize-button { |
| 202 | &:before { |
| 203 | width: 16px; |
| 204 | height: 16px; |
| 205 | } |
| 206 | |
| 207 | &:hover:before { |
| 208 | width: 13px; |
| 209 | height: 13px; |
| 210 | } |
| 211 | } |
| 212 | } |
| 213 | } |
| 214 | } |
| 215 | |
| 216 | // Standard chat is fullscreen |
| 217 | |
| 218 | .mwai-fullscreen:not(.mwai-window), .mwai-fullscreen.mwai-window.mwai-open { |
| 219 | position: fixed; |
| 220 | left: 0 !important; |
| 221 | right: 0 !important; |
| 222 | bottom: 0 !important; |
| 223 | top: 0 !important; |
| 224 | width: inherit; |
| 225 | height: inherit; |
| 226 | max-height: inherit; |
| 227 | max-width: inherit; |
| 228 | display: flex; |
| 229 | flex-direction: column; |
| 230 | margin: 0; |
| 231 | z-index: 999999; |
| 232 | background-color: var(--mwai-backgroundSecondaryColor); |
| 233 | |
| 234 | .mwai-content { |
| 235 | height: 100%; |
| 236 | max-height: inherit; |
| 237 | |
| 238 | .mwai-conversation { |
| 239 | flex: auto; |
| 240 | max-height: none; |
| 241 | } |
| 242 | } |
| 243 | } |
| 244 | |
| 245 | // Popup chat is open |
| 246 | |
| 247 | .mwai-window.mwai-open { |
| 248 | |
| 249 | .mwai-header { |
| 250 | display: flex; |
| 251 | } |
| 252 | |
| 253 | .mwai-content { |
| 254 | display: flex; |
| 255 | transition: opacity 200ms ease-in-out 0s; |
| 256 | opacity: 1; |
| 257 | } |
| 258 | |
| 259 | .mwai-open-button { |
| 260 | display: none; |
| 261 | } |
| 262 | } |
| 263 | |
| 264 | .mwai-error { |
| 265 | margin: var(--mwai-spacing); |
| 266 | color: white; |
| 267 | background: rgba(180, 55, 55, 0.55); |
| 268 | padding: var(--mwai-spacing); |
| 269 | border-radius: var(--mwai-borderRadius); |
| 270 | |
| 271 | &:hover { |
| 272 | cursor: pointer; |
| 273 | background: rgba(180, 44, 44, 0.85); |
| 274 | } |
| 275 | } |
| 276 | |
| 277 | // Keyframes for buttons |
| 278 | |
| 279 | @keyframes mwai-button-spinner { |
| 280 | |
| 281 | from { |
| 282 | transform: rotate(0turn); |
| 283 | } |
| 284 | to { |
| 285 | transform: rotate(1turn); |
| 286 | } |
| 287 | } |
| 288 | |
| 289 | // WordPress Admin Bar |
| 290 | |
| 291 | .admin-bar .mwai-fullscreen:not(.mwai-window), |
| 292 | .admin-bar .mwai-fullscreen.mwai-window.mwai-open { |
| 293 | top: 32px; |
| 294 | } |
| 295 | |
| 296 | // Mobile |
| 297 | |
| 298 | @media (max-width: 760px) { |
| 299 | |
| 300 | .mwai-chat { |
| 301 | |
| 302 | &.mwai-window { |
| 303 | width: calc(100% - 40px); |
| 304 | z-index: 9999999999; |
| 305 | } |
| 306 | |
| 307 | .mwai-reply { |
| 308 | flex-direction: column; |
| 309 | } |
| 310 | |
| 311 | .mwai-input { |
| 312 | flex-direction: column; |
| 313 | } |
| 314 | } |
| 315 | } |
| 316 |