Fix shop room preview showing solid green LCD background.
Include lib/ in Tailwind content so parallax room gradient classes from room-backgrounds.ts are emitted in production CSS.
This commit is contained in:
@@ -47,7 +47,10 @@ export function ParallaxRoomBackground({
|
||||
}, [interactive]);
|
||||
|
||||
return (
|
||||
<div ref={containerRef} className={cn("absolute inset-0 overflow-hidden", className)}>
|
||||
<div
|
||||
ref={containerRef}
|
||||
className={cn("absolute inset-0 z-0 overflow-hidden", className)}
|
||||
>
|
||||
{room.layers.map((layer, index) => (
|
||||
<div
|
||||
key={layer.id}
|
||||
|
||||
@@ -7,12 +7,11 @@ import { CharacterLayerPreview } from "@/components/character/character-layer-pr
|
||||
import { ParallaxRoomBackground } from "@/components/pet/parallax-room-background";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import type { AvatarCustomization } from "@/lib/avatar-customization-storage";
|
||||
import { buildShopItemPreviewCustomization } from "@/lib/shop-preview";
|
||||
import type { ShopItemRecord } from "@/lib/shop-catalog";
|
||||
import {
|
||||
normalizeRoomBackgroundId,
|
||||
type RoomBackgroundId,
|
||||
} from "@/lib/room-backgrounds";
|
||||
buildShopItemPreviewCustomization,
|
||||
getShopPreviewRoomId,
|
||||
} from "@/lib/shop-preview";
|
||||
import type { ShopItemRecord } from "@/lib/shop-catalog";
|
||||
|
||||
type ShopItemPreviewModalProps = {
|
||||
item: ShopItemRecord | null;
|
||||
@@ -64,9 +63,7 @@ export function ShopItemPreviewModal({
|
||||
baseCustomization,
|
||||
item,
|
||||
);
|
||||
const roomId = normalizeRoomBackgroundId(
|
||||
previewCustomization.roomBackground,
|
||||
) as RoomBackgroundId;
|
||||
const roomId = getShopPreviewRoomId(item, baseCustomization);
|
||||
|
||||
return (
|
||||
<div
|
||||
|
||||
@@ -1,6 +1,21 @@
|
||||
import type { AvatarCustomization } from "@/lib/avatar-customization-storage";
|
||||
import { parseVariantId, parseShopStyleItem, type ShopItemRecord } from "@/lib/shop-catalog";
|
||||
import { normalizeRoomBackgroundId } from "@/lib/room-backgrounds";
|
||||
import {
|
||||
normalizeRoomBackgroundId,
|
||||
type RoomBackgroundId,
|
||||
} from "@/lib/room-backgrounds";
|
||||
|
||||
/** Room id shown behind the pet in shop preview (shop item id, not image_path). */
|
||||
export function getShopPreviewRoomId(
|
||||
item: ShopItemRecord,
|
||||
base: AvatarCustomization,
|
||||
): RoomBackgroundId {
|
||||
if (item.type === "room") {
|
||||
return normalizeRoomBackgroundId(item.id);
|
||||
}
|
||||
|
||||
return normalizeRoomBackgroundId(base.roomBackground);
|
||||
}
|
||||
|
||||
/** Build a non-persisted avatar state showing how a shop item would look. */
|
||||
export function buildShopItemPreviewCustomization(
|
||||
|
||||
@@ -7,6 +7,7 @@ export default {
|
||||
"./pages/**/*.{js,ts,jsx,tsx,mdx}",
|
||||
"./components/**/*.{js,ts,jsx,tsx,mdx}",
|
||||
"./app/**/*.{js,ts,jsx,tsx,mdx}",
|
||||
"./lib/**/*.{js,ts,jsx,tsx,mdx}",
|
||||
"./src/**/*.{js,ts,jsx,tsx,mdx}",
|
||||
],
|
||||
theme: {
|
||||
|
||||
Reference in New Issue
Block a user