'use client'; import React, { useState, useEffect } from 'react'; import { motion, AnimatePresence } from 'framer-motion'; import { QRCodeSVG } from 'qrcode.react'; import { Palette } from 'lucide-react'; const colorPresets = [ { fg: '#000000', bg: '#FFFFFF' }, { fg: '#0ea5e9', bg: '#e0f2fe' }, { fg: '#8b5cf6', bg: '#f3e8ff' }, { fg: '#f59e0b', bg: '#fef3c7' }, ]; export const FeatureCustomizationDemo: React.FC = () => { const [activeIndex, setActiveIndex] = useState(0); const [hasAnimated, setHasAnimated] = useState(false); useEffect(() => { if (hasAnimated) return; const interval = setInterval(() => { setActiveIndex((prev) => { const next = prev + 1; if (next >= colorPresets.length) { clearInterval(interval); setHasAnimated(true); return 0; // Reset to first } return next; }); }, 1500); return () => clearInterval(interval); }, [hasAnimated]); const currentPreset = colorPresets[activeIndex]; return (
{/* Header */}

Customization

Brand your QR codes

{/* QR Code with Morphing */}
{/* Color Dots Indicator */}
{colorPresets.map((preset, index) => ( setActiveIndex(index)} className={`w-3 h-3 rounded-full transition-all ${ index === activeIndex ? 'scale-125' : 'scale-100 opacity-50' }`} style={{ background: `linear-gradient(135deg, ${preset.fg}, ${preset.bg})` }} whileHover={{ scale: 1.3 }} whileTap={{ scale: 0.9 }} /> ))}
); };