perf(thermal): eradicate thermal heating, CPU throttling, and excessive power draw across mobile and low-end devices

This commit is contained in:
2026-11-05 15:44:10 +05:30
parent 8715e23be0
commit fcd716463b
13 changed files with 396 additions and 321 deletions
+14 -18
View File
@@ -38,7 +38,7 @@ export function HowItWorks3DSection({
useEffect(() => {
if (isPaused) return;
const section = sectionRef.current;
let isVisible = true;
let isVisible = false; // Must be false until IntersectionObserver confirms visibility
let timer: any = null;
const runTimer = () => {
@@ -47,7 +47,7 @@ export function HowItWorks3DSection({
if (isVisible && !document.hidden && !isPaused) {
setActiveStep((prev) => (prev === 3 ? 1 : ((prev + 1) as 1 | 2 | 3)));
}
}, 3400);
}, 4500);
};
const observer = new IntersectionObserver(
@@ -60,11 +60,10 @@ export function HowItWorks3DSection({
timer = null;
}
},
{ threshold: 0.1 }
{ threshold: 0.15 }
);
if (section) observer.observe(section);
runTimer();
const handleVisibility = () => {
if (document.hidden && timer) {
@@ -101,7 +100,7 @@ export function HowItWorks3DSection({
{/* Playful & Warm Section Header */}
<div className="text-center max-w-3xl mx-auto space-y-4">
<div className="inline-flex items-center gap-2 px-4 py-1.5 rounded-full text-xs font-display font-bold tracking-wider uppercase text-amber-900 bg-amber-100/80 border border-amber-300 shadow-sm">
<Sparkles className="w-4 h-4 text-amber-600 animate-spin" style={{ animationDuration: '6s' }} />
<Sparkles className="w-4 h-4 text-amber-600" />
<span>{badge}</span>
</div>
@@ -199,7 +198,7 @@ function TravellingTransformationPipeline({
<div className="flex flex-col md:flex-row md:items-center justify-between gap-4 pb-6 border-b border-slate-100">
<div>
<div className="inline-flex items-center gap-2 px-3 py-1 rounded-full bg-slate-100 text-slate-800 text-[11px] font-mono font-bold tracking-wider uppercase mb-1">
<span className={`w-2 h-2 rounded-full animate-ping ${
<span className={`w-2 h-2 rounded-full ${
activeStep === 1 ? 'bg-blue-600' : activeStep === 2 ? 'bg-amber-500' : 'bg-emerald-500'
}`} />
<span>Live Photo Journey Pipeline</span>
@@ -434,7 +433,7 @@ function StepUploadCard({ isActive = false }: { isActive?: boolean }) {
{/* Step Badge */}
<div className="flex items-center justify-between mb-5">
<div className="inline-flex items-center gap-2 px-3.5 py-1 rounded-full bg-blue-50 border border-blue-200 text-blue-700 text-xs font-display font-bold uppercase tracking-wider">
{isActive && <span className="w-2 h-2 rounded-full bg-blue-600 animate-ping" />}
{isActive && <span className="w-2 h-2 rounded-full bg-blue-600 inline-block" />}
<span>STEP 01</span>
</div>
<span className="text-xl">📸</span>
@@ -445,7 +444,7 @@ function StepUploadCard({ isActive = false }: { isActive?: boolean }) {
{/* Animated floating dashed dropzone */}
<div className="w-full h-full border-2 border-dashed border-blue-300/80 rounded-2xl flex flex-col items-center justify-center p-4 relative">
{/* Playful Floating Photo Frame (GPU-composited CSS float, 0% JS overhead) */}
<div className="w-36 h-28 rounded-2xl bg-white shadow-xl border-2 border-white overflow-hidden p-1.5 animate-float-slow transform-gpu">
<div className="w-36 h-28 rounded-2xl bg-white shadow-xl border-2 border-white overflow-hidden p-1.5 transform-gpu">
<img
src="/management/pages/home/sections/how-it-works/media/before.jpg"
alt="Your Photo"
@@ -508,7 +507,7 @@ function StepMagicCard({ isActive = false }: { isActive?: boolean }) {
{/* Step Badge */}
<div className="flex items-center justify-between mb-5">
<div className="inline-flex items-center gap-2 px-3.5 py-1 rounded-full bg-amber-50 border border-amber-200 text-amber-800 text-xs font-display font-bold uppercase tracking-wider">
{isActive && <span className="w-2 h-2 rounded-full bg-amber-500 animate-ping" />}
{isActive && <span className="w-2 h-2 rounded-full bg-amber-500 inline-block" />}
<span>STEP 02</span>
</div>
<span className="text-xl">🪄</span>
@@ -516,20 +515,17 @@ function StepMagicCard({ isActive = false }: { isActive?: boolean }) {
{/* Visual Animation: Swirling Magical Portal */}
<div className="relative w-full h-[230px] rounded-3xl bg-gradient-to-b from-amber-50/80 via-purple-50/50 to-pink-50/60 border border-amber-200/80 overflow-hidden flex flex-col items-center justify-center p-4 select-none">
{/* Glowing Aura Ring */}
<div className="absolute w-36 h-36 rounded-full bg-gradient-to-tr from-amber-300/40 via-purple-300/40 to-pink-300/40 blur-xl animate-pulse" />
{/* Glowing Aura Ring — static, no animation to prevent thermal issues */}
<div className="absolute w-36 h-36 rounded-full bg-gradient-to-tr from-amber-300/30 via-purple-300/30 to-pink-300/30 blur-xl" />
{/* Central Wand and Sparkling Swirl */}
<div className="relative z-10 flex flex-col items-center justify-center">
<div className="w-20 h-20 rounded-3xl bg-white shadow-xl border border-amber-200 flex items-center justify-center transform group-hover:scale-110 transition-transform duration-300">
<Wand2 className="w-10 h-10 text-amber-500 animate-bounce" />
<Wand2 className="w-10 h-10 text-amber-500" />
</div>
{/* Orbiting Stars & Sparkles (Pure CSS 60/120fps hardware rotation - 0% JS intervals!) */}
<div
className="absolute inset-[-20px] pointer-events-none animate-spin"
style={{ animationDuration: '8s' }}
>
{/* Stars — static, no spin to avoid continuous GPU paint */}
<div className="absolute inset-[-20px] pointer-events-none">
<span className="absolute top-0 left-1/2 -translate-x-1/2 text-amber-400 text-base">✨</span>
<span className="absolute bottom-0 left-1/2 -translate-x-1/2 text-purple-400 text-sm">⭐</span>
<span className="absolute left-0 top-1/2 -translate-y-1/2 text-pink-400 text-sm">💫</span>
@@ -586,7 +582,7 @@ function StepTadaCard({ isActive = false }: { isActive?: boolean }) {
{/* Step Badge */}
<div className="flex items-center justify-between mb-5">
<div className="inline-flex items-center gap-2 px-3.5 py-1 rounded-full bg-emerald-50 border border-emerald-200 text-emerald-800 text-xs font-display font-bold uppercase tracking-wider">
{isActive && <span className="w-2 h-2 rounded-full bg-emerald-500 animate-ping" />}
{isActive && <span className="w-2 h-2 rounded-full bg-emerald-500 inline-block" />}
<span>STEP 03</span>
</div>
<span className="text-xl">🎉</span>