chat.module.scss 7.1 KB

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