This project is a Framer Motion tutorial aimed at helping developers improve their animation skills in React. It covers basic and advanced animation techniques, including gestures, animation controls, view-based animations, and scroll-based animations.
- React - For building the UI components
- Framer Motion - For animations and transitions
project-root/
│-- src/
│ ├── components/
│ │ ├── BasicsOfMotion.js
│ │ ├── Gestures.js
│ │ ├── AnimationControls.js
│ │ ├── ViewBasedAnimation.js
│ │ ├── ScrollAnimation.js
│ ├── App.js
│ ├── index.css
│ ├── index.js
│-- package.json
│-- README.md
- Basics of Motion - Learn how to create simple animations with Framer Motion.
- Gestures - Implement hover, tap, and drag gestures.
- Animation Controls - Control animations dynamically with custom triggers.
- View-Based Animations - Trigger animations based on viewport visibility.
- Scroll Animations - Animate elements based on scroll progress.
git clone https://github.com/SteeveSticks/FRAMER-MOTION-TUTORIAL.git
cd framer-motion-tutorial
npm install
# or
yarn install
npm start
# or
yarn start
Open src/App.js
and uncomment the animation components you want to test.
For example, to enable gesture animations, update App.js
like this:
import Gestures from "./components/Gestures";
<Gestures />;
Inside BasicsOfMotion.js
, you can animate an element like this:
import { motion } from "framer-motion";
const BasicsOfMotion = () => {
return (
<motion.div animate={{ x: 100 }} transition={{ duration: 0.5 }}>
Move me!
</motion.div>
);
};
export default BasicsOfMotion;
- This tutorial does not have a deployed link yet.
- The animations are modularized in separate components for easy understanding.
Feel free to fork this project and enhance it! PRs are welcome.
This project is open-source under the MIT License.
🔗 Follow for more tutorials! 🚀