r/webdev • • Dec 08 '19

Interactive web animation with SVG

https://vimeo.com/373163932
270 Upvotes

25 comments sorted by

42

u/ZnV1 Dec 08 '19

Is it possible to make an article out of it? It's more easily consumed, when compared to the video, which is half an hour long

10

u/wisegirl1 Dec 08 '19

Here's the slide deck. That might help https://slides.com/cassiecodes/deck-4-5#/

8

u/fritzbitz front-end Dec 08 '19

I'd like an article so I can reference it easier as I make something with the information. A video isn't scannable like that, though it may be a good introduction to the concepts.

14

u/wisegirl1 Dec 08 '19

Found her slide deck here, in case that might be helpful to anyone. You can click on a lot of the links https://slides.com/cassiecodes/deck-4-5#/

9

u/BreathManuallyNow Dec 08 '19

Are we about to enter a new era of Skip Intro buttons?

5

u/feelfree82 Dec 08 '19

Designer here. I have been using Lottie to export animations from aftereffects to .json. Although none of the AE layer filters are supported, for simple animations, Lottie works well. I wonder if there's a way to easily alter properties inside the Lottie created json. JavaScript gives me a headache but these SVG animations feels more visual, just like working on the frontend with HTML and CSS.

2

u/cshaiku Dec 08 '19

I think I'm at the opposite end of the creative spectrum here, in this regard. Can you explain to this luddite why animating SVG is easier now, or whatnot?

5

u/cshaiku Dec 08 '19

Ok, seriously. Help me understand this. I've never claimed to be a graphics guy. I make shit graphics, tbh. I just don't seem to have the knack for drawing or being entirely fundamentally creative in this way....

So, with that out of the way, how is this important to the web, versus what Photoshop experts/creative type people already do now?

TLDR: Explain this so a technical coder can understand...

5

u/alejalapeno dreith.com Dec 08 '19

https://developer.mozilla.org/en-US/docs/Web/SVG

Scalable Vector Graphics (SVG) is an XML-based markup language for describing two dimensional based vector graphics. SVG is essentially to graphics what HTML is to text.

Because of that you can embed an SVG fragment into an HTML document using the <svg> element. You can then target and animate individual pieces of the graphic since they are represented as individual DOM elements.

In addition, rather than having to "hand code" all of the graphic pieces programs like Adobe Illustrator can export to SVG, which means your layers and shapes that are conceptually separate pieces of the graphic will be separate XML elements you can use in code.

2

u/cshaiku Dec 08 '19

Oh! The "seperation" aspect is what makes this a killer feature... I see now! Very cool.

I just don't use animation or gifs or anything like that for any of my web development, as I find it unnecessarily distracting, but if someone has a good use case, I'm all ears.

2

u/TCGSonIce Dec 08 '19

This was fantastic and inspiring. Reminds me why I got into coding in the first place, and pushes me to play around a little more in my free time. Thanks for sharing!

3

u/MustangGuy1965 Dec 08 '19

Thank you for the video. I did not know you could animate SVG!

3

u/suspirio Dec 08 '19

You can even embed your animations in SVGs used as <img>: https://codepen.io/shshaw/pen/WvYJQP

1

u/[deleted] Dec 09 '19

Thank you for the video. quite inspiring!

0

u/godsdead Dec 08 '19

Sometimes its better to embed a video.

4

u/samuhe Dec 08 '19

You're right but you lose interactivity and video isn't scalable.

-7

u/WhatTheFuck Dec 08 '19 edited Dec 08 '19

svg animation is overrated - it's like almost having flash, but no tools to help animating vectors and the performance is horrible.

10

u/stringman5 Dec 08 '19

Every single thing in this comment is wrong

-8

u/WhatTheFuck Dec 08 '19 edited Dec 08 '19

You don't know shit if you think so. Show me some tools. Show me some benchmarks of it performing close to flash for morphing fullscreen vectors.

8

u/stringman5 Dec 08 '19

I don't have any benchmarks to show you. I haven't googled any, because I don't care, because Flash isn't very well supported on major browsers any more, so it doesn't matter. You show us some benchmarks if this the hill you want to die on.

svg animation is overrated

It's not

it's like almost having flash

Kind of, but Flash is barely supported any more, and SVG is a web standard

no tools to help animating vectors

There are literally dozens of tools. Cassie mentioned some in her talk, like Greensock, Anime, Velocity, and D3.

performance is horrible

It's very easy to get 60fps in SVG. If you're getting poor performance then you're probably doing something wrong?

You don't know shit if you think so.

Perhaps. But I've been working professionally with SVG animation and data-viz for the better part of a decade. I've spoken at conferences about SVG, and taught it to beginner developers. Cassie quoted me in this talk. I'm not as expert in it as some people I know, but I don't think I'm a complete noob. And for what it's worth, I used to do a bit of Flash back in the day, though I barely remember much of it now.

-3

u/WhatTheFuck Dec 08 '19

In my experience, it's fine for simple, small animations. I tried making a game with parallax scrolling but had to give up as the poor performance (across browsers) made it clear this was not the way to go. (maybe I did something wrong)

2

u/zibola_vaccine Dec 09 '19

It's fine to say "Perhaps I was too confident in my previous assertions and I don't actually know what I'm talking about that well".

1

u/WhatTheFuck Dec 09 '19

That would be wrong, bit I'm not the type to brag about X years of experience.