feat: add animation to LoginPage
This commit is contained in:
@@ -1,12 +1,32 @@
|
||||
// Copyright.jsx
|
||||
import React from "react";
|
||||
import React, { useState, useEffect } from "react";
|
||||
|
||||
export default function Copyright({ isLoginPage }) {
|
||||
const [isCentered, setIsCentered] = useState(true);
|
||||
|
||||
useEffect(() => {
|
||||
if (isLoginPage) {
|
||||
// On login page, start centered then transition to bottom
|
||||
const timer = setTimeout(() => {
|
||||
setIsCentered(false);
|
||||
}, 1000);
|
||||
return () => clearTimeout(timer);
|
||||
} else {
|
||||
// Not on login page, go to bottom immediately
|
||||
setIsCentered(false);
|
||||
}
|
||||
}, [isLoginPage]);
|
||||
|
||||
export default function Copyright() {
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
textAlign: "center",
|
||||
marginTop: "1rem",
|
||||
transition: "all 0.8s ease-in-out",
|
||||
position: "fixed",
|
||||
top: isCentered ? "65%" : "90%",
|
||||
left: "50%",
|
||||
transform: "translate(-50%, -50%)",
|
||||
}}
|
||||
>
|
||||
<p>
|
||||
|
Reference in New Issue
Block a user