DEV Community

Ashish prajapati
Ashish prajapati

Posted on

# 🎯 Anime.js Learning β€” Day 2

Author: Ashish Prajapati

GitHub: Anticoder03/animejs_learning

LinkedIn: Ashish Prajapati


πŸ“Œ Topics Covered (Stage 2 - Core Properties & Parameters)

Today I dove deep into Anime.js's core animation properties and learned how to control the behavior of animations with various options. Here's a summary of what I explored:

βœ… Core Animation Properties

  • translateX, translateY β€” Move elements along X and Y axis.
  • scale β€” Shrink or grow elements.
  • rotate β€” Rotate elements.
  • opacity, backgroundColor β€” Fade in/out and color change.

βš™οΈ Control Parameters

  • duration β€” How long the animation lasts.
  • delay β€” Delay before starting.
  • easing β€” Smoothness or style of the animation curve.
  • loop, direction β€” Loop the animation or play it alternate.
  • autoplay: false β€” Allow manual control and trigger via events.

πŸ’‘ What I Practiced

I applied all of the above concepts in small, creative experiments:

  1. Scroll-triggered Animations using IntersectionObserver
  2. Combine Translate + Rotate + Scale + Opacity
  3. Sequential Button Effects using Anime.js timeline()
  4. Hover-based Button Effects
  5. Fading and bouncing animations
  6. Controlled animations on click using autoplay: false
  7. Looping animations with glow effects
  8. Easing combinations to create smooth transitions
  9. Animated entrance for sections/cards
  10. Animation triggered only once on scroll

πŸ”¨ Mini Project of the Day

I created a morphing loader animation using timeline and scale effects.

πŸ“Œ Check out this Pen I made!


πŸŒ€ Scroll-Based Section Animation

This experiment brings in each .section with a smooth scroll effect β€” combining translateY, scale, rotate, and opacity:

πŸ“Œ Check out this Pen I made!


🧠 What I Learned Today

  • How to use IntersectionObserver with Anime.js.
  • Creating timed sequences with anime.timeline().
  • Triggering animations only when needed (e.g., on scroll or click).
  • Building interactive UI elements like buttons and sections with polished animation feedback.
  • Mastery over core animation options and their real-world applications.

πŸš€ Up Next: Day 3 Goals

  • Dive into staggering animations for multiple elements.
  • Explore anime.set() and anime.remove().
  • Try animating SVG paths and stroke drawing.

Thanks for following along!

Let's keep the animation magic alive! ✨

#MyDaysOfAnimeJS #DevTo #WebDev #AnimeJS

Top comments (0)