Portfolio
  • 01Home
  • 02Projects
  • 03About
  • 04Skills
  • 05Lab
  • 06Writing
  • 07Contact

© 2026 Hamza Syrage

LabView all
Arrow FieldCursorCursor SpotlightCursorGooey CursorCursorImage CompareMediaInteractive ChartDataMagnetic ButtonInteractionMarquee RevealTypographyMorphing ShapeAnimationsNested ViewsOverlaysOdometer CounterDataParticle ConstellationCanvasRipple ClickButtonsScroll RevealScrollShuffle GridLayoutStep WizardNavigationTabsNavigationTilt CardCards

UI Experiments

All Lab Entries
Cards

Tilt Card

A card that tilts in 3D with glare and hue shift following the cursor.

A card that tilts toward the cursor in 3D, with a glare highlight and holographic hue shift layered on top. The cursor position is normalized to a 0-1 range, then mapped to rotation angles via useTransform and smoothed with springs.

#Step 1: Card tilt

Normalize the cursor position to a 0-1 range across the element's dimensions with (e.clientX - rect.left) / rect.width. This makes the effect scale-independent. Then use useTransform to map that 0-1 value to rotation angles, wrapped in a spring for weight.

A perspective: 800px container and transformStyle: preserve-3d on the card are what make the tilt visible in 3D. The text layer sits on a translateZ(40px) plane, so it lifts off the card surface as it tilts.

The inversion, py maps to rotateX and px to rotateY, is intentional. Moving the cursor up tilts the top of the card toward you, which is the natural physical response.

LabTilt Card
tsx
Loading...

#Step 2: Glare and hue

Two effects layered on top of the tilt, both derived from the same normalized motion values. The glare is a radial-gradient positioned at the cursor's coordinates, composited with mix-blend-overlay. The hue shift is a hue-rotate that varies from negative to positive across the card width, creating the holographic foil look.

useMotionTemplate is the correct way to inject motion values into CSS strings. Plain template literals resolve the motion value once and never update; useMotionTemplate recomputes the string on every frame.

LabHolo Card
tsx
Loading...

#Configuration

Tilt range, glare intensity, hue shift amount, and spring physics are all tunable.

LabHolo Card
All parameters
Tilt12deg
Glare0.35
Hue shift30deg
Spring physics
Stiffness200
Damping20
Mass1
tsx
Loading...