Use shop SVG assets for paid room previews so thumbnail and LCD match.
ParallaxRoomBackground renders sceneImage with pixelated cover for room-night and room-forest instead of mismatched CSS layers.
This commit is contained in:
@@ -14,6 +14,8 @@ type ParallaxRoomBackgroundProps = {
|
||||
interactive?: boolean;
|
||||
};
|
||||
|
||||
const SCENE_IMAGE_PARALLAX_SPEED = 0.15;
|
||||
|
||||
export function ParallaxRoomBackground({
|
||||
roomId,
|
||||
className,
|
||||
@@ -46,6 +48,27 @@ export function ParallaxRoomBackground({
|
||||
};
|
||||
}, [interactive]);
|
||||
|
||||
if (room.sceneImage) {
|
||||
return (
|
||||
<div
|
||||
ref={containerRef}
|
||||
className={cn("absolute inset-0 z-0 overflow-hidden", className)}
|
||||
>
|
||||
{/* eslint-disable-next-line @next/next/no-img-element */}
|
||||
<img
|
||||
src={room.sceneImage}
|
||||
alt=""
|
||||
aria-hidden
|
||||
className="absolute inset-[-8%] size-[116%] max-w-none object-cover image-pixelated"
|
||||
style={{
|
||||
transform: `translate3d(${offset.x * SCENE_IMAGE_PARALLAX_SPEED * 10}px, ${offset.y * SCENE_IMAGE_PARALLAX_SPEED * 8}px, 0)`,
|
||||
transition: "transform 0.15s steps(4)",
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
ref={containerRef}
|
||||
|
||||
Reference in New Issue
Block a user