mirror of
https://github.com/LCE-Hub/LCE-Emerald-Launcher.git
synced 2026-08-20 04:27:29 +00:00
feat: keep panorama shown
This commit is contained in:
parent
ff1958614c
commit
3adc64bea9
|
|
@ -1,5 +1,5 @@
|
|||
import React, { useEffect, useRef, useState } from "react";
|
||||
import { useUI } from "../../context/LauncherContext";
|
||||
|
||||
|
||||
interface PanoramaProps {
|
||||
profile: string;
|
||||
|
|
@ -7,7 +7,6 @@ interface PanoramaProps {
|
|||
}
|
||||
|
||||
const PanoramaBackground = React.memo(({ profile, isDay }: PanoramaProps) => {
|
||||
const { isWindowVisible } = useUI();
|
||||
const baseId = profile;
|
||||
const profileId = baseId ? baseId : "vanilla_tu19";
|
||||
const isCustomUrl = profile.startsWith("data:") || profile.startsWith("blob:");
|
||||
|
|
@ -54,18 +53,16 @@ const PanoramaBackground = React.memo(({ profile, isDay }: PanoramaProps) => {
|
|||
ref={containerRef}
|
||||
className="absolute inset-0 overflow-hidden pointer-events-none transition-opacity duration-500"
|
||||
>
|
||||
{isWindowVisible && (
|
||||
<div
|
||||
className="absolute top-0 left-0 h-full will-change-transform"
|
||||
style={{
|
||||
width: bgWidth ? `calc(100vw + ${bgWidth}px)` : "200vw",
|
||||
backgroundImage: `url("${currentPanorama}")`,
|
||||
backgroundSize: bgWidth ? `${bgWidth}px 100%` : "auto 100%",
|
||||
backgroundRepeat: "repeat-x",
|
||||
animation: bgWidth ? "panoramaLoop 140s linear infinite" : "none",
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
<div
|
||||
className="absolute top-0 left-0 h-full will-change-transform"
|
||||
style={{
|
||||
width: bgWidth ? `calc(100vw + ${bgWidth}px)` : "200vw",
|
||||
backgroundImage: `url("${currentPanorama}")`,
|
||||
backgroundSize: bgWidth ? `${bgWidth}px 100%` : "auto 100%",
|
||||
backgroundRepeat: "repeat-x",
|
||||
animation: bgWidth ? "panoramaLoop 140s linear infinite" : "none",
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div className="absolute inset-0 bg-black/35 pointer-events-none" />
|
||||
</>
|
||||
|
|
|
|||
Loading…
Reference in a new issue