"use client" import { useState, useEffect, useRef } from "react" import { Card } from "@/components/ui/card" import { Button } from "@/components/ui/button" import { Input } from "@/components/ui/input" import { Label } from "@/components/ui/label" import { User, CheckCircle2, Lock, ChevronLeft, ChevronRight, Sparkles, Zap, Trophy, Star, Award, TrendingUp, Shield, Crown, Flame } from "lucide-react" import Link from "next/link" interface Particle { x: number y: number vx: number vy: number size: number opacity: number color: string } export default function ProfilePage() { const [currentBadgeSlide, setCurrentBadgeSlide] = useState(0) const [particles, setParticles] = useState([]) const [mousePos, setMousePos] = useState({ x: 0, y: 0 }) const canvasRef = useRef(null) // Mock user data const userData = { nickname: "pennytige", totalPoints: 1337, level: 5, questsCompleted: 7, totalQuests: 12, gameProgress: 58, rank: "Elite Hacker", joinDate: "15.08.2024" } const quests = [ { id: 1, name: "Registration", date: "2024-08-15 14:23", points: 100, completed: true, active: false }, { id: 2, name: "Memories", date: "", points: 100, completed: false, active: true, badge: "Получить подарочек" }, { id: 3, name: "Cyber toy", date: "", points: 100, completed: false, active: false }, { id: 4, name: "Flood", date: "", points: 100, completed: false, active: false }, { id: 5, name: "Core", date: "", points: 100, completed: false, active: false }, { id: 6, name: "Access point", date: "", points: 100, completed: false, active: false } ] const badges = [ { id: 1, name: "Speed Runner", date: "16.08.2024", description: "За скорость", requirement: "Решить: 8%", icon: "🏃", color: "from-cyan-500 to-blue-500", rarity: "rare" }, { id: 2, name: "Precision Master", date: "17.08.2024", description: "За точность", requirement: "Решить: 25%", icon: "🎯", color: "from-purple-500 to-pink-500", rarity: "epic" }, { id: 3, name: "Secret Master", date: "Заблокировано", description: "Заблокировано", requirement: "Решить: ???", locked: true, icon: "🔒", color: "from-gray-500 to-gray-700", rarity: "legendary" }, { id: 4, name: "NoName", date: "Заблокировано", description: "", requirement: "Решить:", locked: true, icon: "❓", color: "from-gray-500 to-gray-700", rarity: "unknown" } ] const visibleBadges = badges.slice(currentBadgeSlide, currentBadgeSlide + 3) // Initialize particles useEffect(() => { const initParticles: Particle[] = [] const colors = ['#06b6d4', '#ec4899', '#8b5cf6', '#3b82f6'] for (let i = 0; i < 60; i++) { initParticles.push({ x: Math.random() * (typeof window !== 'undefined' ? window.innerWidth : 1920), y: Math.random() * (typeof window !== 'undefined' ? window.innerHeight : 1080), vx: (Math.random() - 0.5) * 0.6, vy: (Math.random() - 0.5) * 0.6, size: Math.random() * 2.5 + 1, opacity: Math.random() * 0.5 + 0.2, color: colors[Math.floor(Math.random() * colors.length)] }) } setParticles(initParticles) }, []) // Animate particles useEffect(() => { const canvas = canvasRef.current if (!canvas) return const ctx = canvas.getContext('2d') if (!ctx) return const updateCanvasSize = () => { canvas.width = window.innerWidth canvas.height = window.innerHeight } updateCanvasSize() let animationFrameId: number const animate = () => { ctx.clearRect(0, 0, canvas.width, canvas.height) setParticles(prevParticles => { return prevParticles.map(particle => { let newX = particle.x + particle.vx let newY = particle.y + particle.vy if (newX < 0 || newX > canvas.width) particle.vx *= -1 if (newY < 0 || newY > canvas.height) particle.vy *= -1 newX = Math.max(0, Math.min(canvas.width, newX)) newY = Math.max(0, Math.min(canvas.height, newY)) ctx.shadowBlur = 8 ctx.shadowColor = particle.color ctx.fillStyle = `${particle.color}${Math.floor(particle.opacity * 255).toString(16).padStart(2, '0')}` ctx.beginPath() ctx.arc(newX, newY, particle.size, 0, Math.PI * 2) ctx.fill() return { ...particle, x: newX, y: newY } }) }) animationFrameId = requestAnimationFrame(animate) } animate() window.addEventListener('resize', updateCanvasSize) return () => { cancelAnimationFrame(animationFrameId) window.removeEventListener('resize', updateCanvasSize) } }, []) // Mouse parallax useEffect(() => { const handleMouseMove = (e: MouseEvent) => { setMousePos({ x: e.clientX, y: e.clientY }) } window.addEventListener('mousemove', handleMouseMove) return () => window.removeEventListener('mousemove', handleMouseMove) }, []) const nextSlide = () => { if (currentBadgeSlide < badges.length - 3) { setCurrentBadgeSlide(currentBadgeSlide + 1) } } const prevSlide = () => { if (currentBadgeSlide > 0) { setCurrentBadgeSlide(currentBadgeSlide - 1) } } const getRarityColor = (rarity: string) => { switch (rarity) { case 'rare': return 'from-blue-500 to-cyan-500' case 'epic': return 'from-purple-500 to-pink-500' case 'legendary': return 'from-yellow-500 to-orange-500' default: return 'from-gray-500 to-gray-600' } } return (
{/* Animated particles canvas */} {/* Animated background effects */}
{/* Header */}
{/* Main Content */}
{/* Left Column - Personal Progress & Quests */}
{/* Personal Progress */} {/* Animated border glow */}
{/* Animated background pattern */}

Personal Progress

{userData.rank}
{userData.totalPoints}
Total Points
Level {userData.level}
Current Level
{userData.questsCompleted}/{userData.totalQuests}
Quests Completed
{userData.gameProgress}%
Game Progress
{/* Progress Bar */}
Overall Progress {userData.gameProgress}%
{/* Quests List */}

Quest Log

{quests.map((quest, index) => (
{/* Animated background for active quest */} {quest.active && ( <>
)}
{quest.completed ? (
) : (
{quest.active && (
)}
)}
{quest.name} {quest.badge && ( {quest.badge} )}
{quest.date && (
{quest.date}
)}
+{quest.points} XP
))}
{/* Badges Carousel */}

Achievement Collection

{visibleBadges.map((badge, index) => ( {!badge.locked && ( <>
{badge.rarity}
)}
{!badge.locked && ( <>
)} {badge.icon}

{badge.name}

{badge.date}

{badge.description && (

{badge.description}

)}

{badge.requirement}

))}
{/* Dots Indicator */}
{Array.from({ length: badges.length - 2 }).map((_, index) => (
{/* Right Column - Profile Settings */}
{/* Animated corner decorations */}
{/* Level badge */}
{userData.level}
{/* Status indicator */}

Profile Settings

Member since {userData.joinDate}

{/* School Nickname */}
{/* Change Password */}
{/* Change Avatar */}
{/* Additional Stats */}
Streak
7 days
Rank
#42
{/* Enhanced Background grid */}
) }