我目前正在尝试制作一个动画扩展球体(圆圈),它只是一个仅使用 css3 应用边框半径的 div。
我设法使动画在 webkit 浏览器上工作,保持动画元素的球形/圆形,但我不知道为什么它在 Firefox 上不起作用。它确实应用了一些边框半径(大约 20 像素),但不像在 webkit 上那样工作。
这是我使用的代码。
@-webkit-keyframes expandSphere
{
0%{padding:10px; opacity: 0;}
25%{height: 150px; border-radius: 150px; width:150px; left:520px; top:200px;}
55%{height: 350px; border-radius: 500px; width:350px; left:420px; top:100px;}
75%{height: 547px; border-radius: 700px; width:700px; top:0; left:250px;}
100%{height:547px; opacity: 1; top:0px; left:0; width:1180px; border-radius: 0;}
}
@-moz-keyframes expandSphere
{
0%{padding:10px; height:20px; width:20px; opacity: 0; -moz-border-radius: 50px;}
25%{height: 150px; width:150px; left:520px; top:200px; -moz-border-radius: 150px;}
55%{height: 350px; width:350px; left:420px; top:100px; -moz-border-radius: 500px;}
75%{height: 547px; width:700px; top:0; left:250px; -moz-border-radius: 700px;}
100%{height:547px; opacity: 1; top:0px; left:0; width:1180px; -moz-border-radius: 0;}
}