SVG animation on path like the snail

前端 未结 2 1847
情书的邮戳
情书的邮戳 2021-01-23 20:46

I have the following SVG and I would like to draw the circles pixel by pixel on the path after moveing. It\'s like when the snail goes he let a streak behind him. So my question

2条回答
  •  春和景丽
    2021-01-23 21:22

    You can do something like this for an instance:

    .path {
      stroke-dasharray: 1230;
      stroke-dashoffset: 1230;
      animation: snail 6s linear forwards;
    }
    
    @keyframes snail {
      to {
        stroke-dashoffset: 0;
      }
    }
        
            
            
                
                    
                
            
        

提交回复
热议问题