home.module.scss 9.2 KB

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