CSS3 动画在屏幕中间暂停



基本上这是一个球。这个球是从左到右来的。我希望球在到达屏幕中间时暂停,3 秒后它应该会逐渐淡出我该怎么做?

div.new-goal {
    position:absolute;
    margin-top: 30px;
    background-color: transparent;
    text-align:center;
    -webkit-animation: movein 1.0s ease-out 0s 1, moveout 2.1s ease-in 1s 1;
    -webkit-animation-fill-mode: forwards;
    white-space: nowrap;
    color: $green2;
}

ps:是萨斯

HTML

<div id="ball"></div>

.CSS

body {
    margin: 0;
    padding: 0;
}
#ball {
    width: 50px;
    height: 50px;
    background: green;
    border-radius: 50%;
    position: absolute;
    left: -50px;
    -webkit-animation: move 8s;
    -webkit-animation-fill-mode: forwards;
}
@-webkit-keyframes move
{ /* 
    8s : 100% = 3s : x 
    x = 37.5%
    */
    37.5% {
        left: calc(50% - 25px); opacity: 1;
    }
    75% {
        left: calc(50% - 25px); opacity: 1;
    }
    85% {
        left: 80%; opacity: 0;
    }
    100% {
        opacity: 0;
    }
}

http://jsfiddle.net/8B9Lx/3/

最新更新