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]);
|
}, [interactive]);
|
||||||
|
|
||||||
return (
|
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) => (
|
{room.layers.map((layer, index) => (
|
||||||
<div
|
<div
|
||||||
key={layer.id}
|
key={layer.id}
|
||||||
|
|||||||
@@ -7,12 +7,11 @@ import { CharacterLayerPreview } from "@/components/character/character-layer-pr
|
|||||||
import { ParallaxRoomBackground } from "@/components/pet/parallax-room-background";
|
import { ParallaxRoomBackground } from "@/components/pet/parallax-room-background";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import type { AvatarCustomization } from "@/lib/avatar-customization-storage";
|
import type { AvatarCustomization } from "@/lib/avatar-customization-storage";
|
||||||
import { buildShopItemPreviewCustomization } from "@/lib/shop-preview";
|
|
||||||
import type { ShopItemRecord } from "@/lib/shop-catalog";
|
|
||||||
import {
|
import {
|
||||||
normalizeRoomBackgroundId,
|
buildShopItemPreviewCustomization,
|
||||||
type RoomBackgroundId,
|
getShopPreviewRoomId,
|
||||||
} from "@/lib/room-backgrounds";
|
} from "@/lib/shop-preview";
|
||||||
|
import type { ShopItemRecord } from "@/lib/shop-catalog";
|
||||||
|
|
||||||
type ShopItemPreviewModalProps = {
|
type ShopItemPreviewModalProps = {
|
||||||
item: ShopItemRecord | null;
|
item: ShopItemRecord | null;
|
||||||
@@ -64,9 +63,7 @@ export function ShopItemPreviewModal({
|
|||||||
baseCustomization,
|
baseCustomization,
|
||||||
item,
|
item,
|
||||||
);
|
);
|
||||||
const roomId = normalizeRoomBackgroundId(
|
const roomId = getShopPreviewRoomId(item, baseCustomization);
|
||||||
previewCustomization.roomBackground,
|
|
||||||
) as RoomBackgroundId;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -1,6 +1,21 @@
|
|||||||
import type { AvatarCustomization } from "@/lib/avatar-customization-storage";
|
import type { AvatarCustomization } from "@/lib/avatar-customization-storage";
|
||||||
import { parseVariantId, parseShopStyleItem, type ShopItemRecord } from "@/lib/shop-catalog";
|
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. */
|
/** Build a non-persisted avatar state showing how a shop item would look. */
|
||||||
export function buildShopItemPreviewCustomization(
|
export function buildShopItemPreviewCustomization(
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ export default {
|
|||||||
"./pages/**/*.{js,ts,jsx,tsx,mdx}",
|
"./pages/**/*.{js,ts,jsx,tsx,mdx}",
|
||||||
"./components/**/*.{js,ts,jsx,tsx,mdx}",
|
"./components/**/*.{js,ts,jsx,tsx,mdx}",
|
||||||
"./app/**/*.{js,ts,jsx,tsx,mdx}",
|
"./app/**/*.{js,ts,jsx,tsx,mdx}",
|
||||||
|
"./lib/**/*.{js,ts,jsx,tsx,mdx}",
|
||||||
"./src/**/*.{js,ts,jsx,tsx,mdx}",
|
"./src/**/*.{js,ts,jsx,tsx,mdx}",
|
||||||
],
|
],
|
||||||
theme: {
|
theme: {
|
||||||
|
|||||||
Reference in New Issue
Block a user