I have a scenario where I need to display 2 modals (box1 and box2) in my code with box2 appearing on top of box1. Each modal has its own button, and I want to make sure that box1 appears first. Then, when the user clicks the button in box1, it transitions smoothly into box2 while making box1 disappear. I currently have 4 modals in my code, but I will adjust them later. To see this transition in action, please view the full page version. OBS: Please open the code snippet in full page so that the modal shows up
.conteudo {
width: 100%;
height: 100%;
top: 0;
left: 0;
background: rgba(0, 0, 0, 0.5);
position: fixed;
right: 0;
bottom: 0;
display: flex;
justify-content: center;
}
.box, .box2 {
width: 100%;
max-width: 500px;
background: #fff;
position: absolute;
bottom: 0;
height: 400px;
}
.lineButton button {
font-size: 14px;
text-align: center;
border: 2px solid black;
padding: 16px;
border-radius: 16px;
}
<body>
<div class="conteudo">
<div class="box">
<div class="boxes">
<div class="modalTxt">
<h1>MODAL 1 <br>Accept?</h1>
<div class="lineButton">
<button type="submit" class="accept1">Accept</button>
</div>
</div>
</div>
</div>
<div class="box2">
<div class="boxes">
<div class="modalTxt">
<h1>MODAL 2 <br>Accept?</h1>
<div class="lineButton">
<button type="submit" class="accept2">Accept</button>
</div>
</div>
</div>
</div>
</div>
</body>