Scale landing pet preview for small viewports.

ResizeObserver on the landing LCD drives pet sprite scale while capping LCD height so the hero preview stays proportional on mobile.
This commit is contained in:
2026-05-24 05:15:37 -06:00
parent 0b309fbc24
commit 2b76e7f34c
4 changed files with 62 additions and 6 deletions

View File

@@ -13,6 +13,7 @@ import { cn } from "@/lib/utils";
type AnimatedPetSpriteProps = {
customization: AvatarCustomization;
className?: string;
petScale?: number;
};
type WanderPosition = {
@@ -52,6 +53,7 @@ function randomPosition(current?: WanderPosition): WanderPosition {
export function AnimatedPetSprite({
customization,
className,
petScale = 7,
}: AnimatedPetSpriteProps) {
const [position, setPosition] = useState<WanderPosition>({
x: PET_WANDER_START.x,
@@ -98,7 +100,7 @@ export function AnimatedPetSprite({
colors={customization.colors}
variants={customization.variants}
equippedItems={customization.equippedItems}
scale={7}
scale={petScale}
compact
className="!h-auto max-h-none"
/>