chat.module.scss 8.5 KB

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