perf(animations): refactor ShiftableToolsGrid, cursor, hero & sections to locked 60-120fps with zero layout thrashing
This commit is contained in:
@@ -230,7 +230,7 @@ export function TrendyBentoSection({
|
||||
<button
|
||||
key={cat.id}
|
||||
onClick={() => setActiveCategory(cat.id)}
|
||||
className={`flex items-center gap-1.5 px-4 py-2 rounded-full transition-all duration-200 ${
|
||||
className={`flex items-center gap-1.5 px-4 py-2 rounded-full transition-[transform,background-color,color] duration-200 ease-[cubic-bezier(0.16,1,0.3,1)] ${
|
||||
isActive
|
||||
? 'bg-slate-950 text-white shadow-md shadow-slate-900/15 scale-105'
|
||||
: 'bg-white/90 text-slate-700 hover:bg-slate-100 border border-slate-200 shadow-sm'
|
||||
@@ -259,18 +259,24 @@ export function TrendyBentoSection({
|
||||
return (
|
||||
<div
|
||||
key={tile.id}
|
||||
className={`group relative flex flex-col justify-between overflow-hidden bg-slate-950 border border-slate-900/[0.08] shadow-cream-sm hover:shadow-cream-lg transition-all duration-300 hover:-translate-y-1.5 transform-gpu ${tileClasses}`}
|
||||
className={`group relative flex flex-col justify-between overflow-hidden bg-slate-950 border border-slate-900/[0.08] shadow-cream-sm transition-[transform] duration-500 ease-[cubic-bezier(0.16,1,0.3,1)] hover:-translate-y-1.5 transform-gpu will-change-transform ${tileClasses}`}
|
||||
>
|
||||
{/* GPU-composited shadow elevation layer */}
|
||||
<div
|
||||
className="absolute -inset-px rounded-[36px] sm:rounded-[42px] shadow-cream-lg opacity-0 group-hover:opacity-100 transition-opacity duration-700 ease-[cubic-bezier(0.16,1,0.3,1)] pointer-events-none z-30"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
|
||||
{/* Background Image (Covering the squarical tile) */}
|
||||
<img
|
||||
src={tile.imageUrl}
|
||||
alt={tile.name}
|
||||
className="absolute inset-0 w-full h-full object-cover transition-transform duration-500 group-hover:scale-105"
|
||||
className="absolute inset-0 w-full h-full object-cover transition-transform duration-700 ease-[cubic-bezier(0.16,1,0.3,1)] group-hover:scale-105 will-change-transform transform-gpu"
|
||||
loading="lazy"
|
||||
/>
|
||||
|
||||
{/* Vignette Overlay for Readability */}
|
||||
<div className="absolute inset-0 bg-gradient-to-t from-slate-950/90 via-slate-950/30 to-slate-950/20 group-hover:via-slate-950/15 transition-all duration-300 pointer-events-none" />
|
||||
{/* Vignette Overlay for Readability (GPU Opacity) */}
|
||||
<div className="absolute inset-0 bg-gradient-to-t from-slate-950/90 via-slate-950/30 to-slate-950/20 opacity-100 group-hover:opacity-85 transition-opacity duration-500 ease-[cubic-bezier(0.16,1,0.3,1)] pointer-events-none" />
|
||||
|
||||
{/* Top Tile Bar: Badge and Quick-Settings Resize Button */}
|
||||
<div className="relative z-20 flex items-center justify-between p-5">
|
||||
@@ -282,7 +288,7 @@ export function TrendyBentoSection({
|
||||
<button
|
||||
onClick={(e) => toggleTileSize(tile.id, e)}
|
||||
title={tile.isWide ? 'Shrink tile' : 'Expand tile'}
|
||||
className="w-9 h-9 rounded-2xl bg-white/90 hover:bg-white text-slate-800 shadow-md flex items-center justify-center transition-all duration-200 hover:scale-110 active:scale-95"
|
||||
className="w-9 h-9 rounded-2xl bg-white/90 hover:bg-white text-slate-800 shadow-md flex items-center justify-center transition-[transform,background-color] duration-200 ease-[cubic-bezier(0.16,1,0.3,1)] hover:scale-110 active:scale-95"
|
||||
>
|
||||
{tile.isWide ? (
|
||||
<Minimize2 className="w-4 h-4 text-blue-600" />
|
||||
|
||||
Reference in New Issue
Block a user