Stroke animation, how to attach another path to the appearing stroke?

后端 未结 3 592
广开言路
广开言路 2020-12-19 08:01

I have the following animation:

3条回答
  •  醉梦人生
    2020-12-19 08:49

    An idea is to run the animation in the opposite direction while doing a translation

    @keyframes dash {
      to {
        stroke-dasharray: 190;
      }
    }
    
    @keyframes move {
      to {
        transform: translateX(0);
      }
    }
    
    #currency-chart-path {
      stroke-dasharray: 279;
      stroke-dashoffset: 381;
      animation: dash 10s linear forwards;
    }
    
    #Chartline {
      animation: move 10s linear forwards;
      transform: translateX(-200px);
    }
    
    
      
    	
    
    

提交回复
热议问题