aiGenerating.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. <template>
  2. <!-- 新的生成中动画组件 -->
  3. <div class="ai-generating">
  4. <!-- AI 星星图标 -->
  5. <div class="ai-icon">
  6. <svg viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
  7. <defs>
  8. <linearGradient id="starGrad" x1="0%" y1="0%" x2="100%" y2="100%">
  9. <stop offset="0%" stop-color="#6366f1" />
  10. <stop offset="100%" stop-color="#a855f7" />
  11. </linearGradient>
  12. </defs>
  13. <!-- 大星星 -->
  14. <path
  15. d="M10 2 L11.2 7.8 L17 9 L11.2 10.2 L10 16 L8.8 10.2 L3 9 L8.8 7.8 Z"
  16. fill="url(#starGrad)"
  17. style="animation: starPulse 1.8s ease-in-out infinite; transform-origin: 10px 9px">
  18. <animateTransform
  19. attributeName="transform"
  20. type="scale"
  21. values="1;1.12;1"
  22. dur="1.8s"
  23. repeatCount="indefinite"
  24. additive="sum"
  25. calcMode="ease" />
  26. </path>
  27. <!-- 小星星 -->
  28. <circle cx="15.5" cy="4.5" r="1.5" fill="#a855f7" opacity="0.7">
  29. <animate attributeName="opacity" values="0.4;1;0.4" dur="1.4s" repeatCount="indefinite" />
  30. <animate attributeName="r" values="1.2;1.8;1.2" dur="1.4s" repeatCount="indefinite" />
  31. </circle>
  32. <!-- 微星 -->
  33. <circle cx="4.5" cy="14.5" r="1" fill="#6366f1" opacity="0.5">
  34. <animate
  35. attributeName="opacity"
  36. values="0.3;0.9;0.3"
  37. dur="1.8s"
  38. begin="0.5s"
  39. repeatCount="indefinite" />
  40. <animate
  41. attributeName="r"
  42. values="0.8;1.4;0.8"
  43. dur="1.8s"
  44. begin="0.5s"
  45. repeatCount="indefinite" />
  46. </circle>
  47. </svg>
  48. </div>
  49. <!-- 三个跳动点 -->
  50. <!-- <div class="dots-container">
  51. <div class="dot"></div>
  52. <div class="dot"></div>
  53. <div class="dot"></div>
  54. </div> -->
  55. <!-- 渐变文字 -->
  56. <span class="gen-text">AI识别中</span>
  57. </div>
  58. </template>
  59. <style lang="scss" scoped>
  60. /* ===== AI 生成中动画 ===== */
  61. .ai-generating {
  62. display: flex;
  63. align-items: center;
  64. gap: 5px;
  65. background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(168, 85, 247, 0.08));
  66. border: 1px solid rgba(99, 102, 241, 0.2);
  67. border-radius: 20px 0 0 20px;
  68. padding: 3px 0px 3px 7px;
  69. margin-right: -3px;
  70. }
  71. /* AI 图标 - 彩色渐变扫描动效 */
  72. .ai-icon {
  73. width: 20px;
  74. height: 20px;
  75. position: relative;
  76. flex-shrink: 0;
  77. }
  78. .ai-icon svg {
  79. width: 20px;
  80. height: 20px;
  81. }
  82. /* 三个跳动圆点 */
  83. .dots-container {
  84. display: flex;
  85. align-items: center;
  86. gap: 3px;
  87. }
  88. .dot {
  89. width: 5px;
  90. height: 5px;
  91. border-radius: 50%;
  92. background: linear-gradient(135deg, #6366f1, #a855f7);
  93. animation: dotBounce 1.4s ease-in-out infinite;
  94. }
  95. .dot:nth-child(1) {
  96. animation-delay: 0s;
  97. }
  98. .dot:nth-child(2) {
  99. animation-delay: 0.2s;
  100. }
  101. .dot:nth-child(3) {
  102. animation-delay: 0.4s;
  103. }
  104. @keyframes dotBounce {
  105. 0%,
  106. 60%,
  107. 100% {
  108. transform: translateY(0);
  109. opacity: 0.5;
  110. }
  111. 30% {
  112. transform: translateY(-5px);
  113. opacity: 1;
  114. }
  115. }
  116. /* 生成中文字 */
  117. .gen-text {
  118. font-size: 12px;
  119. font-weight: 500;
  120. background: linear-gradient(90deg, #6366f1, #a855f7, #6366f1);
  121. background-size: 200% auto;
  122. -webkit-background-clip: text;
  123. -webkit-text-fill-color: transparent;
  124. background-clip: text;
  125. animation: textShimmer 2s linear infinite;
  126. }
  127. @keyframes textShimmer {
  128. 0% {
  129. background-position: 0% center;
  130. }
  131. 100% {
  132. background-position: 200% center;
  133. }
  134. }
  135. /* AI 图标内部的星星动画 */
  136. @keyframes starPulse {
  137. 0%,
  138. 100% {
  139. transform: scale(1) rotate(0deg);
  140. opacity: 0.9;
  141. }
  142. 50% {
  143. transform: scale(1.15) rotate(15deg);
  144. opacity: 1;
  145. }
  146. }
  147. @keyframes starOrbit {
  148. 0% {
  149. transform: rotate(0deg) translateX(5px) rotate(0deg);
  150. }
  151. 100% {
  152. transform: rotate(360deg) translateX(5px) rotate(-360deg);
  153. }
  154. }
  155. /* 光晕扫描 */
  156. .scan-line {
  157. position: absolute;
  158. top: 0;
  159. left: -100%;
  160. width: 60%;
  161. height: 100%;
  162. background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  163. animation: scanAnim 2s ease-in-out infinite;
  164. border-radius: 50%;
  165. }
  166. @keyframes scanAnim {
  167. 0% {
  168. left: -60%;
  169. }
  170. 100% {
  171. left: 160%;
  172. }
  173. }
  174. .AISpan {
  175. display: flex;
  176. align-items: center;
  177. color: #1989fa;
  178. margin-right: 5px;
  179. font-size: 12px;
  180. }
  181. .AISpan::before {
  182. content: '';
  183. display: inline-block;
  184. width: 6px;
  185. height: 6px;
  186. border-radius: 50%;
  187. background: #2979ff;
  188. animation: blink 1.2s ease-in-out infinite;
  189. margin-right: 5px;
  190. }
  191. @keyframes blink {
  192. 0%,
  193. 100% {
  194. opacity: 0.3;
  195. }
  196. 50% {
  197. opacity: 1;
  198. }
  199. }
  200. </style>