-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2339622
commit fd1fbd7
Showing
4 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
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,36 @@ | ||
import React, { useState, useEffect } from 'react'; | ||
import { motion } from 'framer-motion'; | ||
|
||
const PreLoader: React.FC = () => { | ||
const [isWhite, setIsWhite] = useState<boolean>(true); | ||
|
||
useEffect(() => { | ||
const interval = setInterval(() => { | ||
setIsWhite((prev) => !prev); | ||
}, 500); | ||
|
||
return () => clearInterval(interval); | ||
}, []); | ||
|
||
return ( | ||
<motion.div | ||
animate={{ | ||
color: isWhite ? 'black' : 'white', | ||
backgroundColor: isWhite ? 'white' : 'black', | ||
}} | ||
transition={{ type: 'spring', stiffness: 15 }} | ||
className="w-full h-svh overflow-hidden flex justify-center items-center transition ease-out duration-500" | ||
> | ||
<motion.div | ||
initial={{ scale: 3 }} | ||
animate={{ scale: 1 }} | ||
transition={{ duration: 1.8, delay: 0.1, type: 'spring', stiffness: 30 }} | ||
className="xl:text-5xl text-xl sm:text-2xl md:text-3xl lg:text-6xl uppercase font-extrabold font-sans" | ||
> | ||
<p>Welcome to StyleShare</p> | ||
</motion.div> | ||
</motion.div> | ||
); | ||
}; | ||
|
||
export default PreLoader; |
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