'use client'; import React, { useEffect, useRef, useState } from 'react'; export default function WhyLoyalySection() { const [active, setActive] = useState(false); const [count, setCount] = useState(0); const panelRef = useRef(null); const rafRef = useRef(0); useEffect(() => { const el = panelRef.current; if (!el) return; const obs = new MutationObserver(() => { const isActive = el.hasAttribute('data-active'); setActive(isActive); if (isActive) { const start = performance.now(); const dur = 2000; const tick = (now: number) => { const t = Math.min((now - start) / dur, 1); setCount(Math.round((1 - Math.pow(1 - t, 4)) * 21000000)); if (t < 1) rafRef.current = requestAnimationFrame(tick); }; rafRef.current = requestAnimationFrame(tick); } }); obs.observe(el, { attributes: true, attributeFilter: ['data-active'] }); return () => { obs.disconnect(); cancelAnimationFrame(rafRef.current); }; }, []); const bars = [ { label: 'Online retail loyalty', pct: 78, color: '#171512' }, { label: 'Offline retail loyalty', pct: 2, color: '#ef4444' }, { label: 'Loyaly target', pct: 60, color: '#f4be28' }, ]; return (
{/* Faint grid */}
The Gap · 01
{/* Giant stat */}
{/* "0%" as two-color giant */}
0 %
Loyalty penetration in offline retail
{/* Three metric chips */}
{[ { val: '₹2.1L Cr', label: 'Offline retail market size', accent: '#171512' }, { val: '<2%', label: 'Currently getting rewards', accent: '#ef4444' }, { val: '10Cr+', label: 'Shoppers Loyaly can reach', accent: '#16a34a' }, ].map((m, i) => (
{m.val}
{m.label}
))}
{/* Content */}
{/* Live counter badge */}
{count.toLocaleString()} txns today · unrewarded

Millions shop offline. Nobody rewards them.

India's offline retail market is worth ₹2.1 lakh crore. Yet loyalty penetration sits at effectively zero. Loyaly exists to close that gap — permanently.

{/* Data bars */} {bars.map((b, i) => (
{b.label} {b.pct}%
))}
); }