let logIn = document.querySelector('.login-content-signin');
let signUp = document.querySelector('.login-content-signup');
document.querySelectorAll('.buy').forEach((item,index)=>{
item.addEventListener('click', () => {
if(index == 1){
logIn.style.opacity="0";
logIn.style.zIndex="-1";
signUp.style.opacity="1";
signUp.style.zIndex="1";
}else{
logIn.style.opacity="1";
logIn.style.zIndex="1";
signUp.style.opacity="0";
signUp.style.zIndex="-1";
}
})
})
<button class="buy"ng-click="showSignIn=false">Login</button>
<button class="buy"ng-click="showSignIn=true">Sign Up</button>