diff --git a/frontend/next-env.d.ts b/frontend/next-env.d.ts index 254b73c..00a8785 100644 --- a/frontend/next-env.d.ts +++ b/frontend/next-env.d.ts @@ -1,6 +1,6 @@ /// /// -/// +/// // NOTE: This file should not be edited // see https://nextjs.org/docs/pages/api-reference/config/typescript for more information. diff --git a/frontend/src/components/Constructor/CanvasBackground.tsx b/frontend/src/components/Constructor/CanvasBackground.tsx index 98e662b..d223d44 100644 --- a/frontend/src/components/Constructor/CanvasBackground.tsx +++ b/frontend/src/components/Constructor/CanvasBackground.tsx @@ -15,8 +15,10 @@ interface CanvasBackgroundProps { backgroundVideoUrl?: string; backgroundAudioUrl?: string; previousBgImageUrl?: string; + previousBgVideoUrl?: string; isSwitching?: boolean; isNewBgReady?: boolean; + isFadingIn?: boolean; onBackgroundReady?: () => void; // Video playback settings videoAutoplay?: boolean; @@ -31,8 +33,10 @@ const CanvasBackground: React.FC = ({ backgroundVideoUrl, backgroundAudioUrl, previousBgImageUrl, + previousBgVideoUrl, isSwitching = false, isNewBgReady = false, + isFadingIn = false, onBackgroundReady, videoAutoplay = true, videoLoop = true, @@ -94,10 +98,12 @@ const CanvasBackground: React.FC = ({ )} - {/* Previous background overlay - shows during page switch until new bg is ready */} - {previousBgImageUrl && isSwitching && !isNewBgReady && ( + {/* Previous background overlays - show during loading AND crossfade. + Uses CSS animation for fade-out effect during crossfade. + z-0 keeps them BELOW new backgrounds (z-1). */} + {previousBgImageUrl && (isFadingIn || (isSwitching && !isNewBgReady)) && (
= ({ }} /> )} + {previousBgVideoUrl && (isFadingIn || (isSwitching && !isNewBgReady)) && ( +