home.module.scss 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551
  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. .chat-message-item {
  313. box-sizing: border-box;
  314. max-width: 100%;
  315. margin-top: 10px;
  316. border-radius: 10px;
  317. background-color: rgba(0, 0, 0, 0.05);
  318. padding: 10px;
  319. font-size: 14px;
  320. user-select: text;
  321. word-break: break-word;
  322. border: var(--border-in-light);
  323. position: relative;
  324. }
  325. .chat-message-top-actions {
  326. font-size: 12px;
  327. position: absolute;
  328. right: 20px;
  329. top: -26px;
  330. left: 100px;
  331. transition: all ease 0.3s;
  332. opacity: 0;
  333. pointer-events: none;
  334. display: flex;
  335. flex-direction: row-reverse;
  336. .chat-message-top-action {
  337. opacity: 0.5;
  338. color: var(--black);
  339. white-space: nowrap;
  340. cursor: pointer;
  341. &:hover {
  342. opacity: 1;
  343. }
  344. &:not(:first-child) {
  345. margin-right: 10px;
  346. }
  347. }
  348. }
  349. .chat-message-user > .chat-message-container > .chat-message-item {
  350. background-color: var(--second);
  351. }
  352. .chat-message-actions {
  353. display: flex;
  354. flex-direction: row-reverse;
  355. width: 100%;
  356. padding-top: 5px;
  357. box-sizing: border-box;
  358. font-size: 12px;
  359. }
  360. .chat-message-action-date {
  361. color: #aaa;
  362. }
  363. .chat-input-panel {
  364. position: relative;
  365. width: 100%;
  366. padding: 20px;
  367. padding-top: 10px;
  368. box-sizing: border-box;
  369. flex-direction: column;
  370. border-top-left-radius: 10px;
  371. border-top-right-radius: 10px;
  372. border-top: var(--border-in-light);
  373. box-shadow: var(--card-shadow);
  374. }
  375. @mixin single-line {
  376. white-space: nowrap;
  377. overflow: hidden;
  378. text-overflow: ellipsis;
  379. }
  380. .prompt-hints {
  381. min-height: 20px;
  382. width: 100%;
  383. max-height: 50vh;
  384. overflow: auto;
  385. display: flex;
  386. flex-direction: column-reverse;
  387. background-color: var(--white);
  388. border: var(--border-in-light);
  389. border-radius: 10px;
  390. margin-bottom: 10px;
  391. box-shadow: var(--shadow);
  392. .prompt-hint {
  393. color: var(--black);
  394. padding: 6px 10px;
  395. animation: slide-in ease 0.3s;
  396. cursor: pointer;
  397. transition: all ease 0.3s;
  398. border: transparent 1px solid;
  399. margin: 4px;
  400. border-radius: 8px;
  401. &:not(:last-child) {
  402. margin-top: 0;
  403. }
  404. .hint-title {
  405. font-size: 12px;
  406. font-weight: bolder;
  407. @include single-line();
  408. }
  409. .hint-content {
  410. font-size: 12px;
  411. @include single-line();
  412. }
  413. &-selected,
  414. &:hover {
  415. border-color: var(--primary);
  416. }
  417. }
  418. }
  419. .chat-input-panel-inner {
  420. display: flex;
  421. flex: 1;
  422. }
  423. .chat-input {
  424. height: 100%;
  425. width: 100%;
  426. border-radius: 10px;
  427. border: var(--border-in-light);
  428. box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.03);
  429. background-color: var(--white);
  430. color: var(--black);
  431. font-family: inherit;
  432. padding: 10px 90px 10px 14px;
  433. resize: none;
  434. outline: none;
  435. }
  436. .chat-input:focus {
  437. border: 1px solid var(--primary);
  438. }
  439. .chat-input-send {
  440. background-color: var(--primary);
  441. color: white;
  442. position: absolute;
  443. right: 30px;
  444. bottom: 32px;
  445. }
  446. @media only screen and (max-width: 600px) {
  447. .chat-input {
  448. font-size: 16px;
  449. }
  450. .chat-input-send {
  451. bottom: 30px;
  452. }
  453. }
  454. .export-content {
  455. white-space: break-spaces;
  456. padding: 10px !important;
  457. }
  458. .loading-content {
  459. display: flex;
  460. flex-direction: column;
  461. justify-content: center;
  462. align-items: center;
  463. height: 100%;
  464. width: 100%;
  465. }