Made backround animation on login page to its own component
This commit is contained in:
parent
c12e19770e
commit
2921458d82
1 changed files with 24 additions and 0 deletions
24
frontend/src/Components/BackgroundAnimation.tsx
Normal file
24
frontend/src/Components/BackgroundAnimation.tsx
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
import { useEffect } from "react";
|
||||||
|
|
||||||
|
const BackgroundAnimation = (): JSX.Element => {
|
||||||
|
useEffect(() => {
|
||||||
|
const images = [
|
||||||
|
"src/assets/1.jpg",
|
||||||
|
"src/assets/2.jpg",
|
||||||
|
"src/assets/3.jpg",
|
||||||
|
"src/assets/4.jpg",
|
||||||
|
];
|
||||||
|
|
||||||
|
// Pre-load images
|
||||||
|
for (const i of images) {
|
||||||
|
console.log(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Start animation
|
||||||
|
document.body.style.animation = "backgroundTransition 30s infinite";
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return <></>;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default BackgroundAnimation;
|
Loading…
Reference in a new issue