Показать сообщение отдельно
  #1 (permalink)  
Старый 20.01.2016, 14:09
Аспирант
Отправить личное сообщение для dima-kruglyak Посмотреть профиль Найти все сообщения от dima-kruglyak
 
Регистрация: 20.01.2016
Сообщений: 39

Запуск SVG отрисовки при скролле
Помоги пожалуйста, как запустить SVG отрисовку при скролле:

<svg width="450px" height="160px">
<text class="anim-1" x="0" y="158px" font-size="200px" stroke="#222121" stroke-width="1" fill-opacity="0">WEB</text>
</svg>
<svg width="300px" height="20px">
<line class="anim-2" fill-opacity="0" stroke="#000" stroke-width="1" x1="20" x2="300" y1="18" y2="18"/>
</svg>

и сss

.anim-1 {
stroke-dasharray: 1000;
stroke-dashoffset: 1000;
animation: dash 2.5s linear alternate forwards ;
}

@keyframes dash {
0% {
stroke-dashoffset: 1000;
}

90% {
fill-opacity: 0;
}

100% {
stroke-dashoffset: 0;
fill-opacity: 1;
}
}

.anim-2 {
stroke-dasharray: 1000;
stroke-dashoffset: 1000;
animation: dash2 4.5s linear alternate forwards ;
}

@keyframes dash2 {
0% {
fill-opacity: 0;
}

50% {
fill-opacity: 0;
stroke-dashoffset: 1000;
}

100% {
stroke-dashoffset: 0;
fill-opacity: 1;
}
}
Ответить с цитированием