I have created an Angular Component which adds styling and some animation to a photo. I want to use the same photo styling in another component, but I don't want the animation to transfer over to the new component.
Animation on picture:
.pic
{
position: relative;
height: 13em;
width: 12em;
border-radius: 50%;
margin: 2em auto 0em auto;
animation-name: pop;
animation-duration: 1.5s;
animation-delay: 3.5s;
animation-fill-mode: forwards;
opacity: 0;
}
When I create a new component and add the selector tag of this component into the new component, the image is displayed with this animation. Is there a way I can remove this animation in the new component that I created?
A lot of you are suggesting this:
.pic
{
position: relative;
height: 13em;
width: 12em;
border-radius: 50%;
margin: 2em auto 0em auto;
.anime
{
animation-name: pop;
animation-duration: 1.5s;
animation-delay: 3.5s;
animation-fill-mode: forwards;
opacity: 0;
}
}
When i add the selector tag of this component which is <app-main-pic></app-main-pic>
into the other component, that anime class is still present on the .pic, therefore the image will still get animated
New Component:
<div>
<app-main-pic></app-main-pic>
</div>
<body>
</body>