To get started, let’s look at a case where we have only a single shape that doesn’t animate.
Index
The output is standard, with basic links in the <head>.
The main thing to note in the <body> is this:
flow-artboard
The top-level div is a flow-artboard which has the styles and sizing of the main artboard on the stage.
The main attributes are its position: absolute which puts the artboard at the top-left of the browser window, and overflow: hidden which clips all content that lies outside its view (i.e. Mask to Stage).
red
The next div is called red, which is the name of the layer in the flow file.
This div’s class is flow-layer which is a standard class from which all layers inherit basic styles.
red-svg
All shape layers will have an internal svg with a viewBox sized to the layer’s bounds.
It also contains a <path> element that defines the shape in SVG code.
CSS
The style sheet for the initial layout of the timeline looks like this:
A few things to note:
The red layer is positioned by its mid-point, and offset using a transform to mimic having an anchor point of {0.5, 0.5}
The svg tag has overflow: visible so that it doesn’t clip the edges of its stroke.
The flow-layer defines an animation-duration of 1 second, which is equal to the length of the timeline in Flow.
Animation CSS
For this timeline, there is no code in the animation css file.
Basic Movement
The next timeline moves the shape from left to right.
Try exporting the code for this timeline
After exporting, you’ll notice that the HTML and CSS files are basically the same.
CSS Differences
The only difference to the CSS file is the addition of these two lines:
Animation CSS
The big difference is that the animation CSS file now has some code.
Complex Animation
The third timeline in our document has a more complex animation.
CSS / Index Differences
Even with the addition of keyvalues, the index and css files are identical to the basic movement timeline.
Animation CSS
There are more keyvalues in the animation file now:
Recap
There’s a boatload of ways we could do HTML export, this is just one of them. That said, this mix of CSS3 and SVG/SMIL animations is pretty tight across both Safari and Chrome.
The implementation is light and relatively easy to work with.
P.S. Chrome is better. Way better. At rendering HTML animations. ❤︎