Top Banner
How to Animate SVG's with Snap.svg JS Library
37

How to-animate-svg's-with snap.svg-js-library

Apr 12, 2017

Download

Technology

Horiguchi Seito
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: How to-animate-svg's-with snap.svg-js-library

How to Animate SVG's with Snap.svg JS Library

Page 2: How to-animate-svg's-with snap.svg-js-library

Profile

Page 3: How to-animate-svg's-with snap.svg-js-library

Profile

Name : Seito

facebook: https://www.facebook.com/horiguchi.seito

Job : Front-End-Engineer / Manager

Company: LIGinc.

Live in : Cebu city & Tokyo

Page 4: How to-animate-svg's-with snap.svg-js-library

LIGinc. is …

Page 5: How to-animate-svg's-with snap.svg-js-library

http://liginc.co.jp/

7,000,000 PV / month

LIG BLOG

Page 6: How to-animate-svg's-with snap.svg-js-library

https://www.facebook.com/iioffice.cebu/

Tokyo, Nagano,

& Cebu in June!

Co-working Space

Page 7: How to-animate-svg's-with snap.svg-js-library

We need good Front-End-engineers in Cebu!

[email protected]

Hire!

Page 8: How to-animate-svg's-with snap.svg-js-library

Snap.svg.js

Page 9: How to-animate-svg's-with snap.svg-js-library

http://snapsvg.io/

Snap.svg.js

Page 10: How to-animate-svg's-with snap.svg-js-library

SVG animation library

What?

Other libraries are… Raphael

SVG.js TweenMax

Page 11: How to-animate-svg's-with snap.svg-js-library

- Simple

- Similar animate method in jQuery

- Supported by IE9

- Produced by Adobe

Feature

Page 12: How to-animate-svg's-with snap.svg-js-library

By the way … You should use Javascript like Snap.svg.js than CSS3 for all browsers.

Page 13: How to-animate-svg's-with snap.svg-js-library

Try tutorial - Create SVG

Page 14: How to-animate-svg's-with snap.svg-js-library

1. Open ai file on illustrator

Page 15: How to-animate-svg's-with snap.svg-js-library

2. File > Save a Copy…

Page 16: How to-animate-svg's-with snap.svg-js-library

3. Format > SVG

Page 17: How to-animate-svg's-with snap.svg-js-library

good

bad

path, rect, polygon

You can use except <image>

Create SVG

Page 18: How to-animate-svg's-with snap.svg-js-library

Try tutorial - Use Snap.svg.js

Page 19: How to-animate-svg's-with snap.svg-js-library

How to

You need only 3 steps

Page 20: How to-animate-svg's-with snap.svg-js-library

How to

Page 21: How to-animate-svg's-with snap.svg-js-library

How to

Page 22: How to-animate-svg's-with snap.svg-js-library

How to

(You can skip this step)

Page 23: How to-animate-svg's-with snap.svg-js-library

How to

Page 24: How to-animate-svg's-with snap.svg-js-library

Easing

Page 25: How to-animate-svg's-with snap.svg-js-library

SVG attribute & property

Page 26: How to-animate-svg's-with snap.svg-js-library

5 sample demo

Page 27: How to-animate-svg's-with snap.svg-js-library

http://codepen.io/seito2014/pen/XdLXqo

1. fill animation

Page 28: How to-animate-svg's-with snap.svg-js-library

http://codepen.io/seito2014/pen/GZaXdN

2. SVG morfing

Page 29: How to-animate-svg's-with snap.svg-js-library

Hint Locations & Amount of anchor points must be same.

Page 30: How to-animate-svg's-with snap.svg-js-library

http://codepen.io/seito2014/pen/Wwqrpj

3. transform

Page 31: How to-animate-svg's-with snap.svg-js-library

Hint 1. You can animate <g>

2. {"transform" : "r-15 t300 30 s1”} means …

Quoted: https://davidwalsh.name/svg-animations-snap

Page 32: How to-animate-svg's-with snap.svg-js-library

http://codepen.io/seito2014/pen/QNVpzM

4. Stroke animation

Page 33: How to-animate-svg's-with snap.svg-js-library

Hint

・getTotalLength()

・stroke-dasharray

・stroke-dashoffset

It's a long story, so please listen me later

Page 34: How to-animate-svg's-with snap.svg-js-library

http://codepen.io/seito2014/pen/WwqrmM?editors=1010

5. Call back

Page 35: How to-animate-svg's-with snap.svg-js-library

My work

Page 36: How to-animate-svg's-with snap.svg-js-library

http://studio-home.jp/

My work by Snap.svg.js

Page 37: How to-animate-svg's-with snap.svg-js-library

Thank you so much!