Skip to content

Instantly share code, notes, and snippets.

@antonkartashov
Last active October 26, 2015 21:52
Show Gist options
  • Save antonkartashov/f357c902b59b1c643600 to your computer and use it in GitHub Desktop.
Save antonkartashov/f357c902b59b1c643600 to your computer and use it in GitHub Desktop.
# Add this line to .framer index.html:
# <script src="http://snapsvg.io/assets/js/snap.svg-min.js"></script>
background = new BackgroundLayer
diameter = Screen.width
radius = Screen.width / 2
svglayer = new Layer
width: diameter, height: diameter
y: Screen.height / 2 - radius
backgroundColor: "transparent"
html: "<svg id='svgid' width='#{diameter}' height='#{diameter}'></svg>"
$ = Snap("#svgid")
sector = $.paper.path (
"M #{radius}, #{radius}" +
"L #{radius}, 0" +
"A #{radius}, #{radius} 0 1, 1 #{0}, #{radius}"
)
sector.attr("fill", "#ee4433")
background.on "click", ->
sector.animate {d:
"M #{radius}, #{radius}" +
"L #{radius}, 0 " +
"A #{radius}, #{radius} 0 0, 1 #{diameter}, #{radius}"
}, 2000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment