Welcome to Day 5 of my Anime.js journey! Today, I dove into advanced animation techniques like SVG animations, dynamic values, motion paths, and integrating Anime.js with other libraries like GSAP and Three.js.
🎯 What I Learned Today
✅ Topics Covered:
- SVG Animations with Anime.js
- Motion Paths and Moving Along Curves
- Dynamic Values and Random Animations
- Integration with GSAP and Three.js
- Animating Custom UI Components like Charts
💡 Concepts with Examples
- SVG Path Drawing Effect
anime({
targets: 'path',
strokeDashoffset: [anime.setDashoffset, 0],
easing: 'easeInOutSine',
duration: 2000,
direction: 'alternate',
loop: true
});
✨ Creates a draw effect on the SVG path!
- Motion Path Animation
const motionPath = anime.path('#curve');
anime({
targets: 'circle',
translateX: motionPath('x'),
translateY: motionPath('y'),
rotate: motionPath('angle'),
duration: 3000,
loop: true,
easing: 'easeInOutQuad'
});
🚗 Animates elements along a custom path.
- Random Bounce with Dynamic Values
anime({
targets: '.dot',
translateY: () => anime.random(-100, 100),
duration: 1000,
direction: 'alternate',
loop: true
});
🔀 Each element gets a random value for its movement.
- Integration with Three.js
anime({
targets: cube.rotation,
y: Math.PI * 2,
duration: 3000,
easing: 'easeInOutSine',
loop: true
});
🌀 Anime.js is used to animate 3D objects like cubes in Three.js.
- Animating Custom UI Components
anime({
targets: '.bar',
height: (el, i) => 50 + i * 30,
delay: anime.stagger(200),
duration: 800,
easing: 'easeOutBounce'
});
📊 Animating a bar chart for a dynamic UI experience.
🔥 Practice Questions
🟢 Basic
- Animate an SVG path to create a "drawn" effect.
- Animate a circle along a custom path using
anime.path()
. - Use
anime.setDashoffset
to animate an SVG path’s stroke.
🟡 Intermediate
- Animate an element’s position using dynamic random values.
- Create a bouncing effect on multiple elements with random values.
- Integrate Anime.js with a basic Three.js scene and animate a 3D object.
🔴 Advanced
- Animate multiple paths in an SVG with staggered animations.
- Create a timeline animation combining GSAP and Anime.js.
- Build an animated graph using SVG, Anime.js, and dynamic values.
- Animate a custom UI component like a progress bar or voting chart.
Got it! Here's the updated and properly formatted section with the changes:
🌅 Mini Project — 3D Cube Animation
A 3D rotating cube animation using Anime.js combined with basic 3D transforms. It showcases how Anime.js can handle rotation on multiple axes — simple yet mesmerizing!
Check out this Pen I made!
🌌 Major Project — Interactive Card Animation Dashboard
For today’s big build, I created an interactive data dashboard featuring card animations. Each card animates on entry using Anime.js with hover effects and delayed sequencing for a smooth UI experience.
✨ Features:
- Smooth card entry animations
- Hover effects using Anime.js
- Delayed reveal sequencing
- Clean UI for showcasing content
Check out this Pen I made!
🧠 What I Gained Today
- Mastered advanced techniques like motion paths and dynamic values
- Integrated Anime.js with Three.js for 3D scene animations
- Built a custom animated UI component for an interactive dashboard
- Learned how to animate complex SVG paths and sequences for smooth interactions
🗣️ Developer Quote of the Day
"Animation is the art of making something stand out by making it move." — Anonymous
👤 Author
Ashish Prajapati
💼 LinkedIn
✍️ Dev.to Blog
💻 GitHub