I need to create a button with Submit text. When user clicks on it submit text should transition to top and as it touch button edges it should disappear and other text named Submitted should transition from bottom and show at same place where Submit text was showing. I have tried couple of ways but having issue in achieving this functionality
Css is:
.container {
width:100%;
text-align:center;
margin:30px 0;
font-family:sans-serif;
}
.button {
display:inline-block;
height:60px;
line-height:60px;
position:relative;
text-align:center;
background-color:#16a756;
color:white;
border-radius:2px;
transition:0.3s;
}
.button:hover {background:#19c664;}
/* BUTTON UP */
.label-up {
display:block;
margin:0px 30px;
height:100%;
position:relative;
top:0%;
transition:0.3s;
}
.sb {
color: red;
visibility: hidden;
}
.button:hover .label-up {
top:-100%;
}
.button:hover .sb {
position: relative;
transition:0.3s;
top: -70px;
}
Below is the codepen link. I tried to achieve this on button hover, click event I can manage