1
I created a vector in Illustrator and saved it in .svg
- this is the present and future of images.
And I got the code on svg
of the picture and put on the website.
I want to make an animation with this image, an animation like in this example:
http://prinzhorn.github.io/skrollr/examples/path.html
Where the image already exists, but it is drawn while I make a scroll
on the page. I already have the skrollr.js
in my code, I use in other objects. But in this case svg
I’m not getting through.
Nor need be this plugin, I’m only interested in the effect of drawing being done gradually instead of appearing the image altogether.
If you didn’t understand it very well, I’ll explain it in a better way.
I’m almost able to do the auto drawing, but at a certain point in the animation, the drawing goes back. The animation makes the contour, but when it’s over the contour returns. I haven’t caught the deal yet. SVG
is something new to me.
svg{
display: block;
vertical-align: bottom;
height: auto;
width: 100%;
.path {
fill-opacity: 0;
stroke: #133754;
fill: #133754;
stroke-width: 1;
stroke-dasharray: 0 1014;
stroke-dashoffset: 1014;
animation: draw 10s forwards linear;
}
}
@keyframes draw {
98%{
stroke-dashoffset: 0;
stroke-dasharray: 1014 0;
fill-opacity: 0;
}
100%{
fill-opacity: 1;
}
}
I did it in a different way now. I updated the above code according to some I saw on the internet, however, I don’t understand its syntax.
stroke-dashoffset: 0;
stroke-dasharray: 1014 0;
I don’t know what values mean.