This repository contains code for implementing a text reveal animation using React and Framer Motion library. The animation gradually reveals each character of the text, creating an elegant effect that enhances the visual appeal of textual content.
To use this animation in your project, follow these steps:
- Clone the repository or copy the necessary files into your project directory.
- Make sure you have React and Framer Motion library installed in your project. If not, you can install them using npm or yarn:
npm install react framer-motion
or
yarn add react framer-motion
npm run dev
or
yarn dev
To implement the text reveal animation in your React project:
- Import the motion component from Framer Motion library.
- Define your text content (heading, paragraph, etc.).
- Split the text into individual characters using the provided splitTextUsingRegex utility function.
- Define animation variants for revealing the text characters.
- Use the motion component to animate each character individually.
- Adjust animation properties such as duration, stagger, etc., according to your preference.
- Customize the styles as needed.