-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #365 from Jagpreet153/main
Added preloader
- Loading branch information
Showing
6 changed files
with
64 additions
and
2 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.pre{ | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
position: absolute; | ||
top: 37%; | ||
left: 47%; | ||
width: 10vw; | ||
height: 10vh; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import React,{useEffect,useState} from "react"; | ||
import pre from '../../assets/pre.json'; | ||
import './Preloader.css' | ||
import Lottie from 'lottie-react'; | ||
import App from '../../App'; | ||
export default function Preloader() { | ||
const [loading,setLoading]=useState(false); | ||
useEffect(()=>{ | ||
setLoading(true); | ||
setTimeout(() =>{ | ||
setLoading(false) | ||
},2000) | ||
},[]) | ||
return ( | ||
<div> | ||
{ | ||
loading ? | ||
<div> | ||
<div className='pre'> | ||
<div className="preloader"><Lottie animationData={pre}/></div> | ||
</div> | ||
</div> | ||
: | ||
//Rest Code | ||
<App/> | ||
} | ||
|
||
</div> | ||
) | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters