jlmakes / scrollreveal

Animate elements as they scroll into view.
https://scrollrevealjs.org/
22.33k stars 2.26k forks source link

Simple way to add class to visible elements #502

Open ghost opened 5 years ago

ghost commented 5 years ago

Hi there,

I saw many feature requests about the possibility to simply add a class to a visible element in order to make CSS animation when the features provided by scrollReveal are too much limited (or you just prefer managing animations using CSS).

All that requests are closed whereas the idea is not rejected, we only have a non official monkey patch for that. Just wonder if it will become a true feature one day, or not.

Thank you for your answer, really like scrollReveal but it will become a necessary feature to me. If you say it will probably come this year, I will wait, if you say that it's not planned, I will try to find another solution for animations.

Thank you

jlmakes commented 5 years ago

Thanks for this @PubliAlex. The short answer is yes, first-class support for this is coming.

Since launch, ScrollReveal has boasted declarative reveal animations with as little as one line of code. I believe this "do one thing and do it well" approach has been essential to its adoption and growth. In the past I’ve aggressively declined feature requests so that:

Although after almost six years and over 500 issues later, I’ve noticed a couple patterns:

If the underlying components that actually make up ScrollReveal were exposed (alongside the classic API), developers would be able to compose their own behavior when needed.

architecture

This of course requires a significant refactor, but I believe is the way forward for ScrollReveal 5.