mirror of
https://github.com/LCE-Hub/LCE-Emerald-Launcher.git
synced 2026-09-24 17:11:00 +00:00
feat: keep panorama shown
This commit is contained in:
@@ -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" />
|
||||||
</>
|
</>
|
||||||
|
|||||||
Reference in New Issue
Block a user