michalsnik / aos

Animate on scroll library
MIT License
26.54k stars 2.57k forks source link

"data-aos-delay" not working when using animate.css with aos.js and not working with all zoom related animate.css animation. #526

Open skwebs opened 4 years ago

skwebs commented 4 years ago

This is:

Specifications

Expected Behavior

I want to add animation delay with "data-aos-delay" but it not working when I using animate.css while working it fine with default animation (aos.css). And another problem is all zoom related animate.css animation appearing and immediately disappeared while with wow.js it working properly.

Actual Behavior

When I using animate.css with aos.js then data-aos-delay does not work. While with default animation aos.css working it fine. I want aos.js work fine as like wow.js especially with zoom related animate.css animations. I want to use aos.js instead wow.js because wow.js does not support reanimation while aos.js support it but it has some problems with animate.css. So please improve it.

Steps to Reproduce the Problem

I created a codepen on this problem.

  1. "data-aos-delay" not working with animate.css.
  2. zoom related animation of animate.css does not animate as like real animation.

Detailed Description

Codepen links below: AOS with Animate.css not working "data-aos-delay".

AOS default working fine "data-aos-delay" with aos.css.

Possible Solution

SimonFricker commented 4 years ago

Did you find a solution?

You could use this in your main scss file. The key is changing transition-delay to animation-delay. I presume animate.css changed transition's to animation's

[data-aos] {
  visibility: hidden;
}

[data-aos].animated {
  visibility: visible;
  pointer-events: auto;
}

[data-aos] {
  @for $i from 1 through 60 {
    body[data-aos-delay='#{$i * 50}'] &,
    &[data-aos][data-aos-delay='#{$i * 50}'] {
      animation-delay: #{$i * 50}ms;

      &.aos-animate {
        animation-delay: #{$i * 50}ms;
      }
    }
  }
}
aat-antoine commented 1 year ago

It seems there is the same trouble with transition-duration instead of animation-duration

[data-aos] {
  @for $i from 1 through 60 {
    body[data-aos-duration='#{$i * 50}'] &,
    &[data-aos][data-aos-duration='#{$i * 50}'] {
      animation-duration: #{$i * 50}ms;
    }
  }
}

I guess this issue could be handle by the library.