Frontendx
README.md
SOLUTION.md
main.tsxentry
App.tsx
App.css
index.html
vite.config.ts
Installed
react@^19.2.0
react-dom@^19.2.0

Preview Zoomed Image on Hover

Prompt

Replicate Amazon's product image zoom: hovering over a product image shows a magnified version in a separate preview pane. The zoomed area follows the cursor position. Calculate cursor position relative to image and map it to CSS background-position of the zoomed preview.

Track mouse position with onMouseMove. Calculate xPercent = (e.nativeEvent.offsetX
Test Results

Preview Zoomed Image on Hover

Replicate Amazon's product image zoom: hovering over a product image shows a magnified version in a separate preview pane. The zoomed area follows the cursor position. Calculate cursor position relative to image and map it to CSS background-position of the zoomed preview.