home.module.scss 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548
  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.05s;
  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. animation: slide-in ease 0.3s;
  109. }
  110. .sidebar-sub-title {
  111. font-size: 12px;
  112. font-weight: 400px;
  113. animation: slide-in ease 0.3s;
  114. }
  115. .sidebar-body {
  116. flex: 1;
  117. overflow: auto;
  118. }
  119. .chat-list {
  120. }
  121. .chat-item {
  122. padding: 10px 14px;
  123. background-color: var(--white);
  124. border-radius: 10px;
  125. margin-bottom: 10px;
  126. box-shadow: var(--card-shadow);
  127. transition: background-color 0.3s ease;
  128. cursor: pointer;
  129. user-select: none;
  130. border: 2px solid transparent;
  131. position: relative;
  132. overflow: hidden;
  133. }
  134. .chat-item:hover {
  135. background-color: var(--hover-color);
  136. }
  137. .chat-item-selected {
  138. border-color: var(--primary);
  139. }
  140. .chat-item-title {
  141. font-size: 14px;
  142. font-weight: bolder;
  143. display: block;
  144. width: 200px;
  145. overflow: hidden;
  146. text-overflow: ellipsis;
  147. white-space: nowrap;
  148. animation: slide-in ease 0.3s;
  149. }
  150. .chat-item-delete {
  151. position: absolute;
  152. top: 10px;
  153. right: -20px;
  154. transition: all ease 0.3s;
  155. opacity: 0;
  156. cursor: pointer;
  157. }
  158. .chat-item:hover > .chat-item-delete {
  159. opacity: 0.5;
  160. right: 10px;
  161. }
  162. .chat-item:hover > .chat-item-delete:hover {
  163. opacity: 1;
  164. }
  165. .chat-item-info {
  166. display: flex;
  167. justify-content: space-between;
  168. color: rgb(166, 166, 166);
  169. font-size: 12px;
  170. margin-top: 8px;
  171. animation: slide-in ease 0.3s;
  172. }
  173. .chat-item-count,
  174. .chat-item-date {
  175. overflow: hidden;
  176. text-overflow: ellipsis;
  177. white-space: nowrap;
  178. }
  179. .narrow-sidebar {
  180. .sidebar-title,
  181. .sidebar-sub-title {
  182. display: none;
  183. }
  184. .sidebar-logo {
  185. position: relative;
  186. display: flex;
  187. justify-content: center;
  188. }
  189. .chat-item {
  190. padding: 0;
  191. min-height: 50px;
  192. display: flex;
  193. justify-content: center;
  194. align-items: center;
  195. transition: all ease 0.3s;
  196. &:hover {
  197. .chat-item-narrow {
  198. transform: scale(0.7) translateX(-50%);
  199. }
  200. }
  201. }
  202. .chat-item-narrow {
  203. font-weight: bolder;
  204. font-size: 24px;
  205. line-height: 0;
  206. font-weight: lighter;
  207. color: var(--black);
  208. transform: translateX(0);
  209. transition: all ease 0.3s;
  210. opacity: 0.1;
  211. padding: 4px;
  212. }
  213. .chat-item-delete {
  214. top: 15px;
  215. }
  216. .chat-item:hover > .chat-item-delete {
  217. opacity: 0.5;
  218. right: 5px;
  219. }
  220. .sidebar-tail {
  221. flex-direction: column;
  222. align-items: center;
  223. .sidebar-actions {
  224. flex-direction: column;
  225. align-items: center;
  226. .sidebar-action {
  227. margin-right: 0;
  228. margin-bottom: 15px;
  229. }
  230. }
  231. }
  232. }
  233. .sidebar-tail {
  234. display: flex;
  235. justify-content: space-between;
  236. padding-top: 20px;
  237. }
  238. .sidebar-actions {
  239. display: inline-flex;
  240. }
  241. .sidebar-action:not(:last-child) {
  242. margin-right: 15px;
  243. }
  244. .chat {
  245. display: flex;
  246. flex-direction: column;
  247. position: relative;
  248. height: 100%;
  249. }
  250. .chat-body {
  251. flex: 1;
  252. overflow: auto;
  253. padding: 20px;
  254. padding-bottom: 40px;
  255. position: relative;
  256. }
  257. .chat-body-title {
  258. cursor: pointer;
  259. &:hover {
  260. text-decoration: underline;
  261. }
  262. }
  263. .chat-message {
  264. display: flex;
  265. flex-direction: row;
  266. &:last-child {
  267. animation: slide-in ease 0.3s;
  268. }
  269. }
  270. .chat-message-user {
  271. display: flex;
  272. flex-direction: row-reverse;
  273. }
  274. .chat-message-container {
  275. max-width: var(--message-max-width);
  276. display: flex;
  277. flex-direction: column;
  278. align-items: flex-start;
  279. &:hover {
  280. .chat-message-top-actions {
  281. opacity: 1;
  282. right: 10px;
  283. pointer-events: all;
  284. }
  285. }
  286. }
  287. .chat-message-user > .chat-message-container {
  288. align-items: flex-end;
  289. }
  290. .chat-message-avatar {
  291. margin-top: 20px;
  292. }
  293. .chat-message-status {
  294. font-size: 12px;
  295. color: #aaa;
  296. line-height: 1.5;
  297. margin-top: 5px;
  298. }
  299. .user-avtar {
  300. height: 30px;
  301. width: 30px;
  302. display: flex;
  303. align-items: center;
  304. justify-content: center;
  305. border: var(--border-in-light);
  306. box-shadow: var(--card-shadow);
  307. border-radius: 10px;
  308. }
  309. .chat-message-item {
  310. box-sizing: border-box;
  311. max-width: 100%;
  312. margin-top: 10px;
  313. border-radius: 10px;
  314. background-color: rgba(0, 0, 0, 0.05);
  315. padding: 10px;
  316. font-size: 14px;
  317. user-select: text;
  318. word-break: break-word;
  319. border: var(--border-in-light);
  320. position: relative;
  321. }
  322. .chat-message-top-actions {
  323. font-size: 12px;
  324. position: absolute;
  325. right: 20px;
  326. top: -26px;
  327. left: 100px;
  328. transition: all ease 0.3s;
  329. opacity: 0;
  330. pointer-events: none;
  331. display: flex;
  332. flex-direction: row-reverse;
  333. .chat-message-top-action {
  334. opacity: 0.5;
  335. color: var(--black);
  336. white-space: nowrap;
  337. cursor: pointer;
  338. &:hover {
  339. opacity: 1;
  340. }
  341. &:not(:first-child) {
  342. margin-right: 10px;
  343. }
  344. }
  345. }
  346. .chat-message-user > .chat-message-container > .chat-message-item {
  347. background-color: var(--second);
  348. }
  349. .chat-message-actions {
  350. display: flex;
  351. flex-direction: row-reverse;
  352. width: 100%;
  353. padding-top: 5px;
  354. box-sizing: border-box;
  355. font-size: 12px;
  356. }
  357. .chat-message-action-date {
  358. color: #aaa;
  359. }
  360. .chat-input-panel {
  361. position: relative;
  362. width: 100%;
  363. padding: 20px;
  364. padding-top: 10px;
  365. box-sizing: border-box;
  366. flex-direction: column;
  367. border-top-left-radius: 10px;
  368. border-top-right-radius: 10px;
  369. border-top: var(--border-in-light);
  370. box-shadow: var(--card-shadow);
  371. }
  372. @mixin single-line {
  373. white-space: nowrap;
  374. overflow: hidden;
  375. text-overflow: ellipsis;
  376. }
  377. .prompt-hints {
  378. min-height: 20px;
  379. width: 100%;
  380. max-height: 50vh;
  381. overflow: auto;
  382. display: flex;
  383. flex-direction: column-reverse;
  384. background-color: var(--white);
  385. border: var(--border-in-light);
  386. border-radius: 10px;
  387. margin-bottom: 10px;
  388. box-shadow: var(--shadow);
  389. .prompt-hint {
  390. color: var(--black);
  391. padding: 6px 10px;
  392. animation: slide-in ease 0.3s;
  393. cursor: pointer;
  394. transition: all ease 0.3s;
  395. border: transparent 1px solid;
  396. margin: 4px;
  397. border-radius: 8px;
  398. &:not(:last-child) {
  399. margin-top: 0;
  400. }
  401. .hint-title {
  402. font-size: 12px;
  403. font-weight: bolder;
  404. @include single-line();
  405. }
  406. .hint-content {
  407. font-size: 12px;
  408. @include single-line();
  409. }
  410. &-selected,
  411. &:hover {
  412. border-color: var(--primary);
  413. }
  414. }
  415. }
  416. .chat-input-panel-inner {
  417. display: flex;
  418. flex: 1;
  419. }
  420. .chat-input {
  421. height: 100%;
  422. width: 100%;
  423. border-radius: 10px;
  424. border: var(--border-in-light);
  425. box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.03);
  426. background-color: var(--white);
  427. color: var(--black);
  428. font-family: inherit;
  429. padding: 10px 90px 10px 14px;
  430. resize: none;
  431. outline: none;
  432. }
  433. .chat-input:focus {
  434. border: 1px solid var(--primary);
  435. }
  436. .chat-input-send {
  437. background-color: var(--primary);
  438. color: white;
  439. position: absolute;
  440. right: 30px;
  441. bottom: 32px;
  442. }
  443. @media only screen and (max-width: 600px) {
  444. .chat-input {
  445. font-size: 16px;
  446. }
  447. .chat-input-send {
  448. bottom: 30px;
  449. }
  450. }
  451. .export-content {
  452. white-space: break-spaces;
  453. padding: 10px !important;
  454. }
  455. .loading-content {
  456. display: flex;
  457. flex-direction: column;
  458. justify-content: center;
  459. align-items: center;
  460. height: 100%;
  461. width: 100%;
  462. }