Last active
September 22, 2021 14:52
-
-
Save Brlaney/6ebae9aa260c53fb68b52c705aabbc0d to your computer and use it in GitHub Desktop.
Animated svg component using typescript & framer-motion
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
import { motion } from 'framer-motion'; | |
import { | |
mainPathVariant, | |
shapeVariations | |
} from '@/lib/config/animations/svgs/svgs'; | |
const color1 = 'rgba(37, 35, 35, 0.3)'; | |
const color2 = 'rgba(202, 222, 252, 0.7)'; | |
/* | |
animate={{ | |
y: 0, | |
opacity: 1, | |
transition: { duration: 0.8, ease: [0.6, -0.05, 0.01, 0.99] } | |
}} | |
initial={{ y: 60, opacity: 0, }} | |
*/ | |
const Blank = () => { | |
return ( | |
<motion.div | |
className='animationParent' | |
initial='initial' | |
animate='animate' | |
exit={{ opacity: 0 }} | |
> | |
<svg | |
width='350' | |
height='350' | |
viewBox='0 0 350 350' | |
fill='none' | |
xmlns='http://www.w3.org/2000/svg' | |
> | |
<g | |
id='blank' | |
data-name='blank' | |
> | |
{/* motion.path html elements go here */} | |
{/* ...mainPathVariant */} | |
{/* ...shapeVariations */} | |
</g> | |
</svg> | |
</motion.div> | |
) | |
}; | |
export default Blank; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment