I am currently working on a project with two divs that are initially displayed in the center of the screen. When the user clicks on either the left or right button, one of the divs should scale and translate to fill the screen, while the other div smoothly slides off-screen in the opposite direction for a seamless transition. The issue I am facing is that the inactive div does not move along with the active div as it should. Despite the messy code, I have tried multiple solutions but have yet to clean it all up. Both divs should slide simultaneously in response to a button click, with the direction determined by which button was clicked.
Below are the CSS animations being used:
.side-left.ng-hide {
display: block!important;
-webkit-transform: translateX(100%);
transform: translateX(100%);
}
.side-right.ng-hide {
display: block!important;
-webkit-transform: translateX(-100%);
transform: translateX(-100%);
}
Here is the updated file structure:
<div class="section side-left" ng-hide="slide1">
<a ng-click="slide1=!slide1">
<i class="fa fa-chevron-circle-left pull-left"></i>
</a>
</div>
<div class="section side-right" ng-hide="slide2">
<a ng-click="slide2=!slide2">
<i class="fa fa-chevron-circle-right pull-right"></i>
</a>
</div>