completionId: cgen-1a67889a975c439a8300417fb0a6f279
cgen-1a67889a975c439a8300417fb0a6f279
This commit is contained in:
parent
e770af2ed0
commit
f545ce3496
1 changed files with 35 additions and 9 deletions
|
|
@ -6,29 +6,49 @@ interface PageTransitionProps {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
const getArmMessage = (pathname: string): string => {
|
const getArmConfig = (
|
||||||
|
pathname: string
|
||||||
|
): { message: string; accentColor: string } => {
|
||||||
if (pathname.includes("/labs") || pathname.includes("/research")) {
|
if (pathname.includes("/labs") || pathname.includes("/research")) {
|
||||||
return "Initializing Research Module...";
|
return {
|
||||||
|
message: "Initializing Research Module...",
|
||||||
|
accentColor: "from-yellow-500 to-yellow-400",
|
||||||
|
};
|
||||||
}
|
}
|
||||||
if (pathname.includes("/game-development")) {
|
if (pathname.includes("/game-development")) {
|
||||||
return "Booting GameForge Engine...";
|
return {
|
||||||
|
message: "Booting GameForge Engine...",
|
||||||
|
accentColor: "from-green-500 to-green-400",
|
||||||
|
};
|
||||||
}
|
}
|
||||||
if (pathname.includes("/consulting")) {
|
if (pathname.includes("/consulting")) {
|
||||||
return "Engaging Corp Systems...";
|
return {
|
||||||
|
message: "Engaging Corp Systems...",
|
||||||
|
accentColor: "from-blue-500 to-blue-400",
|
||||||
|
};
|
||||||
}
|
}
|
||||||
if (pathname.includes("/community")) {
|
if (pathname.includes("/community")) {
|
||||||
return "Connecting Foundation Network...";
|
return {
|
||||||
|
message: "Connecting Foundation Network...",
|
||||||
|
accentColor: "from-red-500 to-red-400",
|
||||||
|
};
|
||||||
}
|
}
|
||||||
if (pathname.includes("/dev-link")) {
|
if (pathname.includes("/dev-link")) {
|
||||||
return "Loading Dev-Link Platform...";
|
return {
|
||||||
|
message: "Loading Dev-Link Platform...",
|
||||||
|
accentColor: "from-cyan-500 to-cyan-400",
|
||||||
|
};
|
||||||
}
|
}
|
||||||
return "Initializing AeThex OS...";
|
return {
|
||||||
|
message: "Initializing AeThex OS...",
|
||||||
|
accentColor: "from-aethex-500 to-neon-blue",
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function PageTransition({ children }: PageTransitionProps) {
|
export default function PageTransition({ children }: PageTransitionProps) {
|
||||||
const [visible, setVisible] = useState(false);
|
const [visible, setVisible] = useState(false);
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const message = getArmMessage(location.pathname);
|
const config = getArmConfig(location.pathname);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setVisible(false);
|
setVisible(false);
|
||||||
|
|
@ -38,7 +58,13 @@ export default function PageTransition({ children }: PageTransitionProps) {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{!visible && <LoadingScreen message={message} variant="overlay" />}
|
{!visible && (
|
||||||
|
<LoadingScreen
|
||||||
|
message={config.message}
|
||||||
|
variant="overlay"
|
||||||
|
accentColor={config.accentColor}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
<div
|
<div
|
||||||
className={`transition-opacity duration-300 ease-out transform-gpu will-change-[opacity] ${visible ? "opacity-100" : "opacity-0"}`}
|
className={`transition-opacity duration-300 ease-out transform-gpu will-change-[opacity] ${visible ? "opacity-100" : "opacity-0"}`}
|
||||||
>
|
>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue