convert-next.js

This commit is contained in:
R-Bharathraj
2026-06-29 18:07:43 +05:30
parent 4760f8e063
commit 0140b0bdf8
1474 changed files with 16523 additions and 9272 deletions

View File

@@ -0,0 +1,161 @@
'use client';
import React, { useEffect, useRef, useState } from 'react';
const feed = [
{ store: 'Daily Login', pts: +50, time: '2m ago', type: 'earn' },
{ store: 'Walking 5,000 steps', pts: +80, time: '1h ago', type: 'earn' },
{ store: 'Spin Wheel Game', pts: +120, time: '3h ago', type: 'earn' },
{ store: 'Selfie Booth', pts: +200, time: 'Yesterday', type: 'earn' },
{ store: 'Scratch Card', pts: +40, time: 'Yesterday', type: 'earn' },
{ store: 'Match Master', pts: +75, time: '2 days ago', type: 'earn' },
{ store: 'Maze Challenge', pts: +95, time: '3 days ago', type: 'earn' },
];
export default function EarnRewardsSection() {
const [pts, setPts] = useState(0);
const panelRef = useRef<HTMLDivElement>(null);
const rafRef = useRef<number>(0);
useEffect(() => {
const el = panelRef.current;
if (!el) return;
const obs = new MutationObserver(() => {
if (el.hasAttribute('data-active')) {
const start = performance.now();
const tick = (now: number) => {
const t = Math.min((now - start) / 1800, 1);
setPts(Math.round((1 - Math.pow(1 - t, 3)) * 284));
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); };
}, []);
return (
<section ref={panelRef} className="fp-panel fp-light" style={{ background: '#ffffff' }}>
<div className="fp-shell">
<div className="fp-split" style={{ gridTemplateColumns: '1.05fr 0.95fr' }}>
{/* Left — points + headline */}
<div>
{/* Live label */}
<div className="fp-rise" style={{
display: 'inline-flex', alignItems: 'center', gap: 8, marginBottom: 20,
background: '#f0fdf4', border: '1.5px solid #16a34a', borderRadius: 100, padding: '7px 16px',
}}>
<span style={{ width: 7, height: 7, borderRadius: '50%', background: '#16a34a', flexShrink: 0, animation: 'fpPulse 1.5s infinite' }} />
<span style={{ fontSize: 11, fontWeight: 700, color: '#16a34a', fontFamily: 'Manrope, sans-serif', letterSpacing: '0.1em', textTransform: 'uppercase' }}>Live points balance</span>
</div>
{/* Giant gold number */}
<div style={{
fontSize: 'clamp(80px, 12vw, 168px)', fontWeight: 900, fontFamily: 'Sora, sans-serif',
color: '#f4be28', letterSpacing: '-0.05em', lineHeight: 0.92,
textShadow: '0 4px 40px rgba(244,190,40,0.25)',
}}>
{pts.toLocaleString()}
</div>
{/* Redeemable line */}
<div className="fp-rise" style={{
display: 'inline-flex', alignItems: 'center', gap: 10, marginTop: 14, marginBottom: 44,
padding: '10px 18px', borderRadius: 12,
background: '#fff7e0', border: '1px solid #f4be28',
}}>
<span style={{ fontSize: 18, fontWeight: 900, color: '#bc7122', fontFamily: 'Sora, sans-serif' }}>{pts.toLocaleString()}</span>
<span style={{ fontSize: 13, color: '#4f463a', fontFamily: 'Manrope, sans-serif' }}>redeemable value</span>
</div>
<div style={{ marginBottom: 16 }}><span className="fp-kicker fp-rise">Earn · 03</span></div>
<h2 style={{
fontSize: 'clamp(28px, 3.4vw, 48px)', fontWeight: 900, lineHeight: 1.08,
letterSpacing: '-0.04em', color: '#171512', margin: '0 0 20px', fontFamily: 'Sora, sans-serif',
}}>
<span className="fp-mask"><span>Every step.</span></span>
<span className="fp-mask"><span style={{ color: '#f4be28' }}>Every game.</span></span>
<span className="fp-mask"><span>Every day.</span></span>
</h2>
<p className="fp-rise" style={{
fontSize: 15, lineHeight: 1.8, color: '#4f463a', fontFamily: 'Manrope, sans-serif', maxWidth: 380, margin: 0,
}}>
Earn Loyaly Coins through daily app login, completing 5,000-step walking challenges, playing Maze, Spin Wheel, Scratch Card, and Match Master games, or visiting Selfie Booths at partner malls. Every activity puts more coins in your wallet.
</p>
</div>
{/* Right — live feed */}
<div className="fp-rise" style={{ transitionDelay: '0.15s' }}>
{/* Feed header */}
<div style={{
display: 'flex', justifyContent: 'space-between', alignItems: 'center',
marginBottom: 14, paddingBottom: 14, borderBottom: '2px solid #f4be28',
}}>
<span style={{ fontSize: 12, fontWeight: 700, letterSpacing: '0.14em', textTransform: 'uppercase', color: '#171512', fontFamily: 'Manrope, sans-serif' }}>Activity feed</span>
<span style={{ fontSize: 11, color: '#16a34a', fontWeight: 700, fontFamily: 'Manrope, sans-serif', display: 'flex', alignItems: 'center', gap: 5,
background: '#f0fdf4', border: '1px solid #16a34a', borderRadius: 100, padding: '4px 10px',
}}>
<span style={{ width: 5, height: 5, borderRadius: '50%', background: '#16a34a', display: 'block', animation: 'fpPulse 1.5s infinite' }} />
LIVE
</span>
</div>
{/* Feed rows */}
<div style={{ display: 'flex', flexDirection: 'column', gap: 6 }}>
{feed.map((tx, i) => (
<div key={i} style={{
display: 'flex', alignItems: 'center', justifyContent: 'space-between',
padding: '12px 14px', borderRadius: 12,
background: i === 0 ? '#f0fdf4' : '#fafafa',
border: `1.5px solid ${i === 0 ? '#16a34a' : 'rgba(23,21,18,0.07)'}`,
}}>
<div style={{ display: 'flex', alignItems: 'center', gap: 12 }}>
<div style={{
width: 36, height: 36, borderRadius: 10, flexShrink: 0,
background: tx.type === 'earn' ? '#f0fdf4' : '#fef2f2',
border: `1.5px solid ${tx.type === 'earn' ? '#16a34a' : '#ef4444'}`,
display: 'flex', alignItems: 'center', justifyContent: 'center',
fontSize: 15, fontWeight: 900,
color: tx.type === 'earn' ? '#16a34a' : '#ef4444',
}}>{tx.type === 'earn' ? '↑' : '↓'}</div>
<div>
<div style={{ fontSize: 13, fontWeight: 700, color: '#171512', fontFamily: 'Manrope, sans-serif' }}>{tx.store}</div>
<div style={{ fontSize: 11, color: 'rgba(23,21,18,0.45)', fontFamily: 'Manrope, sans-serif', marginTop: 1 }}>{tx.time}</div>
</div>
</div>
<span style={{
fontSize: 15, fontWeight: 900, fontFamily: 'Sora, sans-serif',
color: tx.type === 'earn' ? '#16a34a' : '#ef4444', letterSpacing: '-0.02em',
background: tx.type === 'earn' ? '#f0fdf4' : '#fef2f2',
padding: '4px 10px', borderRadius: 8,
}}>
{tx.pts > 0 ? '+' : ''}{tx.pts}
</span>
</div>
))}
</div>
{/* Summary strip */}
<div style={{
marginTop: 16, display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 10,
}}>
{[
{ label: 'Earned this month', val: '660 pts', color: '#16a34a', bg: '#f0fdf4', border: '#16a34a' },
{ label: 'Redeemable value', val: '₹660', color: '#f4be28', bg: '#fff7e0', border: '#f4be28' },
].map((s, i) => (
<div key={i} style={{ padding: '14px 16px', borderRadius: 14, background: s.bg, border: `1.5px solid ${s.border}` }}>
<div style={{ fontSize: 11, color: 'rgba(23,21,18,0.5)', fontFamily: 'Manrope, sans-serif', marginBottom: 4 }}>{s.label}</div>
<div style={{ fontSize: 18, fontWeight: 900, color: s.color, fontFamily: 'Sora, sans-serif' }}>{s.val}</div>
</div>
))}
</div>
</div>
</div>
</div>
</section>
);
}