Skip to content

codedbyMojnu/fm-animation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽญ Framer Motion Animation Playground

An interactive, comprehensive playground for learning and experimenting with Framer Motion animations in React

React Framer Motion Tailwind CSS Vite License

โœจ Overview

Framer Motion Animation Playground is an interactive web application designed to help developers learn, experiment, and master Framer Motion animations. Built with React 19 and modern web technologies, it provides a comprehensive collection of animation examples with real-time controls and live code previews.

๐Ÿš€ Features

๐ŸŽฏ Core Animation Demos

  • Basic Animations - Fundamental motion concepts with customizable duration, scale, and rotation
  • Keyframe Animations - Multi-step animations with dynamic control over scale and rotation values
  • Gesture Animations - Interactive animations triggered by hover, tap, and focus events
  • Drag Animations - Mouse-based element manipulation with drag constraints
  • Smooth Counter - Animated number counting with Framer Motion
  • Scroll Reveal - Scroll-triggered animations using whileInView
  • Stagger Animations - Sequential element animations with staggerChildren

๐ŸŽจ Everyday Animation Components

  • Text Animations - Typing effects, fade transitions, slide animations, and scale effects
  • Icon Animations - Hover effects, rotation, bouncing, and pulse animations
  • Button Animations - Interactive button states with smooth transitions
  • Card Animations - Hover effects, scale transformations, and shadow animations
  • Form Animations - Input field animations, validation feedback, and submission states
  • Loading Animations - Spinners, skeleton loaders, and progress bars
  • Modal Animations - Entrance/exit animations, backdrop effects, and content transitions
  • Navigation Animations - Menu animations, tab transitions, and breadcrumb effects
  • List Animations - Staggered list items, reordering animations, and hover effects
  • Data Visualization - Animated charts, progress bars, and statistical displays

๐ŸŽ›๏ธ Interactive Controls

  • Real-time Parameter Adjustment - Modify animation values on-the-fly
  • Range Sliders - Precise control over duration, delay, scale, and other properties
  • Live Preview - See changes instantly without page refresh
  • Code Snippets - Dynamic code examples that reflect current control values

๐ŸŒ“ Theme System

  • Dark/Light Mode - Automatic theme detection with manual toggle
  • CSS Custom Properties - Consistent theming across all components
  • Responsive Design - Optimized for all device sizes

๐Ÿ› ๏ธ Technology Stack

  • Frontend Framework: React 19.1.1
  • Animation Library: Framer Motion 12.23.12
  • Styling: Tailwind CSS 4.1.11
  • Build Tool: Vite 7.1.1
  • Code Quality: ESLint 9.32.0
  • Package Manager: npm

๐Ÿ“ฆ Installation

Prerequisites

  • Node.js 18+
  • npm 9+

Setup

# Clone the repository
git clone https://github.com/yourusername/framer-motion-playground.git
cd framer-motion-playground

# Install dependencies
npm install

# Start development server
npm run dev

The application will be available at http://localhost:5173 (or the next available port).

๐Ÿ—๏ธ Project Structure

src/
โ”œโ”€โ”€ components/
โ”‚   โ”œโ”€โ”€ demos/           # Core animation demos
โ”‚   โ”‚   โ”œโ”€โ”€ everyday/    # Everyday animation components
โ”‚   โ”‚   โ””โ”€โ”€ ...
โ”‚   โ””โ”€โ”€ ui/             # Reusable UI components
โ”œโ”€โ”€ context/            # React context providers
โ”œโ”€โ”€ data/              # Demo configurations and metadata
โ”œโ”€โ”€ hooks/             # Custom React hooks
โ”œโ”€โ”€ pages/             # Page components
โ””โ”€โ”€ assets/            # Static assets and icons

๐ŸŽฎ Usage

Exploring Animations

  1. Browse Demos: Use the sidebar navigation to explore different animation categories
  2. Interactive Controls: Adjust animation parameters using the real-time control panel
  3. Live Preview: Watch animations update instantly as you modify controls
  4. Code Examples: View dynamic code snippets that reflect your current settings

Learning Path

  1. Start with Basic Animations to understand fundamental concepts
  2. Progress to Keyframe Animations for multi-step sequences
  3. Explore Gesture Animations for user interaction
  4. Dive into Everyday Components for practical use cases
  5. Experiment with Advanced Features like scroll-triggered animations

๐Ÿ”ง Development

Available Scripts

npm run dev      # Start development server
npm run build    # Build for production
npm run preview  # Preview production build
npm run lint     # Run ESLint

Adding New Animations

  1. Create a new component in src/components/demos/ or src/components/demos/everyday/
  2. Add demo configuration to src/data/demos.js
  3. Include controls and default props as needed
  4. Update the demo grid and navigation

Code Style

  • Follow React best practices and hooks patterns
  • Use Framer Motion's declarative animation syntax
  • Implement responsive design with Tailwind CSS
  • Maintain consistent component structure

๐ŸŒŸ Key Framer Motion Concepts Demonstrated

  • Motion Components - motion.div, motion.span, motion.path
  • Animation Props - initial, animate, exit, variants
  • Transitions - duration, ease, delay, staggerChildren
  • Gestures - whileHover, whileTap, whileInView
  • Drag & Drop - drag, dragConstraints, dragElastic
  • Motion Values - useMotionValue, useTransform, useMotionValueEvent
  • Spring Physics - stiffness, damping, mass

๐Ÿ“ฑ Responsive Design

The playground is fully responsive and optimized for:

  • Desktop - Full feature set with sidebar navigation
  • Tablet - Adaptive layout with optimized controls
  • Mobile - Touch-friendly interface with simplified navigation

๐Ÿค Contributing

We welcome contributions! Here's how you can help:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-animation)
  3. Commit your changes (git commit -m 'Add amazing animation')
  4. Push to the branch (git push origin feature/amazing-animation)
  5. Open a Pull Request

Contribution Guidelines

  • Add new animation examples with practical use cases
  • Include proper controls and customization options
  • Maintain consistent code style and documentation
  • Test animations across different devices and browsers

๐Ÿ› Known Issues & Solutions

Spring Animation Keyframes

Issue: Spring animations only support 2 keyframes Solution: Use simple values or switch to ease-based transitions for complex keyframe sequences

MotionValue Rendering

Issue: MotionValue objects cannot be rendered directly as React children Solution: Use useMotionValueEvent to convert MotionValues to state variables

๐Ÿ“š Learning Resources

๐ŸŽฏ Roadmap

  • 3D Animations - Three.js integration for 3D motion
  • Physics Engine - Advanced physics-based animations
  • Animation Presets - Pre-built animation libraries
  • Export Functionality - Generate animation code for other projects
  • Performance Metrics - Animation performance monitoring
  • Accessibility - Enhanced accessibility features for animations

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • Framer Motion Team - For the incredible animation library
  • React Team - For the amazing framework
  • Tailwind CSS Team - For the utility-first CSS framework
  • Vite Team - For the fast build tool
  • Open Source Community - For inspiration and contributions

๐Ÿ“ž Support


Made with โค๏ธ Mojnu

Stars Forks Issues

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages