Spaces:
Running

axeronis commited on
Commit
6439d6b
·
1 Parent(s): 4b0f951

feat(ui): global infinity UI, landing redirect, brain icon, and premium dark glass effects

Browse files
frontend/app/dashboard/page.tsx CHANGED
@@ -147,7 +147,7 @@ export default function DashboardPage() {
147
  // Only show loading for data fetch, not auth (cached user is instant)
148
  if (!user || (loading && !data)) {
149
  return (
150
- <div className="flex items-center justify-center min-h-screen bg-background">
151
  <div className="flex flex-col items-center gap-4">
152
  <div className="w-8 h-8 rounded-full border-2 border-indigo-500 border-t-transparent animate-spin"></div>
153
  <p className="text-indigo-400 font-mono text-xs animate-pulse">{t('dashboard.loading')}</p>
@@ -158,8 +158,8 @@ export default function DashboardPage() {
158
 
159
  if (error) {
160
  return (
161
- <div className="flex items-center justify-center min-h-screen bg-background">
162
- <div className="bg-surface p-8 rounded-xl border border-red-500/30 max-w-md text-center">
163
  <AlertCircle className="w-8 h-8 text-red-500 mx-auto mb-4" />
164
  <h2 className="text-lg font-bold text-white mb-2 font-mono">ОШИБКА СИСТЕМЫ</h2>
165
  <p className="text-slate-400 mb-6 text-sm">{error instanceof Error ? error.message : 'Ошибка загрузки данных'}</p>
@@ -178,7 +178,7 @@ export default function DashboardPage() {
178
  if (!data) return null
179
 
180
  return (
181
- <div className="min-h-full p-4 sm:p-6 lg:p-8 font-['Inter']">
182
  <div className="max-w-7xl mx-auto space-y-4 sm:space-y-6">
183
 
184
  {/* Header */}
@@ -209,7 +209,7 @@ export default function DashboardPage() {
209
  initial={{ opacity: 0, y: 5 }}
210
  animate={{ opacity: 1, y: 0 }}
211
  exit={{ opacity: 0, y: 5 }}
212
- className="absolute top-full right-0 mt-2 w-[180px] bg-surface rounded-lg border border-white/10 z-50 overflow-hidden"
213
  >
214
  {[
215
  { val: '7d', label: '7 дней' },
@@ -251,7 +251,7 @@ export default function DashboardPage() {
251
  {/* Key Metrics Grid */}
252
  <div className="grid grid-cols-2 md:grid-cols-2 lg:grid-cols-4 gap-3 sm:gap-6">
253
  {/* Total Leads */}
254
- <div className="group relative bg-surface-elevated rounded-xl sm:rounded-2xl border border-white/10 p-4 sm:p-6 transition-all hover:border-indigo-500/30 hover:shadow-[0_0_30px_-5px_rgba(99,102,241,0.15)]">
255
  <div className="absolute inset-0 bg-gradient-to-br from-indigo-500/0 via-purple-500/0 to-pink-500/0 group-hover:from-indigo-500/5 group-hover:via-purple-500/5 group-hover:to-pink-500/5 rounded-xl sm:rounded-2xl transition-all duration-500" />
256
  <div className="relative">
257
  <div className="h-10 w-10 sm:h-12 sm:w-12 rounded-lg sm:rounded-xl bg-purple-500/10 border border-purple-500/20 flex items-center justify-center mb-3 sm:mb-4 group-hover:scale-110 transition-transform duration-300">
@@ -263,7 +263,7 @@ export default function DashboardPage() {
263
  </div>
264
 
265
  {/* Average Response Time */}
266
- <div className="group relative bg-surface-elevated rounded-xl sm:rounded-2xl border border-white/10 p-4 sm:p-6 transition-all hover:border-indigo-500/30 hover:shadow-[0_0_30px_-5px_rgba(99,102,241,0.15)]">
267
  <div className="absolute inset-0 bg-gradient-to-br from-indigo-500/0 via-purple-500/0 to-pink-500/0 group-hover:from-indigo-500/5 group-hover:via-purple-500/5 group-hover:to-pink-500/5 rounded-xl sm:rounded-2xl transition-all duration-500" />
268
  <div className="relative">
269
  <div className="h-10 w-10 sm:h-12 sm:w-12 rounded-lg sm:rounded-xl bg-indigo-500/10 border border-indigo-500/20 flex items-center justify-center mb-3 sm:mb-4 group-hover:scale-110 transition-transform duration-300">
@@ -275,7 +275,7 @@ export default function DashboardPage() {
275
  </div>
276
 
277
  {/* Conversion */}
278
- <div className="group relative bg-surface-elevated rounded-xl sm:rounded-2xl border border-white/10 p-4 sm:p-6 transition-all hover:border-indigo-500/30 hover:shadow-[0_0_30px_-5px_rgba(99,102,241,0.15)]">
279
  <div className="absolute inset-0 bg-gradient-to-br from-indigo-500/0 via-purple-500/0 to-pink-500/0 group-hover:from-indigo-500/5 group-hover:via-purple-500/5 group-hover:to-pink-500/5 rounded-xl sm:rounded-2xl transition-all duration-500" />
280
  <div className="relative">
281
  <div className="h-10 w-10 sm:h-12 sm:w-12 rounded-lg sm:rounded-xl bg-pink-500/10 border border-pink-500/20 flex items-center justify-center mb-3 sm:mb-4 group-hover:scale-110 transition-transform duration-300">
@@ -287,7 +287,7 @@ export default function DashboardPage() {
287
  </div>
288
 
289
  {/* Pipeline Value */}
290
- <div className="group relative bg-surface-elevated rounded-xl sm:rounded-2xl border border-white/10 p-4 sm:p-6 transition-all hover:border-indigo-500/30 hover:shadow-[0_0_30px_-5px_rgba(99,102,241,0.15)]">
291
  <div className="absolute inset-0 bg-gradient-to-br from-indigo-500/0 via-purple-500/0 to-pink-500/0 group-hover:from-indigo-500/5 group-hover:via-purple-500/5 group-hover:to-pink-500/5 rounded-xl sm:rounded-2xl transition-all duration-500" />
292
  <div className="relative">
293
  <div className="h-10 w-10 sm:h-12 sm:w-12 rounded-lg sm:rounded-xl bg-emerald-500/10 border border-emerald-500/20 flex items-center justify-center mb-3 sm:mb-4 group-hover:scale-110 transition-transform duration-300">
@@ -304,7 +304,7 @@ export default function DashboardPage() {
304
  <div className="grid grid-cols-1 lg:grid-cols-3 gap-6">
305
 
306
  {/* Leads by Channel (Donut Chart) */}
307
- <div className="bg-surface-elevated rounded-2xl border border-white/10 p-6 relative overflow-hidden flex flex-col">
308
  <h3 className="text-sm font-bold text-slate-400 uppercase tracking-wider mb-6">ИСТОЧНИКИ ЛИДОВ</h3>
309
  <div className="h-[250px] w-full relative z-10 flex items-center justify-center">
310
  {data.channel_stats && data.channel_stats.length > 0 ? (
@@ -324,7 +324,7 @@ export default function DashboardPage() {
324
  ))}
325
  </Pie>
326
  <Tooltip
327
- contentStyle={{ backgroundColor: '#0F111A', border: '1px solid rgba(255,255,255,0.1)', borderRadius: '12px' }}
328
  itemStyle={{ color: '#fff' }}
329
  />
330
  <Legend
@@ -342,7 +342,7 @@ export default function DashboardPage() {
342
  </div>
343
 
344
  {/* Funnel Drop-off (Bar Chart) */}
345
- <div className="lg:col-span-2 bg-surface-elevated rounded-2xl border border-white/10 p-6 relative overflow-hidden">
346
  <h3 className="text-sm font-bold text-slate-400 uppercase tracking-wider mb-6">ВОРОНКА ПРОДАЖ (ОТТОК КЛИЕНТОВ)</h3>
347
  <div className="h-[250px] w-full relative z-10">
348
  <ResponsiveContainer width="100%" height="100%">
@@ -371,7 +371,7 @@ export default function DashboardPage() {
371
  </div>
372
 
373
  {/* Row 2.5: High Intent Leads - Reference Design */}
374
- <div className="bg-surface-elevated rounded-2xl border border-white/10 p-6 relative overflow-hidden">
375
  <div className="flex items-center justify-between mb-6">
376
  <h3 className="text-sm font-bold text-slate-400 uppercase tracking-wider flex items-center gap-2">
377
  <Flame className="w-4 h-4 text-orange-400" />
@@ -435,7 +435,7 @@ export default function DashboardPage() {
435
  <div className="grid grid-cols-1 lg:grid-cols-3 gap-6">
436
 
437
  {/* Frequent Objections (List) */}
438
- <div className="bg-surface-elevated rounded-2xl border border-white/10 p-6 relative overflow-hidden">
439
  <h3 className="text-sm font-bold text-slate-400 uppercase tracking-wider mb-6 flex items-center gap-2">
440
  <AlertCircle className="w-4 h-4 text-red-400" />
441
  ЧАСТЫЕ ВОЗРАЖЕНИЯ
@@ -468,7 +468,7 @@ export default function DashboardPage() {
468
  </div>
469
 
470
  {/* Pipeline Dynamics (Area Chart) reused */}
471
- <div className="lg:col-span-2 bg-surface-elevated rounded-2xl border border-white/10 p-6 relative overflow-hidden">
472
  <h3 className="text-sm font-bold text-slate-400 uppercase tracking-wider mb-6">ДИНАМИКА ЦЕННОСТИ ЛИДОВ (30 ДНЕЙ)</h3>
473
  <div className="h-[300px] w-full relative z-10">
474
  <ResponsiveContainer width="100%" height="100%">
 
147
  // Only show loading for data fetch, not auth (cached user is instant)
148
  if (!user || (loading && !data)) {
149
  return (
150
+ <div className="flex items-center justify-center min-h-screen bg-transparent">
151
  <div className="flex flex-col items-center gap-4">
152
  <div className="w-8 h-8 rounded-full border-2 border-indigo-500 border-t-transparent animate-spin"></div>
153
  <p className="text-indigo-400 font-mono text-xs animate-pulse">{t('dashboard.loading')}</p>
 
158
 
159
  if (error) {
160
  return (
161
+ <div className="flex items-center justify-center min-h-screen bg-transparent">
162
+ <div className="bg-[#050510]/60 backdrop-blur-xl p-8 rounded-xl border border-red-500/30 max-w-md text-center">
163
  <AlertCircle className="w-8 h-8 text-red-500 mx-auto mb-4" />
164
  <h2 className="text-lg font-bold text-white mb-2 font-mono">ОШИБКА СИСТЕМЫ</h2>
165
  <p className="text-slate-400 mb-6 text-sm">{error instanceof Error ? error.message : 'Ошибка загрузки данных'}</p>
 
178
  if (!data) return null
179
 
180
  return (
181
+ <div className="min-h-full p-4 sm:p-6 lg:p-8 font-['Inter'] bg-transparent">
182
  <div className="max-w-7xl mx-auto space-y-4 sm:space-y-6">
183
 
184
  {/* Header */}
 
209
  initial={{ opacity: 0, y: 5 }}
210
  animate={{ opacity: 1, y: 0 }}
211
  exit={{ opacity: 0, y: 5 }}
212
+ className="absolute top-full right-0 mt-2 w-[180px] bg-[#050510]/90 backdrop-blur-2xl rounded-lg border border-white/10 z-50 overflow-hidden"
213
  >
214
  {[
215
  { val: '7d', label: '7 дней' },
 
251
  {/* Key Metrics Grid */}
252
  <div className="grid grid-cols-2 md:grid-cols-2 lg:grid-cols-4 gap-3 sm:gap-6">
253
  {/* Total Leads */}
254
+ <div className="bg-[#050510]/40 backdrop-blur-md rounded-2xl border border-white/10 p-6 relative overflow-hidden">
255
  <div className="absolute inset-0 bg-gradient-to-br from-indigo-500/0 via-purple-500/0 to-pink-500/0 group-hover:from-indigo-500/5 group-hover:via-purple-500/5 group-hover:to-pink-500/5 rounded-xl sm:rounded-2xl transition-all duration-500" />
256
  <div className="relative">
257
  <div className="h-10 w-10 sm:h-12 sm:w-12 rounded-lg sm:rounded-xl bg-purple-500/10 border border-purple-500/20 flex items-center justify-center mb-3 sm:mb-4 group-hover:scale-110 transition-transform duration-300">
 
263
  </div>
264
 
265
  {/* Average Response Time */}
266
+ <div className="bg-[#050510]/40 backdrop-blur-md rounded-2xl border border-white/10 p-6 relative overflow-hidden">
267
  <div className="absolute inset-0 bg-gradient-to-br from-indigo-500/0 via-purple-500/0 to-pink-500/0 group-hover:from-indigo-500/5 group-hover:via-purple-500/5 group-hover:to-pink-500/5 rounded-xl sm:rounded-2xl transition-all duration-500" />
268
  <div className="relative">
269
  <div className="h-10 w-10 sm:h-12 sm:w-12 rounded-lg sm:rounded-xl bg-indigo-500/10 border border-indigo-500/20 flex items-center justify-center mb-3 sm:mb-4 group-hover:scale-110 transition-transform duration-300">
 
275
  </div>
276
 
277
  {/* Conversion */}
278
+ <div className="bg-[#050510]/40 backdrop-blur-md rounded-2xl border border-white/10 p-6 relative overflow-hidden">
279
  <div className="absolute inset-0 bg-gradient-to-br from-indigo-500/0 via-purple-500/0 to-pink-500/0 group-hover:from-indigo-500/5 group-hover:via-purple-500/5 group-hover:to-pink-500/5 rounded-xl sm:rounded-2xl transition-all duration-500" />
280
  <div className="relative">
281
  <div className="h-10 w-10 sm:h-12 sm:w-12 rounded-lg sm:rounded-xl bg-pink-500/10 border border-pink-500/20 flex items-center justify-center mb-3 sm:mb-4 group-hover:scale-110 transition-transform duration-300">
 
287
  </div>
288
 
289
  {/* Pipeline Value */}
290
+ <div className="bg-[#050510]/40 backdrop-blur-md rounded-2xl border border-white/10 p-6 relative overflow-hidden">
291
  <div className="absolute inset-0 bg-gradient-to-br from-indigo-500/0 via-purple-500/0 to-pink-500/0 group-hover:from-indigo-500/5 group-hover:via-purple-500/5 group-hover:to-pink-500/5 rounded-xl sm:rounded-2xl transition-all duration-500" />
292
  <div className="relative">
293
  <div className="h-10 w-10 sm:h-12 sm:w-12 rounded-lg sm:rounded-xl bg-emerald-500/10 border border-emerald-500/20 flex items-center justify-center mb-3 sm:mb-4 group-hover:scale-110 transition-transform duration-300">
 
304
  <div className="grid grid-cols-1 lg:grid-cols-3 gap-6">
305
 
306
  {/* Leads by Channel (Donut Chart) */}
307
+ <div className="bg-[#050510]/40 backdrop-blur-md rounded-2xl border border-white/10 p-6 relative overflow-hidden flex flex-col">
308
  <h3 className="text-sm font-bold text-slate-400 uppercase tracking-wider mb-6">ИСТОЧНИКИ ЛИДОВ</h3>
309
  <div className="h-[250px] w-full relative z-10 flex items-center justify-center">
310
  {data.channel_stats && data.channel_stats.length > 0 ? (
 
324
  ))}
325
  </Pie>
326
  <Tooltip
327
+ contentStyle={{ backgroundColor: 'rgba(5, 5, 16, 0.8)', backdropFilter: 'blur(12px)', border: '1px solid rgba(255,255,255,0.1)', borderRadius: '12px' }}
328
  itemStyle={{ color: '#fff' }}
329
  />
330
  <Legend
 
342
  </div>
343
 
344
  {/* Funnel Drop-off (Bar Chart) */}
345
+ <div className="lg:col-span-2 bg-[#050510]/40 backdrop-blur-md rounded-2xl border border-white/10 p-6 relative overflow-hidden">
346
  <h3 className="text-sm font-bold text-slate-400 uppercase tracking-wider mb-6">ВОРОНКА ПРОДАЖ (ОТТОК КЛИЕНТОВ)</h3>
347
  <div className="h-[250px] w-full relative z-10">
348
  <ResponsiveContainer width="100%" height="100%">
 
371
  </div>
372
 
373
  {/* Row 2.5: High Intent Leads - Reference Design */}
374
+ <div className="bg-[#050510]/40 backdrop-blur-md rounded-2xl border border-white/10 p-6 relative overflow-hidden">
375
  <div className="flex items-center justify-between mb-6">
376
  <h3 className="text-sm font-bold text-slate-400 uppercase tracking-wider flex items-center gap-2">
377
  <Flame className="w-4 h-4 text-orange-400" />
 
435
  <div className="grid grid-cols-1 lg:grid-cols-3 gap-6">
436
 
437
  {/* Frequent Objections (List) */}
438
+ <div className="bg-[#050510]/40 backdrop-blur-md rounded-2xl border border-white/10 p-6 relative overflow-hidden">
439
  <h3 className="text-sm font-bold text-slate-400 uppercase tracking-wider mb-6 flex items-center gap-2">
440
  <AlertCircle className="w-4 h-4 text-red-400" />
441
  ЧАСТЫЕ ВОЗРАЖЕНИЯ
 
468
  </div>
469
 
470
  {/* Pipeline Dynamics (Area Chart) reused */}
471
+ <div className="lg:col-span-2 bg-[#050510]/40 backdrop-blur-md rounded-2xl border border-white/10 p-6 relative overflow-hidden">
472
  <h3 className="text-sm font-bold text-slate-400 uppercase tracking-wider mb-6">ДИНАМИКА ЦЕННОСТИ ЛИДОВ (30 ДНЕЙ)</h3>
473
  <div className="h-[300px] w-full relative z-10">
474
  <ResponsiveContainer width="100%" height="100%">
frontend/app/page.tsx CHANGED
@@ -10,6 +10,7 @@ import {
10
  } from 'lucide-react'
11
  import { motion, AnimatePresence } from 'framer-motion'
12
  import { useState, useRef, useEffect } from 'react'
 
13
 
14
  // --- DATA ---
15
 
@@ -347,7 +348,7 @@ export default function HomePage() {
347
  </div>
348
 
349
  {/* 1. NAVBAR - Minimalist Glass */}
350
- <nav className="fixed top-[-1px] left-0 right-0 z-50 bg-gradient-to-b from-[#0B0C15] via-[#0B0C15]/80 to-transparent pt-[calc(env(safe-area-inset-top,0px)+1px)] transition-all duration-300">
351
  {/* Background Glow Sync */}
352
  <div className="absolute inset-0 overflow-hidden pointer-events-none -z-10">
353
  <div className="absolute top-0 left-1/4 w-1/2 h-full bg-indigo-500/5 blur-[100px] rounded-full" />
 
10
  } from 'lucide-react'
11
  import { motion, AnimatePresence } from 'framer-motion'
12
  import { useState, useRef, useEffect } from 'react'
13
+ import { redirect } from 'next/navigation'
14
 
15
  // --- DATA ---
16
 
 
348
  </div>
349
 
350
  {/* 1. NAVBAR - Minimalist Glass */}
351
+ <nav className="fixed top-[-1px] left-0 right-0 z-50 bg-[#050510]/80 backdrop-blur-xl border-b border-white/5 pt-[calc(env(safe-area-inset-top,0px)+1px)] transition-all duration-300">
352
  {/* Background Glow Sync */}
353
  <div className="absolute inset-0 overflow-hidden pointer-events-none -z-10">
354
  <div className="absolute top-0 left-1/4 w-1/2 h-full bg-indigo-500/5 blur-[100px] rounded-full" />
frontend/components/MobileBottomNav.tsx CHANGED
@@ -53,7 +53,7 @@ export function MobileBottomNav() {
53
  animate={{ y: 0 }}
54
  exit={{ y: '100%' }}
55
  transition={{ type: 'spring', damping: 20, stiffness: 200 }}
56
- className="fixed bottom-0 left-0 right-0 z-40 bg-gradient-to-t from-[#0B0C15] via-[#0B0C15]/80 to-transparent pb-[env(safe-area-inset-bottom,0px)] md:hidden"
57
  >
58
  <div className="flex items-center justify-around h-[50px] px-2 relative">
59
  {/* Главная */}
@@ -66,7 +66,7 @@ export function MobileBottomNav() {
66
  : "text-slate-500 hover:text-slate-300"
67
  )}
68
  >
69
- <LayoutDashboard className="w-[22px] h-[22px]" />
70
  </Link>
71
 
72
  {/* Чаты */}
 
53
  animate={{ y: 0 }}
54
  exit={{ y: '100%' }}
55
  transition={{ type: 'spring', damping: 20, stiffness: 200 }}
56
+ className="fixed bottom-0 left-0 right-0 z-40 bg-[#050510]/80 backdrop-blur-xl border-t border-white/5 pb-[env(safe-area-inset-bottom,0px)] md:hidden"
57
  >
58
  <div className="flex items-center justify-around h-[50px] px-2 relative">
59
  {/* Главная */}
 
66
  : "text-slate-500 hover:text-slate-300"
67
  )}
68
  >
69
+ <Brain className="w-[22px] h-[22px]" />
70
  </Link>
71
 
72
  {/* Чаты */}
frontend/components/MobileNav.tsx CHANGED
@@ -57,7 +57,7 @@ export function MobileHeader({ onOpen }: { onOpen?: () => void }) {
57
  const isUnlimited = limitDialogs === null || limitDialogs === undefined
58
 
59
  return (
60
- <div className="flex flex-col fixed top-[-1px] left-0 right-0 z-[60] bg-gradient-to-b from-[#0B0C15] via-[#0B0C15]/80 to-transparent pt-[calc(env(safe-area-inset-top,0px)+1px)] md:hidden">
61
  <div className="flex items-center justify-between px-3 h-[52px] text-white w-full relative">
62
  {/* Left: Logo + Brand Name */}
63
  <Link href="/settings/brain" className="flex items-center gap-2.5 active:scale-95 transition-transform">
@@ -184,9 +184,9 @@ export function MobileSidebarWrapper({ children }: { children: React.ReactNode }
184
  animate={{ x: 0 }}
185
  exit={{ x: '-100%' }}
186
  transition={{ type: 'spring', damping: 25, stiffness: 200 }}
187
- className="fixed left-0 top-16 bottom-0 w-72 backdrop-blur-3xl z-50 shadow-2xl overflow-hidden border-r border-white/10"
188
  style={{
189
- background: 'rgba(13, 14, 24, 0.9)',
190
  }}
191
  >
192
  {/* Aurora Effect Background */}
 
57
  const isUnlimited = limitDialogs === null || limitDialogs === undefined
58
 
59
  return (
60
+ <div className="flex flex-col fixed top-[-1px] left-0 right-0 z-[60] bg-[#050510]/80 backdrop-blur-xl border-b border-white/5 pt-[calc(env(safe-area-inset-top,0px)+1px)] md:hidden">
61
  <div className="flex items-center justify-between px-3 h-[52px] text-white w-full relative">
62
  {/* Left: Logo + Brand Name */}
63
  <Link href="/settings/brain" className="flex items-center gap-2.5 active:scale-95 transition-transform">
 
184
  animate={{ x: 0 }}
185
  exit={{ x: '-100%' }}
186
  transition={{ type: 'spring', damping: 25, stiffness: 200 }}
187
+ className="fixed left-0 top-0 bottom-0 w-72 backdrop-blur-3xl z-50 shadow-2xl overflow-hidden border-r border-white/10"
188
  style={{
189
+ background: 'rgba(5, 5, 16, 0.85)',
190
  }}
191
  >
192
  {/* Aurora Effect Background */}
frontend/components/Sidebar.tsx CHANGED
@@ -146,7 +146,7 @@ export function Sidebar() {
146
  initial="hidden"
147
  animate="visible"
148
  variants={sidebarVariants}
149
- className="w-72 flex flex-col relative shrink-0 h-screen sticky top-0 pb-14 lg:pb-0 border-r border-white/5 z-20 bg-[#0a0a12]/90 backdrop-blur-xl backdrop-saturate-[1.8]"
150
  >
151
  {/* Logo Section - Hidden on mobile, already in MobileHeader */}
152
  <div className="p-6 relative z-50 hidden lg:block">
 
146
  initial="hidden"
147
  animate="visible"
148
  variants={sidebarVariants}
149
+ className="w-72 flex flex-col relative shrink-0 h-screen sticky top-0 pb-14 lg:pb-0 border-r border-white/5 z-20 bg-[#050510]/80 backdrop-blur-xl backdrop-saturate-[1.8]"
150
  >
151
  {/* Logo Section - Hidden on mobile, already in MobileHeader */}
152
  <div className="p-6 relative z-50 hidden lg:block">