Any input would be great as I'm just starting to deal with css3 keyframe
animations and transitions. I made a grid and assigned these grid items using grid-template-areas.
.admin-grid {
background: url(../media/rocks.jpg) no-repeat center center fixed;
background-size: cover;
display: grid;
height: 100vh;
background: linear_gradient(black,white);
grid-template-areas: "a a a"
"b c d"
"e e e";
}
.grid-item {
margin: 1rem;
display: grid;
justify-content: center;
align-items: center;
border-radius: 5rem;
color: white;
box-shadow: -3px 5px #a52700;
background: linear-gradient(45deg,rgb(48, 87, 189),black,rgb(180, 59, 59));
animation: load-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 1 forwards;
}
.grid-item:hover {
animation: change_gradient 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) ;
}
And here would be my keyframes.
@keyframes load-in {
0% {
position: relative;
opacity: 0;
padding: 0.5rem;
transform: scale(1);
}
50% {
transform: scale(1.1);
}
100% {
position: relative;
opacity: 1;
transform: scale(1);
padding: 1rem;
}
}
@keyframes change_gradient {
to {
/*not yet finished*/
}
}
Every time I hove over any of my grid items and then remove the cursor from the grid item the load-in animation starts again. I only intend for this animation to happen once on page load. I can't figure out how to make that happen.
In a nutshell: How do I run load-in animation only on page load and not when hover state turns off?