index.css 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382
  1. /* define colors */
  2. :root {
  3. --primary-color: #a52e4d;
  4. --primary-color-transparent: #a52e4d66;
  5. --secondary-color: #228039;
  6. --secondary-color-transparent: #22803966;
  7. --red-color: #a52e4d;
  8. --green-color: #228039;
  9. --silver-color: #88808e;
  10. }
  11. @media(prefers-color-scheme: light) {
  12. :root {
  13. --primary-bg-color: #f0f0f0;
  14. --secondary-bg-color: #eeeeee;
  15. --tertiary-bg-color: #dddddd;
  16. --foreground-color: #111111;
  17. --accent-color: #000000;
  18. }
  19. }
  20. @media(prefers-color-scheme: dark) {
  21. :root {
  22. --primary-bg-color: #111111;
  23. --secondary-bg-color: #131313;
  24. --tertiary-bg-color: #232323;
  25. --foreground-color: #f0f0f0;
  26. --accent-color: #aaaaaa;
  27. }
  28. }
  29. main {
  30. width: 100%;
  31. height: 100%;
  32. display: flex;
  33. flex-direction: column;
  34. place-items: center;
  35. }
  36. .home {
  37. width: 100%;
  38. height: 90%;
  39. margin-bottom: 10rem;
  40. }
  41. .title {
  42. font-size: 3rem;
  43. margin: 1rem 0;
  44. margin-top: 3rem;
  45. }
  46. .histories-container-container {
  47. width: 100%;
  48. max-height: 75%;
  49. position: relative;
  50. }
  51. .histories-container {
  52. overflow-y: auto;
  53. overflow-x: hidden;
  54. width: 100%;
  55. height: 100%;
  56. display: flex;
  57. flex-direction: column;
  58. gap: 1rem;
  59. align-items: center;
  60. margin: 0;
  61. padding: 3rem 1rem;
  62. }
  63. .histories-start {
  64. height: 3rem;
  65. width: 100%;
  66. z-index: 999;
  67. top: 0;
  68. position: absolute;
  69. background: linear-gradient(180deg, var(--primary-bg-color) 0%, transparent 100%);
  70. }
  71. .histories-end {
  72. height: 3rem;
  73. width: 100%;
  74. z-index: 999;
  75. bottom: 0;
  76. position: absolute;
  77. background: linear-gradient(0deg, var(--primary-bg-color) 0%, transparent 100%);
  78. }
  79. .history {
  80. padding: 1rem;
  81. width: 100%;
  82. max-width: 40rem;
  83. background-color: var(--tertiary-bg-color);
  84. border-radius: 10px;
  85. border-left: 2px solid var(--primary-color);
  86. cursor: pointer;
  87. transform: translateX(calc(1px * var(--tx, 0)));
  88. opacity: var(--opacity, 1);
  89. }
  90. .history:hover {
  91. background-color: var(--secondary-bg-color);
  92. }
  93. .history-delete-button {
  94. position: absolute;
  95. top: 0;
  96. right: 0;
  97. padding: 0.5rem;
  98. margin: 0;
  99. outline: none;
  100. border: none;
  101. background-color: var(--secondary-bg-color);
  102. color: var(--foreground-color);
  103. border-radius: 0 0 0 10px;
  104. cursor: pointer;
  105. transition: 0.2s;
  106. }
  107. .history-delete-button:hover {
  108. background-color: var(--tertiary-bg-color);
  109. padding: 0.75rem;
  110. }
  111. .messages {
  112. overflow-y: auto;
  113. height: 100%;
  114. width: 100%;
  115. display: flex;
  116. flex-direction: column;
  117. gap: 1rem;
  118. align-items: center;
  119. padding-top: 1rem;
  120. padding-bottom: 11rem;
  121. }
  122. .message {
  123. width: 96%;
  124. max-width: 80rem;
  125. display: grid;
  126. background-color: var(--secondary-bg-color);
  127. padding: 0.5rem 1rem;
  128. border-radius: 10px;
  129. }
  130. .message-role-assistant {
  131. border-bottom: 2px solid var(--primary-color);
  132. border-left: 2px solid var(--primary-color);
  133. box-shadow: -10px 10px 20px 2px var(--primary-color-transparent);
  134. }
  135. .message-role-user {
  136. border-bottom: 2px solid var(--secondary-color);
  137. border-right: 2px solid var(--secondary-color);
  138. box-shadow: 10px 10px 20px 2px var(--secondary-color-transparent);
  139. }
  140. .message > pre {
  141. white-space: pre-wrap;
  142. }
  143. .hljs {
  144. width: 100%;
  145. position: relative;
  146. border-radius: 10px;
  147. /* wrap code blocks */
  148. white-space: pre-wrap;
  149. }
  150. /* put clipboard button in the top right corner of the code block */
  151. .clipboard-button {
  152. position: absolute;
  153. top: 0;
  154. right: 0;
  155. padding: 0.5rem;
  156. margin: 0;
  157. outline: none;
  158. border: none;
  159. background-color: var(--secondary-bg-color);
  160. color: var(--foreground-color);
  161. border-radius: 0 0 0 10px;
  162. cursor: pointer;
  163. transition: 0.2s;
  164. }
  165. .clipboard-button:hover {
  166. background-color: var(--tertiary-bg-color);
  167. padding: 0.75rem;
  168. }
  169. .input-container {
  170. position: absolute;
  171. bottom: 0;
  172. /* linear gradient from background-color to transparent on the top */
  173. background: linear-gradient(0deg, var(--primary-bg-color) 55%, transparent 100%);
  174. width: 100%;
  175. display: flex;
  176. flex-direction: column;
  177. justify-content: center;
  178. align-items: center;
  179. z-index: 999;
  180. }
  181. .input-performance {
  182. margin-top: 4rem;
  183. display: flex;
  184. flex-direction: row;
  185. gap: 1rem;
  186. }
  187. .input-performance-point {
  188. display: flex;
  189. flex-direction: row;
  190. place-items: center;
  191. gap: 0.5rem;
  192. }
  193. .input-performance-point > p {
  194. height: 1rem;
  195. line-height: normal;
  196. }
  197. .input {
  198. width: 90%;
  199. min-height: 3rem;
  200. flex-shrink: 0;
  201. display: flex;
  202. flex-direction: row;
  203. justify-content: center;
  204. gap: 0.5rem;
  205. align-items: flex-end;
  206. margin-bottom: 2rem;
  207. }
  208. .input-form {
  209. width: 100%;
  210. padding: 1rem;
  211. min-height: 3rem;
  212. max-height: 8rem;
  213. background-color: var(--tertiary-bg-color);
  214. color: var(--foreground-color);
  215. border-radius: 10px;
  216. border: none;
  217. resize: none;
  218. outline: none;
  219. }
  220. .input-button {
  221. height: 3rem;
  222. width: 4rem;
  223. background-color: var(--secondary-color);
  224. color: var(--foreground-color);
  225. border-radius: 10px;
  226. padding: 0.5rem;
  227. cursor: pointer;
  228. }
  229. .input-button:hover {
  230. background-color: var(--secondary-color-transparent);
  231. }
  232. .input-button:disabled {
  233. background-color: var(--secondary-bg-color);
  234. cursor: not-allowed;
  235. }
  236. /* wrap text */
  237. p {
  238. white-space: pre-wrap;
  239. }
  240. /* fonts */
  241. .megrim-regular {
  242. font-family: "Megrim", system-ui;
  243. font-weight: 400;
  244. font-style: normal;
  245. }
  246. .monospace {
  247. font-family: monospace;
  248. }
  249. .model-selector {
  250. display: flex;
  251. justify-content: center;
  252. padding: 20px 0;
  253. }
  254. .model-selector select {
  255. padding: 10px 20px;
  256. font-size: 16px;
  257. border: 1px solid #ccc;
  258. border-radius: 5px;
  259. background-color: #f8f8f8;
  260. cursor: pointer;
  261. }
  262. .model-selector select:focus {
  263. outline: none;
  264. border-color: #007bff;
  265. box-shadow: 0 0 0 2px rgba(0,123,255,.25);
  266. }
  267. /* Image upload button styles */
  268. .image-input-button {
  269. background-color: var(--secondary-color);
  270. color: var(--foreground-color);
  271. border: none;
  272. border-radius: 50%;
  273. width: 40px;
  274. height: 40px;
  275. font-size: 18px;
  276. cursor: pointer;
  277. transition: all 0.3s ease;
  278. display: flex;
  279. align-items: center;
  280. justify-content: center;
  281. margin-right: 10px;
  282. }
  283. .image-input-button:hover {
  284. background-color: var(--secondary-color-transparent);
  285. transform: scale(1.1);
  286. }
  287. .image-input-button:focus {
  288. outline: none;
  289. box-shadow: 0 0 0 3px rgba(var(--secondary-color-rgb), 0.5);
  290. }
  291. .image-input-button i {
  292. transition: all 0.3s ease;
  293. }
  294. .image-input-button:hover i {
  295. transform: scale(1.2);
  296. }
  297. /* Hidden file input styles */
  298. #image-upload {
  299. display: none;
  300. }
  301. .image-preview-container {
  302. position: relative;
  303. display: inline-block;
  304. margin-right: 10px;
  305. }
  306. .image-preview {
  307. max-width: 100px;
  308. max-height: 100px;
  309. object-fit: cover;
  310. border-radius: 5px;
  311. }
  312. .remove-image-button {
  313. position: absolute;
  314. top: -5px;
  315. right: -5px;
  316. background-color: rgba(255, 255, 255, 0.8);
  317. border: none;
  318. border-radius: 50%;
  319. padding: 2px 5px;
  320. cursor: pointer;
  321. }
  322. .message > p > img {
  323. max-width: 100%;
  324. max-height: 100%;
  325. object-fit: contain;
  326. }