home.module.scss 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478
  1. @import "./window.scss";
  2. @import "../styles/animation.scss";
  3. @mixin container {
  4. background-color: var(--white);
  5. border: var(--border-in-light);
  6. border-radius: 20px;
  7. box-shadow: var(--shadow);
  8. color: var(--black);
  9. background-color: var(--white);
  10. min-width: 600px;
  11. min-height: 480px;
  12. max-width: 1200px;
  13. display: flex;
  14. overflow: hidden;
  15. box-sizing: border-box;
  16. width: var(--window-width);
  17. height: var(--window-height);
  18. }
  19. .container {
  20. @include container();
  21. }
  22. @media only screen and (min-width: 600px) {
  23. .tight-container {
  24. --window-width: 100vw;
  25. --window-height: var(--full-height);
  26. --window-content-width: calc(100% - var(--sidebar-width));
  27. @include container();
  28. max-width: 100vw;
  29. max-height: var(--full-height);
  30. border-radius: 0;
  31. border: 0;
  32. }
  33. }
  34. .sidebar {
  35. top: 0;
  36. width: var(--sidebar-width);
  37. box-sizing: border-box;
  38. padding: 20px;
  39. background-color: var(--second);
  40. display: flex;
  41. flex-direction: column;
  42. box-shadow: inset -2px 0px 2px 0px rgb(0, 0, 0, 0.05);
  43. position: relative;
  44. transition: width ease 0.1s;
  45. }
  46. .sidebar-drag {
  47. $width: 10px;
  48. position: absolute;
  49. top: 0;
  50. right: 0;
  51. height: 100%;
  52. width: $width;
  53. background-color: var(--black);
  54. cursor: ew-resize;
  55. opacity: 0;
  56. transition: all ease 0.3s;
  57. &:hover,
  58. &:active {
  59. opacity: 0.2;
  60. }
  61. }
  62. .window-content {
  63. width: var(--window-content-width);
  64. height: 100%;
  65. display: flex;
  66. flex-direction: column;
  67. }
  68. .mobile {
  69. display: none;
  70. }
  71. @media only screen and (max-width: 600px) {
  72. .container {
  73. min-height: unset;
  74. min-width: unset;
  75. max-height: unset;
  76. min-width: unset;
  77. border: 0;
  78. border-radius: 0;
  79. }
  80. .sidebar {
  81. position: absolute;
  82. left: -100%;
  83. z-index: 1000;
  84. height: var(--full-height);
  85. transition: all ease 0.3s;
  86. box-shadow: none;
  87. }
  88. .sidebar-show {
  89. left: 0;
  90. }
  91. .mobile {
  92. display: block;
  93. }
  94. }
  95. .sidebar-header {
  96. position: relative;
  97. padding-top: 20px;
  98. padding-bottom: 20px;
  99. }
  100. .sidebar-logo {
  101. position: absolute;
  102. right: 0;
  103. bottom: 18px;
  104. }
  105. .sidebar-title {
  106. font-size: 20px;
  107. font-weight: bold;
  108. }
  109. .sidebar-sub-title {
  110. font-size: 12px;
  111. font-weight: 400px;
  112. }
  113. .sidebar-body {
  114. flex: 1;
  115. overflow: auto;
  116. }
  117. .chat-list {
  118. }
  119. .chat-item {
  120. padding: 10px 14px;
  121. background-color: var(--white);
  122. border-radius: 10px;
  123. margin-bottom: 10px;
  124. box-shadow: var(--card-shadow);
  125. transition: background-color 0.3s ease;
  126. cursor: pointer;
  127. user-select: none;
  128. border: 2px solid transparent;
  129. position: relative;
  130. overflow: hidden;
  131. }
  132. .chat-item:hover {
  133. background-color: var(--hover-color);
  134. }
  135. .chat-item-selected {
  136. border-color: var(--primary);
  137. }
  138. .chat-item-title {
  139. font-size: 14px;
  140. font-weight: bolder;
  141. display: block;
  142. width: 200px;
  143. overflow: hidden;
  144. text-overflow: ellipsis;
  145. white-space: nowrap;
  146. }
  147. .chat-item-delete {
  148. position: absolute;
  149. top: 10px;
  150. right: -20px;
  151. transition: all ease 0.3s;
  152. opacity: 0;
  153. cursor: pointer;
  154. }
  155. .chat-item:hover > .chat-item-delete {
  156. opacity: 0.5;
  157. right: 10px;
  158. }
  159. .chat-item:hover > .chat-item-delete:hover {
  160. opacity: 1;
  161. }
  162. .chat-item-info {
  163. display: flex;
  164. justify-content: space-between;
  165. color: rgb(166, 166, 166);
  166. font-size: 12px;
  167. margin-top: 8px;
  168. }
  169. .chat-item-count,
  170. .chat-item-date {
  171. overflow: hidden;
  172. text-overflow: ellipsis;
  173. white-space: nowrap;
  174. }
  175. .sidebar-tail {
  176. display: flex;
  177. justify-content: space-between;
  178. padding-top: 20px;
  179. }
  180. .sidebar-actions {
  181. display: inline-flex;
  182. }
  183. .sidebar-action:not(:last-child) {
  184. margin-right: 15px;
  185. }
  186. .chat {
  187. display: flex;
  188. flex-direction: column;
  189. position: relative;
  190. height: 100%;
  191. }
  192. .chat-body {
  193. flex: 1;
  194. overflow: auto;
  195. padding: 20px;
  196. padding-bottom: 40px;
  197. position: relative;
  198. }
  199. .chat-body-title {
  200. cursor: pointer;
  201. &:hover {
  202. text-decoration: underline;
  203. }
  204. }
  205. .chat-message {
  206. display: flex;
  207. flex-direction: row;
  208. }
  209. .chat-message-user {
  210. display: flex;
  211. flex-direction: row-reverse;
  212. }
  213. .chat-message-container {
  214. max-width: var(--message-max-width);
  215. display: flex;
  216. flex-direction: column;
  217. align-items: flex-start;
  218. animation: slide-in ease 0.3s;
  219. &:hover {
  220. .chat-message-top-actions {
  221. opacity: 1;
  222. right: 10px;
  223. pointer-events: all;
  224. }
  225. }
  226. }
  227. .chat-message-user > .chat-message-container {
  228. align-items: flex-end;
  229. }
  230. .chat-message-avatar {
  231. margin-top: 20px;
  232. }
  233. .chat-message-status {
  234. font-size: 12px;
  235. color: #aaa;
  236. line-height: 1.5;
  237. margin-top: 5px;
  238. }
  239. .user-avtar {
  240. height: 30px;
  241. width: 30px;
  242. display: flex;
  243. align-items: center;
  244. justify-content: center;
  245. border: var(--border-in-light);
  246. box-shadow: var(--card-shadow);
  247. border-radius: 10px;
  248. }
  249. .chat-message-item {
  250. box-sizing: border-box;
  251. max-width: 100%;
  252. margin-top: 10px;
  253. border-radius: 10px;
  254. background-color: rgba(0, 0, 0, 0.05);
  255. padding: 10px;
  256. font-size: 14px;
  257. user-select: text;
  258. word-break: break-word;
  259. border: var(--border-in-light);
  260. position: relative;
  261. }
  262. .chat-message-top-actions {
  263. font-size: 12px;
  264. position: absolute;
  265. right: 20px;
  266. top: -26px;
  267. left: 100px;
  268. transition: all ease 0.3s;
  269. opacity: 0;
  270. pointer-events: none;
  271. display: flex;
  272. flex-direction: row-reverse;
  273. .chat-message-top-action {
  274. opacity: 0.5;
  275. color: var(--black);
  276. white-space: nowrap;
  277. cursor: pointer;
  278. &:hover {
  279. opacity: 1;
  280. }
  281. &:not(:first-child) {
  282. margin-right: 10px;
  283. }
  284. }
  285. }
  286. .chat-message-user > .chat-message-container > .chat-message-item {
  287. background-color: var(--second);
  288. }
  289. .chat-message-actions {
  290. display: flex;
  291. flex-direction: row-reverse;
  292. width: 100%;
  293. padding-top: 5px;
  294. box-sizing: border-box;
  295. font-size: 12px;
  296. }
  297. .chat-message-action-date {
  298. color: #aaa;
  299. }
  300. .chat-input-panel {
  301. position: relative;
  302. width: 100%;
  303. padding: 20px;
  304. padding-top: 10px;
  305. box-sizing: border-box;
  306. flex-direction: column;
  307. border-top-left-radius: 10px;
  308. border-top-right-radius: 10px;
  309. border-top: var(--border-in-light);
  310. box-shadow: var(--card-shadow);
  311. }
  312. @mixin single-line {
  313. white-space: nowrap;
  314. overflow: hidden;
  315. text-overflow: ellipsis;
  316. }
  317. .prompt-hints {
  318. min-height: 20px;
  319. width: 100%;
  320. max-height: 50vh;
  321. overflow: auto;
  322. display: flex;
  323. flex-direction: column-reverse;
  324. background-color: var(--white);
  325. border: var(--border-in-light);
  326. border-radius: 10px;
  327. margin-bottom: 10px;
  328. box-shadow: var(--shadow);
  329. .prompt-hint {
  330. color: var(--black);
  331. padding: 6px 10px;
  332. animation: slide-in ease 0.3s;
  333. cursor: pointer;
  334. transition: all ease 0.3s;
  335. border: transparent 1px solid;
  336. margin: 4px;
  337. border-radius: 8px;
  338. &:not(:last-child) {
  339. margin-top: 0;
  340. }
  341. .hint-title {
  342. font-size: 12px;
  343. font-weight: bolder;
  344. @include single-line();
  345. }
  346. .hint-content {
  347. font-size: 12px;
  348. @include single-line();
  349. }
  350. &-selected,
  351. &:hover {
  352. border-color: var(--primary);
  353. }
  354. }
  355. }
  356. .chat-input-panel-inner {
  357. display: flex;
  358. flex: 1;
  359. }
  360. .chat-input {
  361. height: 100%;
  362. width: 100%;
  363. border-radius: 10px;
  364. border: var(--border-in-light);
  365. box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.03);
  366. background-color: var(--white);
  367. color: var(--black);
  368. font-family: inherit;
  369. padding: 10px 90px 10px 14px;
  370. resize: none;
  371. outline: none;
  372. }
  373. .chat-input:focus {
  374. border: 1px solid var(--primary);
  375. }
  376. .chat-input-send {
  377. background-color: var(--primary);
  378. color: white;
  379. position: absolute;
  380. right: 30px;
  381. bottom: 32px;
  382. }
  383. @media only screen and (max-width: 600px) {
  384. .chat-input {
  385. font-size: 16px;
  386. }
  387. .chat-input-send {
  388. bottom: 30px;
  389. }
  390. }
  391. .export-content {
  392. white-space: break-spaces;
  393. padding: 10px !important;
  394. }
  395. .loading-content {
  396. display: flex;
  397. flex-direction: column;
  398. justify-content: center;
  399. align-items: center;
  400. height: 100%;
  401. width: 100%;
  402. }