ai-chat-component.component.scss 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409
  1. ion-toolbar {
  2. height: 70px; /* 设置你想要的高度 */
  3. --min-height: 60px; /* 设置最小高度 */
  4. padding: 0; /* 去掉内边距 */
  5. display: flex; /* 使用Flexbox布局 */
  6. align-items: center; /* 垂直居中对齐 */
  7. --background: transparent; /* 去除背景色 */
  8. }
  9. //头部样式
  10. ion-header{
  11. background-color: #99d75c ;
  12. --background: transparent; /* 去除背景色 */
  13. }
  14. //头部标题
  15. ion-title {
  16. margin: 0; /* 去掉默认的外边距 */
  17. flex: 1; /* 让标题占据剩余空间 */
  18. text-align: center; /* 让标题文本居中 */
  19. font-size: 24px;
  20. }
  21. /* 文本输入框样式 */
  22. .input-box {
  23. background-color: white; /* 设置输入框背景为白色 */
  24. border-radius: 8px; /* 圆角 */
  25. height: 40px; /* 高度 */
  26. flex: 1; /* 让输入框占据剩余空间 */
  27. }
  28. /* 底部内容容器 */
  29. .footer-content {
  30. display: flex; /* 使用Flexbox布局 */
  31. align-items: center; /* 垂直居中对齐 */
  32. justify-content: center; /* 水平居中对齐 */
  33. width: 100%; /* 宽度100% */
  34. }
  35. //底部按钮样式
  36. ion-buttons {
  37. margin: 0 5px; /* 按钮之间的间距 */
  38. }
  39. //底部发送按钮圆圈样式
  40. .circle{
  41. width: 35px;
  42. height: 35px;
  43. border-radius: 50%;
  44. border:2px white solid;
  45. display: flex; /* 使用Flexbox布局 */
  46. align-items: center; /* 垂直居中对齐 */
  47. justify-content: center; /* 水平居中对齐 */
  48. }
  49. //聊天内容容器样式
  50. .chat-container {
  51. display: flex;
  52. flex-direction: column;
  53. padding-top: 10px;
  54. }
  55. //聊天内容样式
  56. .message-container {
  57. display: flex; /* 使用Flexbox布局 */
  58. justify-content: flex-end; /* 用户消息在右边,AI消息在左边 */
  59. margin: 10px 0; /* 消息之间的间距 */
  60. }
  61. //消息内容样式
  62. .message-content {
  63. display: flex; /* 使用Flexbox布局 */
  64. align-items: center; /* 垂直居中对齐 */
  65. }
  66. //用户消息和头像样式
  67. .user-message-content {
  68. justify-content: flex-end; /* 用户消息和头像在右边 */
  69. }
  70. //AI消息和头像样式
  71. .ai-message-content {
  72. justify-content: flex-start; /* AI消息和头像在左边 */
  73. }
  74. //气泡样式
  75. .message-bubble {
  76. background-color: #99d75c; /* 绿色气泡的背景色 */
  77. color: white; /* 字体颜色 */
  78. border-radius: 15px; /* 圆角 */
  79. padding: 10px 15px; /* 内边距 */
  80. max-width: 60%; /* 最大宽度 */
  81. }
  82. //用户消息样式
  83. .user-message {
  84. background-color: #99d75c; /* 用户消息的颜色 */
  85. margin-left: 10px; /* 与头像之间的间距 */
  86. }
  87. //AI消息样式
  88. .ai-message {
  89. background-color: white; /* AI消息的气泡颜色 */
  90. color: black; /* 字体颜色 */
  91. border: 1px solid black; /* 添加黑色边框 */
  92. box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3); /* 添加阴影效果 */
  93. margin-right: 10px; /* 与头像之间的间距 */
  94. }
  95. //用户头像样式
  96. .user-avatar {
  97. width: 40px; /* 头像宽度 */
  98. height: 40px; /* 头像高度 */
  99. border-radius: 50%; /* 圆形 */
  100. overflow: hidden; /* 超出部分隐藏 */
  101. display: flex; /* 使用Flexbox布局 */
  102. align-items: center; /* 垂直居中对齐 */
  103. justify-content: center; /* 水平居中对齐 */
  104. background-color: #f0f0f0; /* 背景色 */
  105. border: 2px solid #99d75c; /* 边框颜色 */
  106. margin-left: 5px; /* 与消息之间的间距 */
  107. }
  108. //AI头像样式
  109. .ai-avatar {
  110. width: 40px; /* 头像宽度 */
  111. height: 40px; /* 头像高度 */
  112. border-radius: 50%; /* 圆形 */
  113. overflow: hidden; /* 超出部分隐藏 */
  114. display: flex; /* 使用Flexbox布局 */
  115. align-items: center; /* 垂直居中对齐 */
  116. justify-content: center; /* 水平居中对齐 */
  117. background-color: #f0f0f0; /* 背景色 */
  118. border: 2px solid #99d75c; /* 边框颜色 */
  119. margin-right: 5px; /* 与消息之间的间距 */
  120. }
  121. //用户头像图片样式
  122. .user-avatar img {
  123. width: 100%; /* 使图片适应头像框 */
  124. height: 100%; /* 使图片适应头像框 */
  125. object-fit: cover; /* 保持图片比例,裁剪多余部分 */
  126. }
  127. //AI头像图片样式
  128. .ai-avatar img {
  129. width: 100%; /* 使图片适应头像框 */
  130. height: 100%; /* 使图片适应头像框 */
  131. object-fit: cover; /* 保持图片比例,裁剪多余部分 */
  132. }
  133. //语音框
  134. .yuyinframe{
  135. --background: transparent;
  136. background-color: #99d75c;
  137. display: flex;
  138. flex-direction: column;
  139. justify-content: center;
  140. align-items: center;
  141. }
  142. .modal-content {
  143. display: flex;
  144. align-items: center; /* 垂直居中对齐 */
  145. justify-content: center; /* 水平居中对齐 */
  146. width: 100%; /* 宽度100% */
  147. height: 25%;
  148. }
  149. //语音框中间内容框
  150. .timer-container {
  151. height: 100%;
  152. flex-direction: column; /* 垂直排列 */
  153. justify-content: center; /* 水平居中对齐 */
  154. }
  155. //计时器样式
  156. #timer{
  157. width: 100%;
  158. margin-top: 30px; /* 可根据需要调整这个值 */
  159. text-align: center; /* 确保文本居中 */
  160. margin-bottom: 10px;
  161. }
  162. /*语音取消按钮的样式 */
  163. .cancle-button {
  164. font-size: 75px;
  165. display: flex; /* 使用Flexbox布局 */
  166. align-items: center; /* 垂直居中对齐 */
  167. justify-content: center; /* 水平居中对齐 */
  168. color: white;
  169. background-color: #99d75c;
  170. margin-right: 20px;
  171. }
  172. /*语音发送按钮的样式 */
  173. .send-button {
  174. height:60px ;
  175. width: 60px;
  176. border-radius: 50%;//圆
  177. display: flex; /* 使用Flexbox布局 */
  178. align-items: center; /* 垂直居中对齐 */
  179. justify-content: center; /* 水平居中对齐 */
  180. color: white;
  181. background-color: #99d75c;
  182. border: 5px solid white;
  183. margin-left: 20px;
  184. }
  185. //音律跳动
  186. .light {
  187. width: 100%;
  188. height: 90px;
  189. display: flex;
  190. }
  191. .light span {
  192. width: 10px;
  193. border-radius: 18px;
  194. margin-right: 20px;
  195. }
  196. .light span:nth-child(1) {
  197. animation: bar1 2s 0.2s infinite linear;
  198. }
  199. .light span:nth-child(2) {
  200. animation: bar2 2s 0.4s infinite linear;
  201. }
  202. .light span:nth-child(3) {
  203. animation: bar3 2s 0.6s infinite linear;
  204. }
  205. .light span:nth-child(4) {
  206. animation: bar4 2s 0.8s infinite linear;
  207. }
  208. .light span:nth-child(5) {
  209. animation: bar5 2s 1.0s infinite linear;
  210. }
  211. .light span:nth-child(6) {
  212. animation: bar6 2s 1.2s infinite linear;
  213. }
  214. .light span:nth-child(7) {
  215. animation: bar7 2s 1.4s infinite linear;
  216. }
  217. .light span:nth-child(8) {
  218. animation: bar8 2s 1.6s infinite linear;
  219. }
  220. .light span:nth-child(9) {
  221. animation: bar9 2s 1.8s infinite linear;
  222. }
  223. //第一条音律加载动画
  224. @keyframes bar1 {
  225. 0% {
  226. background: #f677b0;
  227. margin-top: 25%;
  228. height: 10%;
  229. }
  230. 50% {
  231. background: #f677b0;
  232. height: 100%;
  233. margin-top: 0%;
  234. }
  235. 100% {
  236. background: #f677b0;
  237. height: 10%;
  238. margin-top: 25%;
  239. }
  240. }
  241. //第二条音律加载动画
  242. @keyframes bar2 {
  243. 0% {
  244. background: #df7ff2;
  245. margin-top: 25%;
  246. height: 10%;
  247. }
  248. 50% {
  249. background: #df7ff2;
  250. height: 100%;
  251. margin-top: 0%;
  252. }
  253. 100% {
  254. background: #df7ff2;
  255. height: 10%;
  256. margin-top: 25%;
  257. }
  258. }
  259. //第三条音律加载动画
  260. @keyframes bar3 {
  261. 0% {
  262. background: #8c7ff2;
  263. margin-top: 25%;
  264. height: 10%;
  265. }
  266. 50% {
  267. background: #8c7ff2;
  268. height: 100%;
  269. margin-top: 0%;
  270. }
  271. 100% {
  272. background: #8c7ff2;
  273. height: 10%;
  274. margin-top: 25%;
  275. }
  276. }
  277. //第四条音律加载动画
  278. @keyframes bar4 {
  279. 0% {
  280. background: #024b6a;
  281. margin-top: 25%;
  282. height: 10%;
  283. }
  284. 50% {
  285. background: #024b6a;
  286. height: 100%;
  287. margin-top: 0%;
  288. }
  289. 100% {
  290. background: #024b6a;
  291. height: 10%;
  292. margin-top: 25%;
  293. }
  294. }
  295. //第五条音律加载动画
  296. @keyframes bar5 {
  297. 0% {
  298. background: #7ff2d3;
  299. margin-top: 25%;
  300. height: 10%;
  301. }
  302. 50% {
  303. background: #7ff2d3;
  304. height: 100%;
  305. margin-top: 0%;
  306. }
  307. 100% {
  308. background: #7ff2d3;
  309. height: 10%;
  310. margin-top: 25%;
  311. }
  312. }
  313. //三个点的加载动画
  314. .loading-dots {
  315. display: flex;
  316. align-items: center;
  317. margin-left: 10px; /* 气泡与点之间的间距 */
  318. }
  319. .loading-dot {
  320. width: 8px;
  321. height: 8px;
  322. border-radius: 50%;
  323. background-color: #99d75c; /* 点的颜色 */
  324. margin: 0 2px; /* 点之间的间距 */
  325. animation: loading 1s infinite; /* 加载动画 */
  326. }
  327. //第一个点
  328. .loading-dot:nth-child(1) {
  329. animation-delay: 0s;
  330. }
  331. //第二个点
  332. .loading-dot:nth-child(2) {
  333. animation-delay: 0.2s;
  334. }
  335. //第三个点
  336. .loading-dot:nth-child(3) {
  337. animation-delay: 0.4s;
  338. }
  339. //加载动画
  340. @keyframes loading {
  341. 0%, 100% {
  342. opacity: 0.5;
  343. }
  344. 50% {
  345. opacity: 1;
  346. }
  347. }
  348. /* 表情选择器样式 */
  349. .emoji-picker {
  350. --background: transparent; //去除默认样式
  351. background-color: #99d75c; /* 背景颜色 */
  352. display: flex;
  353. flex-wrap: wrap; /* 允许换行 */
  354. padding: 10px;
  355. justify-content: flex-start; /* 左对齐 */
  356. overflow-y: scroll; /* 允许纵向滚动 */
  357. height: 200px;
  358. }
  359. //表情按钮
  360. .emoji-button {
  361. margin: 9px; /* 每个表情与顶部的间距 */
  362. cursor: pointer; /* 鼠标悬停时显示为指针 */
  363. font-size: 28px; /* 字体大小 */
  364. height: 40px; /* 按钮高度 */
  365. width: 40px; /* 按钮宽度 */
  366. display: flex; /* 使用 flexbox 对齐 */
  367. align-items: center; /* 垂直居中 */
  368. justify-content: center; /* 水平居中 */
  369. --background: transparent; /* 背景透明 */
  370. --box-shadow: none; /* 去掉阴影 */
  371. --outline: none; /* 去掉轮廓 */
  372. border: none; /* 去掉边框 */
  373. float: left;
  374. }