Filling water animation

前端 未结 6 866
小蘑菇
小蘑菇 2020-11-30 21:06

I am trying to get a wipe up animation to make a circle look like it\'s filling with water. I\'ve run into two errors, and haven\'t been able to even tackle

6条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-30 21:48

    I think this accomplishes your first goal:

    #banner div:nth-child(2) {
      -webkit-animation: wipe 6s;
      -webkit-animation-delay: 0s;
      -webkit-animation-direction: up;
      -webkit-mask-size: 300px 3000px;
      -webkit-mask-position: 300px 300px;
      -webkit-mask-image: -webkit-gradient(linear, left bottom, left top,
        color-stop(0.00,  rgba(0,0,0,0)),
        color-stop(0.25,  rgba(0,0,0,0)),
        color-stop(0.27,  rgba(0,0,0,0)),
        color-stop(0.80,  rgba(0,0,0,1)),
        color-stop(1.00,  rgba(0,0,0,1)));
     }
    
     @-webkit-keyframes wipe {
         0% {
        -webkit-mask-position: 300px 300px;
      }
         100% {
        -webkit-mask-position: 0 0;
      }
    }
    

提交回复
热议问题