Use @keyframes of css with angular 5.2.6

Asked

Viewed 101 times

0

I’m migrating a project and it had some animations. The same goes for animations in css with @keyframes, but putting directly into the component’s css and viewing the generated page from the angular does not work. I took a look at the animations part https://angular.io/guide/animations But I didn’t understand much. This is an example code that I’m trying to migrate to the angular.

p{
text-align:center;
font-size: 1.5em;
}

@keyframes pular {
  0% { transform: scale(1); }
  40% { transform: scale(1.10); }
  50% { transform: scale(1); }
  60% { transform: scale(1.10); }
  70% { transform: scale(1); }
}

.pulso {
  animation-name: pular;
  animation-duration: 1000ms;
  animation-iteration-count: infinite;
  animation-timing-function: linear;
}
<p class="pulso"> teste <P>

`

  • I do not understand your problem! See working on stackblitz.

  • Strange the component is not running on the original project. I will post part of the code tomorrow as soon as I get to work

  • I tested and really the text works. Now it is used in an icon component can not do. In the original project works now at angular does not. I created a new example Component with the text and icon and it did not work. This is the code that actually works but not for the icon. I created a new module and it worked. But then, I decided to use for the same icon was in the project and it didn’t work. <p class="pulse"> keyframes Works! </p> <span class="mbri-desktop pulse"></span> I’m using mobiriseicons

  • I tested with another Foundation icons library and even after rendering the <i> tag does not allow manipulation with the Transform property. But that’s only at the angle. I don’t know why.

  • I even made in Component the animation and image works even using the keyframe for the states but, in the tag <span>(mobiriseicons) or <i>(foundationicons) even suffers change.

  • Why don’t you put it inside the tag p ? <p class="pulso"> <i class="fi-book"></i> teste <p> can see working on stackblitz.

  • Thank you so much for the tip. Thanks for the help. Really will solve. Thanks again wmsouza

Show 2 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.