'use client'; import { useState, useRef, useEffect } from 'react'; import styles from './SocialConnect.module.css'; const socialPlatforms = [ { name: 'Bluesky', icon: '🦋', color: '#0085ff', delay: 0, symbol: 'B' }, { name: 'Facebook', icon: 'f', color: '#1877f2', delay: 0.1, symbol: 'F' }, { name: 'Google', icon: 'G', color: '#4285f4', delay: 0.2, symbol: 'G' }, { name: 'Instagram', icon: '📷', color: '#e4405f', delay: 0.3, symbol: 'I' }, { name: 'LinkedIn', icon: 'in', color: '#0a66c2', delay: 0.4, symbol: 'L' }, { name: 'Mastodon', icon: '🐘', color: '#6364ff', delay: 0.5, symbol: 'M' }, { name: 'Pinterest', icon: 'P', color: '#e60023', delay: 0.6, symbol: 'P' }, { name: 'Threads', icon: '@', color: '#000000', delay: 0.7, symbol: 'T' }, { name: 'TikTok', icon: '♪', color: '#000000', delay: 0.8, symbol: 'TT' }, { name: 'X', icon: '𝕏', color: '#000000', delay: 0.9, symbol: 'X' }, { name: 'YouTube', icon: '▶', color: '#ff0000', delay: 1.0, symbol: 'Y' }, ]; interface Particle { x: number; y: number; vx: number; vy: number; life: number; color: string; } export default function SocialConnect() { const [hoveredIndex, setHoveredIndex] = useState(null); const [selectedPlatforms, setSelectedPlatforms] = useState([]); const [particles, setParticles] = useState([]); const [mousePos, setMousePos] = useState({ x: 0, y: 0 }); const containerRef = useRef(null); const cardRefs = useRef<(HTMLDivElement | null)[]>([]); // 3D Tilt Effect on Mouse Move const handleMouseMove = (e: React.MouseEvent, index: number) => { const card = cardRefs.current[index]; if (!card) return; const rect = card.getBoundingClientRect(); const x = e.clientX - rect.left; const y = e.clientY - rect.top; const centerX = rect.width / 2; const centerY = rect.height / 2; const rotateX = ((y - centerY) / centerY) * -15; const rotateY = ((x - centerX) / centerX) * 15; card.style.transform = `perspective(1000px) rotateX(${rotateX}deg) rotateY(${rotateY}deg) translateY(-10px) scale(1.05)`; }; const handleMouseLeave = (index: number) => { const card = cardRefs.current[index]; if (card) { card.style.transform = ''; } setHoveredIndex(null); }; // Particle Explosion on Click const createParticles = (e: React.MouseEvent, color: string) => { const rect = (e.currentTarget as HTMLElement).getBoundingClientRect(); const x = e.clientX - rect.left; const y = e.clientY - rect.top; const newParticles: Particle[] = []; for (let i = 0; i < 12; i++) { const angle = (Math.PI * 2 * i) / 12; newParticles.push({ x, y, vx: Math.cos(angle) * (2 + Math.random() * 3), vy: Math.sin(angle) * (2 + Math.random() * 3), life: 1, color, }); } setParticles(prev => [...prev, ...newParticles]); }; const handlePlatformClick = (index: number, e: React.MouseEvent) => { const isSelected = selectedPlatforms.includes(index); setSelectedPlatforms(prev => prev.includes(index) ? prev.filter(i => i !== index) : [...prev, index] ); // Create particle explosion createParticles(e, socialPlatforms[index].color); }; // Animate particles useEffect(() => { if (particles.length === 0) return; const interval = setInterval(() => { setParticles(prev => prev .map(p => ({ ...p, x: p.x + p.vx, y: p.y + p.vy, vy: p.vy + 0.2, // gravity life: p.life - 0.02, })) .filter(p => p.life > 0) ); }, 16); return () => clearInterval(interval); }, [particles]); // Magnetic cursor effect const handleContainerMouseMove = (e: React.MouseEvent) => { setMousePos({ x: e.clientX, y: e.clientY }); }; return (
{/* Animated Background Elements */}
{/* Header */}
🔗 One Platform, All Networks

Connect Your Favorite Accounts

Seamlessly integrate all your social media platforms in one place. Manage, schedule, and analyze everything from a single dashboard.

{/* Interactive Platform Grid */}
🌐

Connect your
favorite accounts

Click to select platforms

{socialPlatforms.map((platform, index) => (
{ cardRefs.current[index] = el; }} className={`${styles.platformCard} ${selectedPlatforms.includes(index) ? styles.selected : '' } ${hoveredIndex === index ? styles.hovered : ''}`} style={{ animationDelay: `${platform.delay}s`, '--platform-color': platform.color } as React.CSSProperties} onMouseEnter={() => setHoveredIndex(index)} onMouseMove={(e) => handleMouseMove(e, index)} onMouseLeave={() => handleMouseLeave(index)} onClick={(e) => handlePlatformClick(index, e)} > {/* 3D Card Inner */}
{platform.icon}
{platform.name}
{selectedPlatforms.includes(index) && (
)}
{/* Animated border */}
{/* Shine effect */}
{/* Connection dots */} {selectedPlatforms.includes(index) && (
)}
))}
{/* Particle System */}
{particles.map((particle, i) => (
))}
{/* Enhanced Stats Bar */}
🎯
11+
Platforms Supported
{selectedPlatforms.length > 0 ? selectedPlatforms.length : '0'}
Selected Networks
🚀
1-Click
Easy Integration
{/* Enhanced CTA Section */}

Ready to streamline your social media?

Connect all your accounts now and start managing them from one powerful dashboard.

{/* Floating Connection Lines Animation */}
); }