feat: keep panorama shown

This commit is contained in:
neoapps-dev
2026-08-18 22:15:14 +03:00
parent ff1958614c
commit 3adc64bea9
+11 -14
View File
@@ -1,5 +1,5 @@
import React, { useEffect, useRef, useState } from "react"; import React, { useEffect, useRef, useState } from "react";
import { useUI } from "../../context/LauncherContext";
interface PanoramaProps { interface PanoramaProps {
profile: string; profile: string;
@@ -7,7 +7,6 @@ interface PanoramaProps {
} }
const PanoramaBackground = React.memo(({ profile, isDay }: PanoramaProps) => { const PanoramaBackground = React.memo(({ profile, isDay }: PanoramaProps) => {
const { isWindowVisible } = useUI();
const baseId = profile; const baseId = profile;
const profileId = baseId ? baseId : "vanilla_tu19"; const profileId = baseId ? baseId : "vanilla_tu19";
const isCustomUrl = profile.startsWith("data:") || profile.startsWith("blob:"); const isCustomUrl = profile.startsWith("data:") || profile.startsWith("blob:");
@@ -54,18 +53,16 @@ const PanoramaBackground = React.memo(({ profile, isDay }: PanoramaProps) => {
ref={containerRef} ref={containerRef}
className="absolute inset-0 overflow-hidden pointer-events-none transition-opacity duration-500" className="absolute inset-0 overflow-hidden pointer-events-none transition-opacity duration-500"
> >
{isWindowVisible && ( <div
<div className="absolute top-0 left-0 h-full will-change-transform"
className="absolute top-0 left-0 h-full will-change-transform" style={{
style={{ width: bgWidth ? `calc(100vw + ${bgWidth}px)` : "200vw",
width: bgWidth ? `calc(100vw + ${bgWidth}px)` : "200vw", backgroundImage: `url("${currentPanorama}")`,
backgroundImage: `url("${currentPanorama}")`, backgroundSize: bgWidth ? `${bgWidth}px 100%` : "auto 100%",
backgroundSize: bgWidth ? `${bgWidth}px 100%` : "auto 100%", backgroundRepeat: "repeat-x",
backgroundRepeat: "repeat-x", animation: bgWidth ? "panoramaLoop 140s linear infinite" : "none",
animation: bgWidth ? "panoramaLoop 140s linear infinite" : "none", }}
}} />
/>
)}
</div> </div>
<div className="absolute inset-0 bg-black/35 pointer-events-none" /> <div className="absolute inset-0 bg-black/35 pointer-events-none" />
</> </>