SectionStats.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. <template>
  2. <section class="section-stats relative overflow-hidden py-20 lg:py-28" ref="sectionRef">
  3. <!-- 深色渐变背景 -->
  4. <div class="absolute inset-0" style="background: linear-gradient(135deg, #0f0c29 0%, #1a1040 40%, #0d1b3e 70%, #0a0a1a 100%);"></div>
  5. <!-- 网格纹理 -->
  6. <div class="absolute inset-0 pointer-events-none" style="background-image: linear-gradient(rgba(139,92,246,0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(139,92,246,0.04) 1px, transparent 1px); background-size: 48px 48px;"></div>
  7. <!-- 动态光晕 -->
  8. <div class="absolute inset-0 pointer-events-none overflow-hidden">
  9. <div class="stats-orb stats-orb-1"></div>
  10. <div class="stats-orb stats-orb-2"></div>
  11. <div class="stats-orb stats-orb-3"></div>
  12. </div>
  13. <!-- 顶部彩虹线 -->
  14. <div class="absolute top-0 left-0 right-0 h-px" style="background: linear-gradient(90deg, transparent 0%, #8b5cf6 20%, #3b82f6 50%, #06b6d4 80%, transparent 100%);"></div>
  15. <div class="relative z-10 max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
  16. <!-- 标题 -->
  17. <div class="text-center mb-12 lg:mb-20 reveal-up" :class="{ 'is-visible': isVisible }">
  18. <span class="inline-flex items-center gap-2 border text-xs font-bold px-4 py-1.5 rounded-full mb-5 tracking-widest uppercase"
  19. style="background: rgba(139,92,246,0.15); border-color: rgba(139,92,246,0.4); color: #a78bfa;">
  20. <span class="w-1.5 h-1.5 rounded-full animate-pulse" style="background: #a78bfa;"></span>
  21. {{ $t('stats.badge') }}
  22. </span>
  23. <h2 class="stats-heading text-white mb-4 leading-tight">
  24. {{ $t('stats.title') }}<span class="stats-gradient-text">{{ $t('stats.subtitle') }}</span>
  25. </h2>
  26. <p class="text-base lg:text-lg max-w-2xl mx-auto" style="color: rgba(255,255,255,0.5);">{{ $t('stats.description') }}</p>
  27. </div>
  28. <!-- 四大数据卡片 -->
  29. <div class="grid grid-cols-2 lg:grid-cols-4 gap-3 sm:gap-4 lg:gap-5 mb-6 lg:mb-10">
  30. <div
  31. v-for="(stat, idx) in stats"
  32. :key="stat.label"
  33. class="stat-card reveal-up"
  34. :class="{ 'is-visible': isVisible }"
  35. :style="{ transitionDelay: `${0.1 + idx * 0.1}s` }"
  36. @mouseenter="hoveredStat = idx"
  37. @mouseleave="hoveredStat = null"
  38. >
  39. <div class="stat-card-top-line" :style="{ background: stat.lineGradient }"></div>
  40. <div class="stat-card-glow" :style="{ background: stat.glowColor, opacity: hoveredStat === idx ? 1 : 0 }"></div>
  41. <div class="stat-growth-badge">{{ stat.growth }}</div>
  42. <div class="stat-icon" :class="{ 'stat-icon-hover': hoveredStat === idx }">{{ stat.icon }}</div>
  43. <div class="stat-number" :style="{ color: stat.numColor }">{{ isVisible ? stat.displayNum : '0' }}</div>
  44. <div class="stat-label">{{ stat.label }}</div>
  45. <div class="stat-sub hidden sm:block">{{ stat.sub }}</div>
  46. <div class="stat-progress-track">
  47. <div class="stat-progress-fill"
  48. :style="{ width: isVisible ? stat.progress : '0%', background: stat.lineGradient, transitionDelay: `${0.5 + idx * 0.1}s` }">
  49. </div>
  50. </div>
  51. </div>
  52. </div>
  53. <!-- 底部:系统状态 + 执行路径 -->
  54. <div class="grid grid-cols-1 lg:grid-cols-2 gap-4 lg:gap-5 reveal-up" :class="{ 'is-visible': isVisible }" style="transition-delay: 0.5s;">
  55. <!-- 系统状态面板 -->
  56. <div class="glass-panel">
  57. <div class="flex items-center justify-between mb-5">
  58. <h3 class="font-bold text-white text-sm sm:text-base">{{ $t('stats.systemStatus.title') }}</h3>
  59. <span class="flex items-center gap-1.5 text-xs font-medium px-3 py-1 rounded-full"
  60. style="background: rgba(16,185,129,0.15); color: #34d399; border: 1px solid rgba(16,185,129,0.3);">
  61. <span class="w-1.5 h-1.5 bg-emerald-400 rounded-full animate-pulse"></span>
  62. {{ $t('stats.systemStatus.normal') }}
  63. </span>
  64. </div>
  65. <div class="space-y-4">
  66. <div v-for="metric in systemMetrics" :key="metric.label">
  67. <div class="flex items-center gap-2 mb-1.5">
  68. <span class="text-sm">{{ metric.icon }}</span>
  69. <span class="text-xs sm:text-sm flex-1" style="color: rgba(255,255,255,0.6);">{{ metric.label }}</span>
  70. <span class="text-xs sm:text-sm font-bold" :style="{ color: metric.numColor }">{{ metric.value }}</span>
  71. </div>
  72. <div class="h-1.5 rounded-full overflow-hidden" style="background: rgba(255,255,255,0.08);">
  73. <div class="h-full rounded-full transition-all duration-1500 ease-out"
  74. :style="{ width: isVisible ? metric.width : '0%', background: metric.barGradient }"></div>
  75. </div>
  76. </div>
  77. </div>
  78. </div>
  79. <!-- 工作流执行路径 -->
  80. <div class="glass-panel">
  81. <div class="flex items-center justify-between mb-5">
  82. <h3 class="font-bold text-white text-sm sm:text-base">{{ $t('stats.flowPath.title') }}</h3>
  83. <span class="text-xs font-medium px-3 py-1 rounded-full"
  84. style="background: rgba(59,130,246,0.15); color: #60a5fa; border: 1px solid rgba(59,130,246,0.3);">{{ $t('stats.flowPath.running') }}</span>
  85. </div>
  86. <div class="flow-steps-row">
  87. <div v-for="(step, idx) in flowSteps" :key="step.label" class="flex items-center gap-1 sm:gap-2">
  88. <div class="flex flex-col items-center">
  89. <div class="flow-step-node hover:scale-110 transition-transform duration-300"
  90. :style="{ background: step.bg, borderColor: step.border }">
  91. {{ step.icon }}
  92. </div>
  93. <span class="text-xs mt-1 font-medium text-center" style="color: rgba(255,255,255,0.5);">{{ step.label }}</span>
  94. <span class="text-xs font-bold" :style="{ color: step.timeColor }">{{ step.time }}</span>
  95. </div>
  96. <svg v-if="idx < flowSteps.length - 1" class="flow-arrow flex-shrink-0 mb-5" fill="none" stroke="rgba(255,255,255,0.2)" viewBox="0 0 24 24">
  97. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"/>
  98. </svg>
  99. </div>
  100. </div>
  101. <div class="mt-4 flex items-center justify-between p-3 rounded-2xl"
  102. style="background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.2);">
  103. <span class="text-xs sm:text-sm" style="color: rgba(255,255,255,0.6);">{{ $t('stats.flowPath.totalTime') }}</span>
  104. <span class="text-xs sm:text-sm font-black text-emerald-400">1.25s ✓ {{ $t('stats.flowPath.completed') }}</span>
  105. </div>
  106. </div>
  107. </div>
  108. </div>
  109. </section>
  110. </template>
  111. <script setup>
  112. import { ref, onMounted } from 'vue'
  113. import { useI18n } from 'vue-i18n'
  114. const { t } = useI18n()
  115. const isVisible = ref(false)
  116. const sectionRef = ref(null)
  117. const hoveredStat = ref(null)
  118. onMounted(() => {
  119. const observer = new IntersectionObserver(
  120. (entries) => { entries.forEach(e => { if (e.isIntersecting) { isVisible.value = true; observer.unobserve(e.target) } }) },
  121. { threshold: 0.1 }
  122. )
  123. if (sectionRef.value) observer.observe(sectionRef.value)
  124. })
  125. const stats = [
  126. { icon: '🌍', label: t('stats.cards.globalUsers.label'), sub: t('stats.cards.globalUsers.sub'), displayNum: '50,000+', growth: '↑ 23%', numColor: '#c084fc', lineGradient: 'linear-gradient(90deg, #8b5cf6, #a78bfa)', glowColor: 'radial-gradient(circle at 50% 0%, rgba(139,92,246,0.3) 0%, transparent 70%)', progress: '75%' },
  127. { icon: '⚡', label: t('stats.cards.workflowExecutions.label'), sub: t('stats.cards.workflowExecutions.sub'), displayNum: '1,200万+', growth: '↑ 41%', numColor: '#60a5fa', lineGradient: 'linear-gradient(90deg, #3b82f6, #60a5fa)', glowColor: 'radial-gradient(circle at 50% 0%, rgba(59,130,246,0.3) 0%, transparent 70%)', progress: '88%' },
  128. { icon: '⏱️', label: t('stats.cards.timeSaved.label'), sub: t('stats.cards.timeSaved.sub'), displayNum: '320万小时', growth: '↑ 58%', numColor: '#22d3ee', lineGradient: 'linear-gradient(90deg, #06b6d4, #22d3ee)', glowColor: 'radial-gradient(circle at 50% 0%, rgba(6,182,212,0.3) 0%, transparent 70%)', progress: '92%' },
  129. { icon: '📦', label: t('stats.cards.workflowTemplates.label'), sub: t('stats.cards.workflowTemplates.sub'), displayNum: '8,000+', growth: '↑ 35%', numColor: '#34d399', lineGradient: 'linear-gradient(90deg, #10b981, #34d399)', glowColor: 'radial-gradient(circle at 50% 0%, rgba(16,185,129,0.3) 0%, transparent 70%)', progress: '65%' }
  130. ]
  131. const systemMetrics = [
  132. { icon: '✅', label: t('stats.systemMetrics.uptime'), value: '99.9%', width: '99%', barGradient: 'linear-gradient(90deg, #10b981, #34d399)', numColor: '#34d399' },
  133. { icon: '📈', label:t('stats.systemMetrics.peakTraffic'), value: '60%', width: '60%', barGradient: 'linear-gradient(90deg, #3b82f6, #60a5fa)', numColor: '#60a5fa' },
  134. { icon: '⚡', label: t('stats.systemMetrics.avgResponseTime'), value: '180ms', width: '82%', barGradient: 'linear-gradient(90deg, #8b5cf6, #a78bfa)', numColor: '#a78bfa' },
  135. { icon: '🔄', label: t('stats.systemMetrics.todayExecutions'), value: '15,750次', width: '78%', barGradient: 'linear-gradient(90deg, #f59e0b, #fbbf24)', numColor: '#fbbf24' }
  136. ]
  137. const flowSteps = [
  138. { icon: '📥', label: t('stats.flowSteps.dataInput'), time: '0.1s', bg: 'rgba(139,92,246,0.15)', border: 'rgba(139,92,246,0.4)', timeColor: '#a78bfa' },
  139. { icon: '🔀', label: t('stats.flowSteps.condition'), time: '0.2s', bg: 'rgba(59,130,246,0.15)', border: 'rgba(59,130,246,0.4)', timeColor: '#60a5fa' },
  140. { icon: '🤖', label: t('stats.flowSteps.aiProcessing'), time: '0.8s', bg: 'rgba(99,102,241,0.15)', border: 'rgba(99,102,241,0.4)', timeColor: '#818cf8' },
  141. { icon: '📊', label: t('stats.flowSteps.dataAnalysis'), time: '0.1s', bg: 'rgba(6,182,212,0.15)', border: 'rgba(6,182,212,0.4)', timeColor: '#22d3ee' },
  142. { icon: '📤', label: t('stats.flowSteps.multiOutput'), time: '0.05s', bg: 'rgba(16,185,129,0.15)', border: 'rgba(16,185,129,0.4)', timeColor: '#34d399' }
  143. ]
  144. </script>
  145. <style scoped>
  146. .stats-orb { position: absolute; border-radius: 50%; filter: blur(80px); pointer-events: none; }
  147. .stats-orb-1 { width: 500px; height: 500px; top: -100px; left: -100px; background: radial-gradient(circle, rgba(139,92,246,0.2) 0%, transparent 70%); animation: orbFloat 12s ease-in-out infinite; }
  148. .stats-orb-2 { width: 400px; height: 400px; top: 50%; right: -80px; background: radial-gradient(circle, rgba(59,130,246,0.18) 0%, transparent 70%); animation: orbFloat 15s ease-in-out infinite reverse; }
  149. .stats-orb-3 { width: 350px; height: 350px; bottom: -80px; left: 40%; background: radial-gradient(circle, rgba(6,182,212,0.15) 0%, transparent 70%); animation: orbFloat 10s ease-in-out infinite; }
  150. @keyframes orbFloat { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(20px, -30px); } }
  151. /* 响应式标题 */
  152. .stats-heading {
  153. font-size: clamp(2rem, 5vw, 3.75rem);
  154. font-weight: 900;
  155. letter-spacing: -0.02em;
  156. }
  157. .stats-gradient-text {
  158. background: linear-gradient(135deg, #a78bfa 0%, #60a5fa 50%, #22d3ee 100%);
  159. -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  160. }
  161. /* 数据卡片 */
  162. .stat-card {
  163. position: relative;
  164. padding: 16px 14px 14px;
  165. border-radius: 18px;
  166. overflow: hidden;
  167. cursor: pointer;
  168. transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease;
  169. background: rgba(255, 255, 255, 0.04);
  170. border: 1px solid rgba(255, 255, 255, 0.08);
  171. backdrop-filter: blur(12px);
  172. }
  173. .stat-card:hover { transform: translateY(-8px) scale(1.02); box-shadow: 0 20px 60px rgba(0,0,0,0.4); border-color: rgba(255,255,255,0.15); }
  174. .stat-card-top-line { position: absolute; top: 0; left: 0; right: 0; height: 2px; border-radius: 18px 18px 0 0; }
  175. .stat-card-glow { position: absolute; top: 0; left: 0; right: 0; height: 100px; pointer-events: none; transition: opacity 0.4s ease; }
  176. .stat-growth-badge { position: absolute; top: 12px; right: 12px; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 20px; background: rgba(16,185,129,0.15); color: #34d399; border: 1px solid rgba(16,185,129,0.3); }
  177. .stat-icon { font-size: clamp(20px, 3vw, 28px); margin-bottom: 10px; display: inline-block; transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
  178. .stat-icon-hover { transform: scale(1.2) rotate(-5deg); }
  179. .stat-number { font-size: clamp(18px, 3vw, 28px); font-weight: 900; margin-bottom: 3px; line-height: 1.1; }
  180. .stat-label { color: rgba(255,255,255,0.85); font-weight: 700; font-size: clamp(11px, 1.5vw, 13px); margin-bottom: 2px; }
  181. .stat-sub { color: rgba(255,255,255,0.35); font-size: 11px; margin-bottom: 12px; }
  182. .stat-progress-track { height: 3px; background: rgba(255,255,255,0.08); border-radius: 99px; overflow: hidden; margin-top: 10px; }
  183. .stat-progress-fill { height: 100%; border-radius: 99px; transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1); }
  184. /* 玻璃面板 */
  185. .glass-panel { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); backdrop-filter: blur(16px); border-radius: 20px; padding: 20px; }
  186. /* 流程步骤行 */
  187. .flow-steps-row { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 4px; }
  188. .flow-step-node { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 16px; border: 1px solid; }
  189. .flow-arrow { width: 14px; height: 14px; margin-bottom: 20px; }
  190. /* 滚动动画 */
  191. .reveal-up { opacity: 0; transform: translateY(40px); transition: opacity 0.8s ease, transform 0.8s ease; }
  192. .reveal-up.is-visible { opacity: 1; transform: translateY(0); }
  193. .duration-1500 { transition-duration: 1500ms; }
  194. /* ---- 响应式 ---- */
  195. @media (max-width: 640px) {
  196. .stat-card { padding: 14px 12px 12px; }
  197. .flow-step-node { width: 34px; height: 34px; font-size: 14px; border-radius: 10px; }
  198. .flow-arrow { width: 10px; height: 10px; }
  199. .glass-panel { padding: 16px; }
  200. }
  201. @media (max-width: 480px) {
  202. .stat-number { font-size: 16px; }
  203. .stat-growth-badge { font-size: 9px; padding: 1px 6px; }
  204. .flow-steps-row { gap: 2px; }
  205. .flow-step-node { width: 30px; height: 30px; font-size: 12px; border-radius: 8px; }
  206. .flow-arrow { width: 8px; height: 8px; }
  207. }
  208. </style>