From 2921458d82b9dbadf99751297dc2ca05516651ab Mon Sep 17 00:00:00 2001 From: Peter KW Date: Sun, 17 Mar 2024 10:34:15 +0100 Subject: [PATCH] Made backround animation on login page to its own component --- .../src/Components/BackgroundAnimation.tsx | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 frontend/src/Components/BackgroundAnimation.tsx diff --git a/frontend/src/Components/BackgroundAnimation.tsx b/frontend/src/Components/BackgroundAnimation.tsx new file mode 100644 index 0000000..5f402c0 --- /dev/null +++ b/frontend/src/Components/BackgroundAnimation.tsx @@ -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;