 
      
    IT-образование
- 1 ответ
- 0 вопросов
    1
    Вклад в тег
    
      
      
    
  
  
 
  
   
  
  <svg class="icon">:.icon path {
  stroke-dasharray: 123123;
  stroke-dashoffset: 123123;
  animation: draw forwards;
}
@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}const path = Array.from(document.querySelectorAll(".icon path"));
let length = 0;
const ls = path.map(p => {
  length = p.getTotalLength();
  p.style.strokeDasharray = length;
  p.style.strokeDashoffset = length;
  return length;
});