Wee JavaScript program for running animated SVG Keyshape diagrams with step/run/stop buttons and HTML captions.
JavaScript support for stepping through animated SVG diagrams produced by Keyshape.
What you get:
example.com/cat.html
cat.html
)
cat.html
as the payload.
How you get it:
<svg>
or <object>
element with class="ksd"
<div>
or <ol>
) whose children
are captions, one per timeline markerksd.js
or its contents)ksd.css
or its contents)docs.md
examples/
(more to come)src/
<link href="ksd.css" rel="stylesheet" type="text/css" />
<div>
<object class="ksd" data="my-diagram.svg" type="image/svg+xml">
</object>
<ol class="ksd-captions">
<li>
This caption is shown before you press
<em>step</em> or <em>run</em>.
</li>
<li>
This is displayed while the animation runs,
starting from the first timeline marker to
the next one (say, "middle").
</li>
<li>
This caption is shown as the animation
runs from "middle" to "end".
</li>
</ol>
<div class="ksd-no-js">
This content is displayed if JavaScript (and hence
animation) is not supported on this page load.
</div>
</div>
<script src="ksd.js"></script>