Skip to content

Instantly share code, notes, and snippets.

@andrewliebchen
Created April 14, 2017 15:36
Show Gist options
  • Save andrewliebchen/423279a5ed0b346777d440a1dcdd0fd7 to your computer and use it in GitHub Desktop.
Save andrewliebchen/423279a5ed0b346777d440a1dcdd0fd7 to your computer and use it in GitHub Desktop.
Animating donut chart in FramerJS
c =
background: '#f0f0f0'
foreground: 'blue'
start: 10
end: 90
strokeWidth: 10
speed: 50
size: 100
circle = new Layer
size: c.size
borderRadius: c.size * 0.5
clip: true
rotation: -90
backgroundColor: null
html: """
<svg viewBox="0 0 32 32">
<circle
class="circle"
r="16"
cx="16"
cy="16" />
</svg>
"""
style:
'fill': c.background
'stroke': c.foreground
'stroke-width': c.strokeWidth
'stroke-dasharray': "#{c.end} 100"
'animation': "fillup #{c.speed}s linear forwards"
Utils.insertCSS """
@keyframes fillup {
from { stroke-dasharray: #{c.start} 100; }
}
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment