From a953517c10bb0ec9b12f5f3e1cc1ad356ce18515 Mon Sep 17 00:00:00 2001 From: John Costa Date: Mon, 3 Jan 2022 01:06:40 +0000 Subject: [PATCH] Added frontend wave and FadeComponent --- src/components/core/FadeComponent.js | 33 ++++++++++++ src/components/pages/Front.page.js | 78 +++++++++++++++++----------- 2 files changed, 82 insertions(+), 29 deletions(-) create mode 100644 src/components/core/FadeComponent.js diff --git a/src/components/core/FadeComponent.js b/src/components/core/FadeComponent.js new file mode 100644 index 0000000..85eb5e2 --- /dev/null +++ b/src/components/core/FadeComponent.js @@ -0,0 +1,33 @@ +//============================================================ +// Essential Imports +//============================================================ + +import clsx from 'clsx'; +import React, { useEffect, useState } from 'react'; + +//============================================================ +// Component +//============================================================ + +const FadeComponent = ({ delay, children }) => { + const [showComponent, setShowComponent] = useState('opacity-0'); + + useEffect(() => { + const timer = setTimeout(() => { + setShowComponent('opacity-100'); + }, delay); + + return () => { + clearTimeout(timer); + }; + }, []); + + return ( +
+
+ {children} +
+
+ ); +}; +export default FadeComponent; diff --git a/src/components/pages/Front.page.js b/src/components/pages/Front.page.js index a2a5814..90f2c76 100644 --- a/src/components/pages/Front.page.js +++ b/src/components/pages/Front.page.js @@ -10,6 +10,7 @@ import React from 'react'; import AppearText from '../text/AppearText'; import Cdiv from '../core/Cdiv'; +import FadeComponent from '../core/FadeComponent'; //============================================================ // Component @@ -17,39 +18,58 @@ import Cdiv from '../core/Cdiv'; const FrontPage = () => { return ( -
- - - - - - - - - - + <> +
+ + + + + + + + + + + - -
-
- - +
+
+ + +
+ + + + +
-
+ + ); }; export default FrontPage;