Filling water animation

前端 未结 6 870
小蘑菇
小蘑菇 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:44

    div{
      width: 200px;
      height: 200px;
      background: #ccc;
      border-radius: 50%;
      overflow: hidden;
      position: relative;
      z-index: 9;
    }
    div:before{
      content: '';
      position: absolute; top: 100%; left: 0;
      width: 100%;
      height: 100%;
      background: #00BFFF;  
      -webkit-animation: animtop 5s forwards, animtop2 2s forwards;
      animation: animtop 5s forwards, animtop2 2s forwards;
    }
    @-webkit-keyframes animtop{  
      0%{top: 100%;}  
      75%{top: 0}
    }
    @keyframes animtop{  
      0%{top: 100%;}  
      100%{top: 25%}
    }
    @-webkit-keyframes animtop2{  
      75%{top: 25%;}  
      100%{top: 0}
    }
    @keyframes animtop2{  
      75%{top: 25%;}  
      100%{top: 0}
    }

提交回复
热议问题