Comments (7)
Great answer @jzjzjzj, thanks for getting here before I did. @donpinkus, here is the sass styles for the demo on my website.
svg {
path, line {
stroke: #fff;
stroke-width: 2px;
}
path {
fill: transparent;
}
}
I think exporting from illustrator and thinking this is a bug may become common enough that I should add some information in the README about it. I'll do it later today.
from walkway.
It works on your example. Although maybe not as expected.
Simply add attributes stroke-width="3" stroke="#ff0000"
to the path
element to see the animation. You might want to increase duration as well (example).
I would suggest to split the path (example) since walkway uses total length of the path. This way though you need to set fill
attributes explicitly (in callback to draw()
?).
See my commit history for more info.
from walkway.
Just to demonstrate http://codepen.io/connoratherton/pen/ByBJxL
from walkway.
Problem with this splitting approach is we lose transparency on intersections of the compound path. Probably could be partially solved by using masks, but that would be completely different beast of SVG. And automating the splitting (if even possible) imho is out of the walkways scope.
from walkway.
Wow, thanks for the quick and thorough response guys!
It looks awesome after splitting the path.
Out of curiosity, how did you know where to split my path? I only have a bit of experience with SVG, mostly from D3. From looking at the path coordinates, I don't see obvious places where it's an inside path.
Also why the stroke-dasharray: 96.0715713500977px, 96.0715713500977px; stroke-dashoffset: 0px;
line?
from walkway.
@donpinkus Where do you see stroke-dasharray: 96.0715713500977px, 96.0715713500977px; stroke-dashoffset: 0px;
? You don't have to worry about it, those attributes are added and managed by the script.
Regards splitting - I have (had) no experience with SVG before reading your issue, but it is very suspicious that path of initial three examples starts with M
and ends with z
while containing neither of them inbetween. Except your example. Had to try splitting between z
and M
. :) My guess is that there should be a way of making a path to be not compound in Illustrator.
Anyway - more info.
from walkway.
Again, thanks @jzjzjzj, the link to the doc is fantastic. I'll close this in the next few hours.
from walkway.
Related Issues (20)
- Can you make clear the license?
- Use the page visibility api to complete paths when a user navigates away HOT 2
- How can I restart the animation ? HOT 3
- Add a trigger and delay options HOT 4
- Redirect original URL? HOT 1
- Illustrator SVG > Polyline > Wont animate HOT 5
- Website looks empty in Firefox 44.0.2 HOT 3
- Custom easing functions aren't used
- Custom easing functions aren't used HOT 1
- Release? HOT 3
- Show specific frame HOT 15
- In the selector option, do i have to provide the entire svg element, or can i access only one path element inside the svg HOT 2
- feature suggestion: filter elements (draw / redraw) HOT 5
- destroy / cleanup method HOT 8
- add option for complete on visibilitychange HOT 2
- wrong signature for window.requestAnimationFrame shim
- fix https for the website HOT 1
- Scaling feature breaks existing animations
- New release needed HOT 1
- Offset/animation doesn't seem to be calculated properly when using vector-effect on the line HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from walkway.