fix(performance): eliminate device thermal throttling and remove expand icon from trendy bento

This commit is contained in:
2026-11-05 15:04:28 +05:30
parent 6635ecc6e2
commit b00566fb99
7 changed files with 220 additions and 97 deletions
@@ -1,6 +1,6 @@
'use client';
import React, { useState, useEffect } from 'react';
import React from 'react';
import {
Sparkles,
Wand2,
@@ -103,15 +103,6 @@ export function HowItWorks3DSection({
// Card 1: Upload Your Picture (Super Warm & Visual)
// -------------------------------------------------------------
function StepUploadCard() {
const [bounce, setBounce] = useState(false);
useEffect(() => {
const timer = setInterval(() => {
setBounce((prev) => !prev);
}, 2000);
return () => clearInterval(timer);
}, []);
return (
<div className="group relative flex flex-col justify-between rounded-[36px] bg-white border border-slate-200/90 p-7 shadow-cream-sm hover:shadow-cream-lg transition-all duration-300 hover:-translate-y-1.5 hover:border-blue-400/60">
<div>
@@ -127,12 +118,8 @@ function StepUploadCard() {
<div className="relative w-full h-[230px] rounded-3xl bg-gradient-to-b from-blue-50/70 to-indigo-50/40 border border-blue-100 overflow-hidden flex flex-col items-center justify-center p-4 select-none">
{/* 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 */}
<div
className={`w-36 h-28 rounded-2xl bg-white shadow-xl border-2 border-white overflow-hidden p-1.5 transition-transform duration-700 ${
bounce ? 'translate-y-0 rotate-1 scale-105' : '-translate-y-2 -rotate-2 scale-100'
}`}
>
{/* 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">
<img
src="/management/pages/home/sections/how-it-works/media/before.jpg"
alt="Your Photo"
@@ -185,15 +172,6 @@ function StepUploadCard() {
// Card 2: The Magic Happens (Playful & Magical)
// -------------------------------------------------------------
function StepMagicCard() {
const [sparkleRot, setSparkleRot] = useState(0);
useEffect(() => {
const interval = setInterval(() => {
setSparkleRot((prev) => (prev + 30) % 360);
}, 250);
return () => clearInterval(interval);
}, []);
return (
<div className="group relative flex flex-col justify-between rounded-[36px] bg-white border border-slate-200/90 p-7 shadow-cream-sm hover:shadow-cream-lg transition-all duration-300 hover:-translate-y-1.5 hover:border-amber-400/60">
<div>
@@ -216,10 +194,10 @@ function StepMagicCard() {
<Wand2 className="w-10 h-10 text-amber-500 animate-bounce" />
</div>
{/* Orbiting Stars & Sparkles */}
{/* Orbiting Stars & Sparkles (Pure CSS 60/120fps hardware rotation - 0% JS intervals!) */}
<div
className="absolute inset-[-20px] pointer-events-none transition-transform duration-300"
style={{ transform: `rotate(${sparkleRot}deg)` }}
className="absolute inset-[-20px] pointer-events-none animate-spin"
style={{ animationDuration: '8s' }}
>
<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>