animate.css icon indicating copy to clipboard operation
animate.css copied to clipboard

Animations override opacity settings

Open Kaze9 opened this issue 11 years ago • 2 comments

Hey I apologize if this is an easy one but I setup a fadeIn animation on my top navigation bar and it works fine except I lost the ability to have it be semi-transparent. Is there any way to override this or am I stuck with one or the other.

Kaze9 avatar Apr 12 '15 04:04 Kaze9

As you can see in the CSS file, the fadeIn is simple to edit

@-webkit-keyframes fadeIn {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

@keyframes fadeIn {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

.fadeIn {
  -webkit-animation-name: fadeIn;
  animation-name: fadeIn;
}

better would be another animation for your needs, e.g. for 50% transparency:

@-webkit-keyframes fadeInNavigation {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 0.5;
  }
}

@keyframes fadeInNavigation {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 0.5;
  }
}

.fadeInNavigation {
  -webkit-animation-name: fadeInNavigation;
  animation-name: fadeInNavigation;
}

now you could add fadeInNavigaion as your desired animation

here is a fiddle from it: https://jsfiddle.net/ymc574L4/1/

Sundypha avatar Apr 16 '15 18:04 Sundypha

perfect, thank you so much

On Apr 16, 2015, at 2:50 PM, Sundypha [email protected] wrote:

As you can see in the CSS file, the fadeIn is simple to edit

@-webkit-keyframes fadeIn { 0% { opacity: 0; }

100% { opacity: 1; } }

@keyframes fadeIn { 0% { opacity: 0; }

100% { opacity: 1; } }

.fadeIn { -webkit-animation-name: fadeIn; animation-name: fadeIn; } better would be another animation for your needs, e.g. for 50% transparency:

@-webkit-keyframes fadeInNavigation { 0% { opacity: 0; }

100% { opacity: 0.5; } }

@keyframes fadeInNavigation { 0% { opacity: 0; }

100% { opacity: 0.5; } }

.fadeIn { -webkit-animation-name: fadeInNavigation; animation-name: fadeInNavigation; } now you could add fadeInNavigaion as your desired animation

— Reply to this email directly or view it on GitHub https://github.com/daneden/animate.css/issues/386#issuecomment-93813176.

Kaze9 avatar Apr 20 '15 21:04 Kaze9