I'm toying around with CSS animations for fun. My limited experience is getting in the way.
The script below transforms a circle to triangle to an square and reverses. The animation between circle and triangle however has a slight bug. I expect it has something to do with the border but I can't seem to fix it. (I have no background in programming..:))
Could someone give me a push in the right direction?
.triangle {
display: inline-block;
width: 0;
height: 0;
border-style: solid;
border-color: transparent;
animation-name: testframe;
animation-duration: 4s;
animation-iteration-count: infinite;
animation-direction: alternate;
}
@keyframes testframe {
/*circle*/
0% {
width: 100px;
height: 100px;
background-color: #6980fe;
border-radius: 50%;
}
/*trianle*/
50% {
width: 0;
height: 0;
border: 0 solid transparent;
border-right-width: 50px;
border-left-width: 50px;
border-bottom: 100px solid #6980fe;
background-color: transparent;
}
/*square*/
100% {
width: 100px;
height: 100px;
background-color: #6980fe;
}
}