// Packages — matches old site: Boost / Signature (featured) / Komplettpaket / Custom // Animated: staggered card reveal + magnetic hover tilt + gold sheen sweep const { useState: useSt, useRef: useR, useEffect: useEf } = React; function Packages({ lang }) { const t = (de, pl) => lang === 'de' ? de : pl; const [visible, setVisible] = useSt(false); const sectionRef = useR(null); useEf(() => { const obs = new IntersectionObserver(([e]) => { if (e.isIntersecting) { setVisible(true); obs.disconnect(); } }, { threshold: 0.2 }); if (sectionRef.current) obs.observe(sectionRef.current); return () => obs.disconnect(); }, []); const tiers = [ { name: 'Boost', price: t('Auf Anfrage','Na zapytanie'), f: [t('2x Social-Media-Videos','2x filmy na media społecznościowe'), t('Videoproduzent bei Bedarf','Producent wideo w razie potrzeby'), t('Thumbnails inklusive','Thumbnails w cenie'), t('Skript & Musik','Skrypt i muzyka')], cta: t('Anfragen','Zapytaj') }, { name: 'Signature', price: t('Auf Anfrage','Na zapytanie'), f: [t('4x Social Media Videos','4x filmy Social Media'), t('N8N Einrichtung + Datenbank','Konfiguracja N8N + baza danych'), t('1x KI-Automatisierung','1x Automatyzacja AI'), t('WhatsApp Priority-Support < 24h','WhatsApp Priority-Support < 24h')], cta: t('Anfragen','Zapytaj'), popular: true }, { name: t('Komplettpaket','Pełny pakiet'), price: t('Auf Anfrage','Na zapytanie'), f: [t('Alles aus Signature inklusive','Wszystko z Signature w cenie'), t('8 Videos pro Monat','8 filmów miesięcznie'), t('Content-Plan & Strategie','Plan treści i strategia'), t('Kanalverwaltung & Werbeanzeigen','Zarządzanie kanałami i reklamy')], cta: t('Anfragen','Zapytaj') }, { name: 'Custom', price: t('Individuell','Indywidualnie'), f: [t('Einzelvideos & N8N-Einrichtung','Pojedyncze filmy i konfiguracja N8N'), t('Individuelle KI-Automatisierungen','Indywidualne automatyzacje AI'), t('Monatlicher Automations-Support','Miesięczny support automatyzacji'), t('Kostenlose Prozessanalyse vorab','Bezpłatna analiza procesu')], cta: t('Gespräch vereinbaren','Umów rozmowę') } ]; const isMobile = window.useIsMobile ? window.useIsMobile() : false; const pkgScrollerRef = useR(null); const [pkgActive, setPkgActive] = useSt(1); // start on Signature (popular) const didInitScroll = useR(false); // Initial scroll to popular tier — runs ONCE useEf(() => { if (!isMobile) return; if (didInitScroll.current) return; const el = pkgScrollerRef.current; if (!el) return; didInitScroll.current = true; requestAnimationFrame(() => { el.scrollLeft = el.clientWidth; }); }, [isMobile]); // Scroll listener — attached once, no pkgActive dep useEf(() => { if (!isMobile) return; const el = pkgScrollerRef.current; if (!el) return; let raf; const onScroll = () => { if (raf) return; raf = requestAnimationFrame(() => { raf = null; const idx = Math.round(el.scrollLeft / el.clientWidth); setPkgActive(prev => (prev !== idx && idx >= 0 && idx < tiers.length) ? idx : prev); }); }; el.addEventListener('scroll', onScroll, { passive: true }); return () => { el.removeEventListener('scroll', onScroll); if (raf) cancelAnimationFrame(raf); }; }, [isMobile, tiers.length]); const scrollToPkg = (i) => { const el = pkgScrollerRef.current; if (!el) return; el.scrollTo({ left: i * el.clientWidth, behavior: 'smooth' }); }; return (
{/* Ambient gold glow — sanft, damit Packages atmosphärisch unterscheidbar bleibt ohne harte Kante */}
— {t('Pakete','Pakiety')}

{t('Wähle dein Paket','Wybierz swój pakiet')}

{t('Jedes Paket bringt dein Unternehmen messbar nach vorne.','Każdy pakiet mierzalnie rozwija Twój biznes.')}

{isMobile ? (
{/* Pagination dots */}
{tiers.map((tr, i) => (
{/* Snap scroller */}
{tiers.map((tr, i) => (
))}
{/* Swipe hint */}
{t('Wischen', 'Przesuń')}
) : (
{tiers.map((tr, i) => )}
)}
); } function PackageCard({ tr, i, visible, popularLabel, isMobile = false }) { const [hover, setHover] = useSt(false); const [tilt, setTilt] = useSt({ x: 0, y: 0 }); const ref = useR(null); const onMove = (e) => { if (isMobile) return; const r = ref.current.getBoundingClientRect(); const px = (e.clientX - r.left) / r.width - 0.5; const py = (e.clientY - r.top) / r.height - 0.5; setTilt({ x: -py * 6, y: px * 6 }); }; return (
{ if (!isMobile) setHover(true); }} onMouseLeave={() => { if (!isMobile) { setHover(false); setTilt({ x: 0, y: 0 }); } }} onMouseMove={onMove} style={{ position: 'relative', opacity: visible ? 1 : 0, transform: isMobile ? (visible ? 'translateY(0)' : 'translateY(20px)') : (visible ? `perspective(1000px) rotateX(${tilt.x}deg) rotateY(${tilt.y}deg) translateY(${hover ? -6 : 0}px)` : 'perspective(1000px) translateY(40px)'), transition: `opacity .9s cubic-bezier(.16,1,.3,1) ${0.1 + i*0.12}s, transform .5s cubic-bezier(.16,1,.3,1) ${visible ? 0 : (0.1 + i*0.12)}s`, transformStyle: isMobile ? 'flat' : 'preserve-3d', paddingTop: tr.popular ? 14 : 0, height: '100%' }} > {/* Popular badge — OUTSIDE overflow-clipped card */} {tr.popular && (
{popularLabel}
)} {/* Card inner — clipped for sheen */}
{/* Sheen on hover */}
{tr.name}
{tr.price}
    {tr.f.map(f => (
  • {f}
  • ))}
); } window.Packages = Packages;