Analytics.jsx 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. import { useLanguage } from '../context/LanguageContext';
  2. import Footer from '../components/Footer';
  3. function Analytics() {
  4. const { t } = useLanguage();
  5. const metrics = [
  6. {
  7. id: 1,
  8. title: 'Engagement Analytics',
  9. description: t('analytics.metrics.engagement.description'),
  10. icon: '📊',
  11. stats: {
  12. metrics: '15+',
  13. update: 'Real-time',
  14. export: 'CSV/PDF'
  15. }
  16. },
  17. {
  18. id: 2,
  19. title: 'Audience Insights',
  20. description: t('analytics.metrics.audience.description'),
  21. icon: '👥',
  22. stats: {
  23. segments: '8+',
  24. reach: 'Global',
  25. tracking: '24/7'
  26. }
  27. },
  28. {
  29. id: 3,
  30. title: 'Performance Tracking',
  31. description: t('analytics.metrics.performance.description'),
  32. icon: '📈',
  33. stats: {
  34. kpis: '20+',
  35. reports: 'Custom',
  36. history: '12 months'
  37. }
  38. }
  39. ];
  40. const dashboardSections = [
  41. {
  42. title: t('analytics.dashboard.growth'),
  43. percentage: '+127%',
  44. trend: 'up'
  45. },
  46. {
  47. title: t('analytics.dashboard.engagement'),
  48. percentage: '+85%',
  49. trend: 'up'
  50. },
  51. {
  52. title: t('analytics.dashboard.conversion'),
  53. percentage: '+45%',
  54. trend: 'up'
  55. }
  56. ];
  57. return (
  58. <div className="relative min-h-screen bg-white">
  59. {/* Floating elements */}
  60. <div className="absolute inset-0 overflow-hidden pointer-events-none">
  61. <div className="absolute top-40 left-20 w-32 h-32 bg-brand-purple/10 rounded-full blur-3xl animate-pulse"></div>
  62. <div className="absolute bottom-40 right-20 w-40 h-40 bg-brand-pink/10 rounded-full blur-3xl animate-pulse delay-1000"></div>
  63. </div>
  64. <div className="max-w-[1400px] mx-auto px-4 sm:px-6 lg:px-8 pt-32">
  65. {/* Header section */}
  66. <div className="text-center mb-16">
  67. <h1 className="text-[80px] leading-tight font-light tracking-tight text-gray-900 relative inline-block">
  68. {t('analytics.title')}
  69. <div className="absolute -top-1 -right-1 w-2 h-2 bg-brand-purple rounded-full"></div>
  70. </h1>
  71. <p className="text-xl text-gray-500 max-w-2xl mx-auto mt-6">
  72. {t('analytics.description')}
  73. </p>
  74. </div>
  75. {/* Dashboard Preview */}
  76. <div className="mb-16">
  77. <h2 className="text-2xl font-medium text-gray-900 mb-8 text-center">{t('analytics.dashboard.title')}</h2>
  78. <div className="grid grid-cols-1 md:grid-cols-3 gap-8">
  79. {dashboardSections.map((section) => (
  80. <div key={section.title} className="bg-white rounded-2xl shadow-lg p-6 relative group hover:shadow-xl transition-all duration-300 hover:-translate-y-1">
  81. <h3 className="text-xl font-medium text-gray-900 mb-4">{section.title}</h3>
  82. <div className="flex items-center gap-4">
  83. <span className="text-4xl font-light text-brand-purple">{section.percentage}</span>
  84. <div className={`w-8 h-8 text-brand-purple transform transition-transform ${section.trend === 'up' ? 'rotate-0' : 'rotate-180'}`}>
  85. </div>
  86. </div>
  87. <div className="mt-4 w-full h-2 bg-gray-100 rounded-full overflow-hidden">
  88. <div className="h-full bg-brand-purple rounded-full" style={{ width: section.percentage }}></div>
  89. </div>
  90. </div>
  91. ))}
  92. </div>
  93. </div>
  94. {/* Metrics and Actions */}
  95. <div className="grid grid-cols-1 lg:grid-cols-3 gap-8 mb-16">
  96. {/* Metrics Overview */}
  97. <div className="lg:col-span-2">
  98. <div className="space-y-8">
  99. {metrics.map((metric) => (
  100. <div key={metric.id} className="bg-white rounded-2xl shadow-lg p-6 relative group hover:shadow-xl transition-all duration-300 hover:-translate-y-1">
  101. <div className="absolute -right-2 -top-2 w-10 h-10 bg-brand-purple text-white rounded-full flex items-center justify-center transform rotate-12 group-hover:rotate-0 transition-transform">
  102. <span className="text-xl">{metric.icon}</span>
  103. </div>
  104. <h3 className="text-xl font-medium text-gray-900 mb-4">{metric.title}</h3>
  105. <p className="text-gray-600 mb-6">{metric.description}</p>
  106. <div className="h-px bg-gray-100 mb-6"></div>
  107. <div className="grid grid-cols-3 gap-4">
  108. {Object.entries(metric.stats).map(([key, value]) => (
  109. <div key={key}>
  110. <span className="text-sm text-gray-500 block capitalize">{key}</span>
  111. <span className="font-medium text-brand-purple">{value}</span>
  112. </div>
  113. ))}
  114. </div>
  115. </div>
  116. ))}
  117. </div>
  118. </div>
  119. {/* Quick Actions */}
  120. <div className="lg:col-span-1">
  121. <div className="bg-white rounded-2xl shadow-lg p-8">
  122. <h3 className="text-xl font-medium text-gray-900 mb-6">{t('analytics.actions.title')}</h3>
  123. <div className="space-y-3">
  124. {[
  125. 'Generate Report',
  126. 'Export Data',
  127. 'Set Alerts',
  128. 'Share Dashboard',
  129. 'Configure KPIs'
  130. ].map((action) => (
  131. <div
  132. key={action}
  133. className="p-4 rounded-xl hover:bg-gray-50 transition-colors duration-300 cursor-pointer group"
  134. >
  135. <span className="text-gray-600 group-hover:text-brand-purple transition-colors">{action}</span>
  136. </div>
  137. ))}
  138. </div>
  139. </div>
  140. </div>
  141. </div>
  142. </div>
  143. <Footer />
  144. </div>
  145. );
  146. }
  147. export default Analytics;