My goal is to create an interactive animation that reveals a specific section when a user clicks on an element. Initially, this section is hidden from view using the translateY(-700px) property. However, I have noticed that applying a transition effect to the margin-bottom property has resulted in a decrease in frames per second (FPS) during the animation.
Now I'm left wondering: Is there a way to animate this section without causing any visible blank space when it's hidden?
Below is the SASS code for the section:
.section {
padding: 50px 0 20px 0;
background-color: black;
display: block;
box-shadow: 0 4px 15px 0 rgba(0, 0, 0, 0.05);
transform: translateY(-700px);
transition: transform 1s;
&._active {
transform: translate(0, 0);
margin-bottom: 0;
}
}