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