home.module.scss 9.2 KB

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