checkpoint2

This commit is contained in:
2026-11-06 10:53:55 +05:30
parent 7f1e77ad6d
commit 69d4195718
20 changed files with 1306 additions and 2963 deletions
+86 -193
View File
@@ -1,9 +1,8 @@
'use client';
import React, { useState, useEffect, useRef } from 'react';
import { Star, MessageSquareQuote, CheckCircle2 } from 'lucide-react';
import React from 'react';
import { Star } from 'lucide-react';
import { Marquee } from '@/components/magicui/marquee';
import { TextAnimate } from '@/components/magicui/text-animate';
interface ReviewsMarqueeSectionProps {
title?: string;
@@ -14,181 +13,131 @@ interface ReviewsMarqueeSectionProps {
const REVIEWS_ROW_1 = [
{
name: 'Elena Rostova',
username: '@elena_studios',
role: 'Editorial Portrait Photographer',
rating: 5,
avatar: 'ER',
body: 'The blemish remover is lightyears ahead of typical automated tools. It removes red spots and imperfections while keeping real pores and skin texture intact.',
tool: 'Blemish Remover',
role: 'Editorial portrait photographer',
body: 'The blemish remover removes spots and imperfections while keeping real pores and skin texture intact.',
tool: 'Skin & blemish retoucher',
},
{
name: 'Marcus Vance',
username: '@vance_commerce',
role: 'Shopify Store Owner',
rating: 5,
avatar: 'MV',
body: 'The P3M cutout matting saved my product photography workflow. Hair strands and glass reflections are perfectly separated in under a second.',
tool: 'Background Remover',
role: 'Store owner',
body: 'The P3M cutout matting separated flyaway hair strands and transparent glass reflections cleanly.',
tool: 'Background remover',
},
{
name: 'David Chen',
username: '@davidchen_art',
role: 'Digital Concept Artist',
rating: 5,
avatar: 'DC',
body: 'Zero-storage privacy was our #1 criteria. Knowing photos aren’t kept on a remote server gave our agency complete peace of mind.',
tool: 'Zero-Storage Policy',
role: 'Concept artist',
body: 'Zero-storage privacy was our main requirement. Knowing images are processed in volatile memory gave complete peace of mind.',
tool: 'Zero-storage policy',
},
{
name: 'Ananya Sharma',
username: '@ananya_design',
role: 'Fashion Creative Director',
rating: 5,
avatar: 'AS',
body: 'Super clean results without signing up for an account. I tried it right on desktop and immediately downloaded the iOS app for batch edits.',
tool: 'Portrait Studio App',
role: 'Creative director',
body: 'Clean results without account registration. Tested in browser and handed off to mobile for batch work.',
tool: 'Mobile studio suite',
},
];
const REVIEWS_ROW_2 = [
{
name: 'Liam O’Connor',
username: '@liam_restores',
role: 'Historical Archivist',
rating: 5,
avatar: 'LO',
body: 'I restored my grandparents’ 1942 wedding photo. The generative facial super-resolution restored the iris clarity and fine lace details amazingly.',
tool: 'Vintage Restorer',
role: 'Historical archivist',
body: 'Restored vintage portrait prints with natural iris clarity and fine fiber details intact.',
tool: 'Archival restorer',
},
{
name: 'Chloe Dubois',
username: '@chloe_visuals',
role: 'Social Media Creator',
rating: 5,
avatar: 'CD',
body: 'The anime avatar tool is genuinely viral. It doesn’t just blur your face with a cartoon filter, it genuinely reinterprets lineart.',
tool: 'CartoonGAN Studio',
role: 'Content creator',
body: 'The anime tool reinterprets lineart and shading rather than just applying a cheap filter blur.',
tool: 'Anime synthesis',
},
{
name: 'Vikram Malhotra',
username: '@vikram_ux',
role: 'Product Lead',
rating: 5,
avatar: 'VM',
body: 'Blazingly fast. No laggy loading screens, instantaneous before/after comparison slider, and crystal clear 4K export quality.',
tool: 'Photo Enhancer 4K',
role: 'Design engineer',
body: 'Instantaneous before/after comparison scrub with lossless 4K export quality directly in session.',
tool: 'Photo enhancer 4K',
},
{
name: 'Sophie Tanaka',
username: '@sophie_tanaka',
role: 'Commercial Retoucher',
rating: 5,
avatar: 'ST',
body: 'Teeth whitening without that artificial nuclear neon white look. It subtly brightens enamel while respecting natural gum tones.',
tool: 'Teeth Whitener AI',
role: 'Commercial retoucher',
body: 'Subtly brightens enamel while respecting natural gum tones and lighting reflections.',
tool: 'Teeth whitener',
},
];
export function ReviewsMarqueeSection({
title = 'Loved by Creators & Professionals',
badge = 'VERIFIED COMMUNITY FEEDBACK',
subtitle = 'Over 1.4 million photos processed with five-star ratings across web and mobile apps.',
title = 'Photographer & studio notes',
subtitle = 'Feedback from portrait photographers, archivists, and studio retouchers.',
}: ReviewsMarqueeSectionProps) {
const sectionRef = useRef<HTMLDivElement>(null);
const [isInView, setIsInView] = useState(false);
// Viewport-aware animation: Pauses CSS animation completely when section is offscreen
// Eliminates 100% idle CPU and GPU compositing when user is browsing other sections
useEffect(() => {
const el = sectionRef.current;
if (!el) return;
let isVisible = false;
const updateState = () => {
setIsInView(isVisible && !document.hidden);
};
const observer = new IntersectionObserver(
([entry]) => {
isVisible = entry.isIntersecting;
updateState();
},
{ threshold: 0.05 }
);
observer.observe(el);
const handleVisibility = () => {
updateState();
};
document.addEventListener('visibilitychange', handleVisibility);
return () => {
observer.disconnect();
document.removeEventListener('visibilitychange', handleVisibility);
};
}, []);
return (
<section
id="user-reviews"
ref={sectionRef}
className="py-14 sm:py-20 bg-[#FAF8F5] relative overflow-hidden border-t border-slate-900/[0.06]"
className="py-16 sm:py-24 bg-paper border-b border-rule relative overflow-hidden"
>
{/* Symbolic Elemental Ambient Highlights */}
<div
className="absolute inset-0 pointer-events-none -z-10"
style={{
background: 'radial-gradient(circle at 50% 50%, rgba(245,158,11,0.05) 0%, transparent 60%)',
}}
/>
<div className="max-w-[1640px] mx-auto px-4 sm:px-6 md:px-8 lg:px-10 space-y-10">
<div className="max-w-container mx-auto px-4 sm:px-6 md:px-8 lg:px-10 space-y-10">
{/* Section Header */}
<div className="text-center max-w-3xl mx-auto space-y-4">
<div className="inline-flex items-center gap-2 px-3.5 py-1 rounded-full text-xs font-mono font-semibold tracking-wider uppercase text-blue-700 bg-blue-50 border border-blue-200">
<MessageSquareQuote className="w-3.5 h-3.5 text-blue-600" />
<span>{badge}</span>
</div>
<h2 className="text-3xl sm:text-5xl font-display font-extrabold text-slate-900 tracking-tight text-balance">
<TextAnimate animation="slideLeft" by="word">
{title}
</TextAnimate>
<div className="max-w-2xl space-y-2 border-b border-rule pb-5">
<h2 className="text-3xl sm:text-4xl font-display font-bold text-ink tracking-tight">
{title}
</h2>
<p className="text-sm sm:text-base text-slate-600 font-sans text-pretty">
<TextAnimate animation="fadeIn" by="word" delay={0.08}>
{subtitle}
</TextAnimate>
<p className="text-sm sm:text-base text-ink-2 font-body text-pretty">
{subtitle}
</p>
</div>
{/* Marquee Container with Left & Right Gradient Feather Masks - Paused when offscreen */}
<div
className="relative flex w-full flex-col items-center justify-center overflow-hidden [mask-image:linear-gradient(to_right,transparent,black_10%,black_90%,transparent)]"
style={{
animationPlayState: isInView ? 'running' : 'paused',
}}
>
{/* Row 1: Leftward Marquee */}
<Marquee
pauseOnHover
className={`[--duration:35s] ${!isInView ? '[&>*]:[animation-play-state:paused]' : ''}`}
>
{REVIEWS_ROW_1.map((review, idx) => (
<ReviewCard key={idx} {...review} />
{/* Marquee Row 1 */}
<div className="space-y-4">
<Marquee pauseOnHover className="[--duration:40s]">
{REVIEWS_ROW_1.map((rev, i) => (
<div
key={i}
className="w-80 studio-sheet p-5 mx-2.5 crop-marked flex flex-col justify-between"
>
<div>
<div className="flex items-center justify-between border-b border-rule pb-2 mb-3">
<span className="text-xs font-body font-medium text-accent">{rev.tool}</span>
<div className="flex text-accent" aria-label="5 stars">
{[...Array(5)].map((_, s) => (
<Star key={s} className="w-3 h-3 fill-accent text-accent" aria-hidden="true" />
))}
</div>
</div>
<p className="text-xs text-ink-2 leading-relaxed font-body">
"{rev.body}"
</p>
</div>
<div className="mt-4 pt-2 border-t border-rule text-xs font-body">
<span className="font-semibold text-ink block">{rev.name}</span>
<span className="text-muted block text-[11px]">{rev.role}</span>
</div>
</div>
))}
</Marquee>
{/* Row 2: Rightward Reverse Marquee */}
<Marquee
reverse
pauseOnHover
className={`[--duration:40s] mt-4 ${!isInView ? '[&>*]:[animation-play-state:paused]' : ''}`}
>
{REVIEWS_ROW_2.map((review, idx) => (
<ReviewCard key={idx} {...review} />
{/* Marquee Row 2 */}
<Marquee reverse pauseOnHover className="[--duration:45s]">
{REVIEWS_ROW_2.map((rev, i) => (
<div
key={i}
className="w-80 studio-sheet p-5 mx-2.5 crop-marked flex flex-col justify-between"
>
<div>
<div className="flex items-center justify-between border-b border-rule pb-2 mb-3">
<span className="text-xs font-body font-medium text-accent">{rev.tool}</span>
<div className="flex text-accent" aria-label="5 stars">
{[...Array(5)].map((_, s) => (
<Star key={s} className="w-3 h-3 fill-accent text-accent" aria-hidden="true" />
))}
</div>
</div>
<p className="text-xs text-ink-2 leading-relaxed font-body">
"{rev.body}"
</p>
</div>
<div className="mt-4 pt-2 border-t border-rule text-xs font-body">
<span className="font-semibold text-ink block">{rev.name}</span>
<span className="text-muted block text-[11px]">{rev.role}</span>
</div>
</div>
))}
</Marquee>
</div>
@@ -196,59 +145,3 @@ export function ReviewsMarqueeSection({
</section>
);
}
function ReviewCard({
name,
username,
role,
rating,
avatar,
body,
tool,
}: {
name: string;
username: string;
role: string;
rating: number;
avatar: string;
body: string;
tool: string;
}) {
return (
<figure className="relative w-80 sm:w-96 cursor-pointer overflow-hidden rounded-2xl border border-slate-200/90 bg-white p-5 shadow-cream-sm hover:border-blue-300 transition-[border-color,transform] duration-300 ease-[cubic-bezier(0.16,1,0.3,1)]">
<div className="flex items-center justify-between">
<div className="flex items-center gap-3">
<div className="w-10 h-10 rounded-full bg-gradient-to-tr from-blue-600 to-indigo-600 flex items-center justify-center text-white text-xs font-bold tracking-wider shadow-sm">
{avatar}
</div>
<div>
<div className="flex items-center gap-1.5">
<span className="text-sm font-display font-bold text-slate-900">{name}</span>
<CheckCircle2 className="w-3.5 h-3.5 text-blue-600" />
</div>
<p className="text-[11px] text-slate-500">{role}</p>
</div>
</div>
<div className="flex items-center gap-0.5">
{Array(rating)
.fill(0)
.map((_, i) => (
<Star key={i} className="w-3 h-3 fill-amber-400 text-amber-400" />
))}
</div>
</div>
<blockquote className="mt-3.5 text-xs text-slate-600 leading-relaxed font-sans">
“{body}”
</blockquote>
<div className="mt-4 pt-3 border-t border-slate-100 flex items-center justify-between text-[11px] font-mono text-slate-600">
<span className="px-2 py-0.5 rounded bg-blue-50 text-blue-700 font-semibold border border-blue-200/80">
{tool}
</span>
<span className="text-slate-600">{username}</span>
</div>
</figure>
);
}