I tried to use a CSS animation for my navigation buttons on my site.
What it should do: Filling the buttons from the middle to the border. (-45 degrees turned)
What it does: The animation shows a square leaving the border of the button.
.button-container {
padding-top: 20px;
}
.btnNavigator1 {
position: relative;
color: black;
font-size: 14px;
font-family: "montserrat";
text-decoration: none;
margin: 30px 0;
border: 2px solid #f24646;
padding: 14px 60px;
text-transform: uppercase;
overflow: hidden;
transition: 1s all ease;
}
.btnNavigator1::before {
background: #f24646;
content: "";
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: -1;
transition: all 0.6s ease;
width: 100%;
height: 0%;
transform: translate(-50%, -50%) rotate(-45deg);
}
.btnNavigator1:hover::before {
height: 380%;
}
<div class="button-container">
<a href="#" class="btnNavigator1">Home</a>
<a href="#" class="btnNavigator1">Shop</a>
<a href="#" class="btnNavigator1">FAQ</a>
<a href="#" class="btnNavigator1">Contact</a>
</div>
Please excuse me for any mistakes in my question, I am new to this community and I try my best to make my question clear as possible.