home.module.scss 9.3 KB

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