I have developed an Angular Component that enhances the look of a photo with styling and animation effects. Now, I want to utilize the same styling for another component without applying the animation.
Styling and Animation for the photo:
.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;
}
However, when I insert the selector tag of this component into the new one, the image displays with the unwanted animation. Is there a way to exclude the animation in the newly created component?
Many have suggested the following solution:
.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;
}
}
However, even after adding the selector tag of this component (
<app-main-pic></app-main-pic>
) into the other component, the animation class 'anime' is still applied to the .pic element, causing the image to animate.
New Component Structure:
<div>
<app-main-pic></app-main-pic>
</div>
<body>
</body>