Make Awesome SVG Animations with CSS // 7 Useful Techniques

Поделиться
HTML-код
  • Опубликовано: 5 июн 2024
  • Learn 7 useful SVG animation techniques to make beautiful graphics for your website. In this tutorial, we'll build two different SVGs from scratch and animate them CSS. Source code: github.com/fireship-io/animat...
    00:00 What we're building
    00:42 What is an SVG?
    02:22 1. Chrome Animation Inspector
    03:11 2. Drawing Groups
    05:10 3. Duotone CSS Variables
    06:30 4. Transition Animations
    07:41 5. JS events
    08:36 6. Keyframe Animations
    10:11 7. Animation Staggering
    #css #animation #tutorial
    Also see...
    SVG in 100 Seconds • SVG Explained in 100 S...
    CSS Keyframe Animation developer.mozilla.org/en-US/d...
    SVG Docs developer.mozilla.org/en-US/d...
    Install the quiz app 🤓
    iOS itunes.apple.com/us/app/fires...
    Android play.google.com/store/apps/de...
    Upgrade to Fireship PRO at fireship.io/pro
    Use code lORhwXd2 for 25% off your first payment.
    My VS Code Theme
    - Atom One Dark
    - vscode-icons
    - Fira Code Font
  • НаукаНаука

Комментарии • 477

  • @jonlothar6126
    @jonlothar6126 3 года назад +603

    I learned so much about SVGs just from your 100 second video! This is gold ~ The power of SVGs is severely underrated.

    • @RexGalilae
      @RexGalilae 3 года назад +25

      Having worked with SVGs a lot lately, I'd say you're in the honeymoon phase right now lol
      Once you dive deep into creating visualisations and charts using SVG and libraries like d3, you'll start to realize that even trivial tasks like aligning text and setting overflow rules have to be done manually and you have to provide the exact pixels for every measurement. No flexbox or grid either lol.

    • @piyush9555
      @piyush9555 3 года назад +18

      It's just ur perception that you learnt a lot in 100 secs cuz' that's hollow learning until you practice that

    • @sidheshwartiwari9834
      @sidheshwartiwari9834 3 года назад +4

      @@piyush9555 very true

    • @HassanSelim0
      @HassanSelim0 3 года назад +3

      yesterday I learned you can nest CSS inside an svg file so you can still reference the svg file inside your html instead of copying it, I don't know if there are browsers who don't support this or not though.
      The cool thing is that you can also reference this svg in a Github markdown file (like Readme), which is how I discovered this trick yesterday 😁

    • @sneaky-Jay
      @sneaky-Jay 2 года назад +1

      Until recently it had poor browser support.

  • @manjurulislamkhan4722
    @manjurulislamkhan4722 3 года назад +398

    Bro, your ship is certainly on fire, and I am onboard!

  • @ihavetwofaces
    @ihavetwofaces 3 года назад +232

    I'm a full stack developer and your content drives me CRAZY because it makes me want to do gorgeous front end stuff like this so bad! But instead I write database queries and c#/java all day. Maybe someday I can pivot to front end or even UX development.

    • @dori8118
      @dori8118 3 года назад +4

      if can i ask, what the challenge to do both?

    • @ihavetwofaces
      @ihavetwofaces 3 года назад +32

      @@dori8118 Mostly a time thing. Between "make a working, easy to use front end that looks good but nothing to write home about", "make a performant back end with good error handling and debugging", "deliver a complete product on a timeline defined by a customer", and "make the front end gorgeous with animated, responsive SVGs that don't add a ton of substance but do add a ton of style", but you can only pick 4. The others are obviously hard requirements, so very very nice UX stuff goes out the window and you get a plain ass button that says "Do Thing" instead of a cool, animated button with a nice color scheme and an aesthetic icon.

    • @thecuriousape9712
      @thecuriousape9712 Год назад +8

      @@ihavetwofaces 1 year later, did you manage to get in a position to play around on the front end? Perhaps something entrepreneurial?

    • @dieerste5799
      @dieerste5799 Год назад +3

      U are smart guy ❤

    • @darkerthansuede2439
      @darkerthansuede2439 Год назад

      @@thecuriousape9712 I hope they did

  • @shayanzamani9907
    @shayanzamani9907 Год назад +26

    Bruh 👌
    The stagger animation effect is what I've always wondered how to apply in a clean way using plain CSS and you just simply nailed it 🤯

  • @subhadeepchatterjee1528
    @subhadeepchatterjee1528 3 года назад +213

    This is LITERALLY what I wanted!!! I commented exactly this on your last video.

    • @Fireship
      @Fireship  3 года назад +43

      Thanks for the suggestion

  • @MikePeiman
    @MikePeiman 2 года назад +66

    How could I possibly like this more? You are hands-down one of the greatest teaching channels in the world. Keep it up. Thank you.

    • @yunusbilecen6660
      @yunusbilecen6660 Год назад

      What is the name of the program he is using ?

    • @beta9996
      @beta9996 Год назад

      @@yunusbilecen6660 for drawing svgs? its Figma

  •  2 года назад +19

    You are definitely one of the most efficient, useful channels in this domain. A lot of useful information in a very short duration... Thank you!

  • @tomijovanoski18
    @tomijovanoski18 3 года назад +91

    Whoa 😮
    I’m accustomed to use all these features in my 7+ years of front-end development career , but damn - that last trick with the inline css variable just blowed my mind 🤯

    • @krackytech2344
      @krackytech2344 2 года назад +1

      yes im definitely using it

    • @butterfly7562
      @butterfly7562 2 года назад +2

      I thus solved a complex animation that required JS implementation, which was great!

    • @danymajeed
      @danymajeed 2 года назад

      wow

    • @suraj351
      @suraj351 Год назад

      It's very usefull.... But i already know about 😊

    • @ontheruntonowhere
      @ontheruntonowhere Год назад +2

      @@suraj351 Give yourself a ribbon, champ.

  • @ShintekBeats
    @ShintekBeats 3 года назад +172

    I belong to the 43.4%. I really appreciate your videos, I used to do CSS/HTML/JS/PHP etc when I was a kid and I have a lot of catching up to do!

    • @brendabaholo1610
      @brendabaholo1610 2 года назад +4

      Beloved, Please give this your special attention. God is a Good, Holy and Just( meaning that He up holds justice and does what He deems as good) Judge. He is also forgiving and He is All-Loving. He is also perfect meaning that there is nothing about Him this is contradictory. But How can He forgive you and me but still uphold Justice. It's through faith in the death, burial and resurrection of Jesus Christ. So turn repent and put your faith in the Living Christ who died for U and now Lives

    • @axeleli6845
      @axeleli6845 2 года назад +12

      @@brendabaholo1610 shut up you're crazy

    • @Kevessi
      @Kevessi 2 года назад +2

      @@axeleli6845 chill man

    • @danymajeed
      @danymajeed 2 года назад

      😄

    • @jaideepshekhar4621
      @jaideepshekhar4621 Год назад +3

      @@brendabaholo1610 Want forgiveness? Take crack- I meant religion.

  • @meetzaveri734
    @meetzaveri734 2 года назад +2

    This video helped me solve an issue that I was having since 3-4 months in my side project. Really, the content they produce here is powerful. Loved it

  • @nishilsheth9076
    @nishilsheth9076 2 года назад +8

    I never knew about the animations tab in chrome dev tools.
    There are so many things I learn from your videos in such a short amount of time.
    Keep up the good work ☺️!

  • @JR-um3kt
    @JR-um3kt 3 года назад +22

    I might get job with all of this.
    In few videos learned more than in my entire Web programing course on faculty.

    • @Fireship
      @Fireship  3 года назад +19

      This video should help your personal website stand out at least.

  • @taofeekbakare990
    @taofeekbakare990 Год назад +5

    Really thought developers coded svgs using some kind of artistic mastery. Never knew figma could do this seamlessly. Thank you

  • @daniellasilverman7554
    @daniellasilverman7554 3 года назад +68

    1:02 - Jeff pulling out his college Math HW 😂

  • @romeorel1679
    @romeorel1679 8 месяцев назад +2

    You are a genius.
    Being able to reverse engineer the animation design and recreate a new one based off of it.
    A truly web engineer.

  • @akshitsingh6429
    @akshitsingh6429 3 года назад +69

    For anyone who cannot see the animation panel (probably due to an older ver of chrome ) try clicking on the 3 dots ,
    then click on the more tools tab then select animation

    • @yunusbilecen6660
      @yunusbilecen6660 Год назад +1

      What is the name of the program he is using ?

    • @Meletion1
      @Meletion1 11 месяцев назад +2

      @@yunusbilecen6660figma he said it

    • @Gust8
      @Gust8 7 месяцев назад

      Visual Studio Code(web/application) and Figma(web)@@yunusbilecen6660

  • @lucasbss
    @lucasbss 3 года назад +49

    every time i watch your videos i wonder why i spent so much on random courses, i could have just seen your videos

  • @irun_mon
    @irun_mon Год назад +3

    I didn't even know you can do this with SVG, learn new things everyday

  • @Shdnfncidjen
    @Shdnfncidjen 3 года назад +7

    Half of viewers subscribed is actually really good! Congrats!

  • @Dawa202
    @Dawa202 3 года назад

    Best programming shorts on youtube! Your execution and knowledge is very impressive man!

  • @kalugy
    @kalugy Год назад +1

    that's just a good explanation, really complex concepts in a few minutes in a very useful and understandable way. thank you

  • @Gepeto213
    @Gepeto213 3 года назад +1

    Seriously ? What a great content for such a short video. Full of a lot of tips! Awesome!

  • @leonardomoraes1658
    @leonardomoraes1658 Год назад +3

    I came to learn how to animate svgs, I left with what I came for and a set o tools. Many thanks!

  • @philippebaillargeon5204
    @philippebaillargeon5204 3 года назад

    EASILY one of the best programming channel on RUclips. You don't understand how valuable your videos are !!

  • @brucemozart3665
    @brucemozart3665 4 месяца назад

    The animations are impressive, but what's even more impressive is your awesome tutorial. Thank you

  • @dankelman9562
    @dankelman9562 Год назад +2

    Awesome video! I really enjoy these clear and short tutorials!

  • @TechJohnson
    @TechJohnson 3 года назад +2

    You have a great teaching style. Thank you for a great refresher!

  • @gregoryolenovich6440
    @gregoryolenovich6440 2 года назад

    I do this stuff everyday and I just learned about changing css vars with js and the inline vars. Great stuff glad I watched it.

  • @thefront5871
    @thefront5871 Год назад

    WoW! Learning SVG and animating it is like learning HTML5 and CSS3 all over again! Amazing!

  • @Aspiiire
    @Aspiiire 3 года назад +1

    Never knew about the animation tab thank you so much for the video and for this feature it's a game changer

  • @patroclus8796
    @patroclus8796 3 года назад +1

    This was very well explained. Thank you! More of this pleeezz

  • @ShmoreIITG
    @ShmoreIITG 5 месяцев назад

    This is really well formatted and precisely explained video. You saved so much of my time with this video. Thank you so much!

  • @TheSerbianTube
    @TheSerbianTube 3 года назад +26

    More people should subscribe in sign of respect because of quality content you provide to us. Thank you!

  • @rice5817
    @rice5817 2 года назад +3

    Absolutely love your videos as they're always packed with yummy tips & tricks.
    You're the man! Keep it going

    • @GamingTSH
      @GamingTSH 2 года назад

      Top Js Effect ruclips.net/video/V4Aq9yGWpA4/видео.html :)

  • @dbroche
    @dbroche 2 года назад +1

    Cool video. I'm a big fan of embedding SVG directly into the DOM; however, I prefer to leverage & for performance. Happy animating!

  • @ben97864
    @ben97864 2 года назад

    Buddy! Blew me away! The more I learn how math and dynamic programming principles can be harnessed on the front end, the more I fall in love with it. Thumbs up on every vid of yours I watch, and an eternal subscriber!

    • @GamingTSH
      @GamingTSH 2 года назад

      Top Js Effect ruclips.net/video/V4Aq9yGWpA4/видео.html :)

  • @sthefanocarvalho2823
    @sthefanocarvalho2823 3 года назад

    Your explanations are the best!
    Efficient and complete.

  • @BO-ny5mm
    @BO-ny5mm 3 года назад

    Wooow! Priceless 12 minutes video :) Thank you so much for supercalifragilistic tutorial!

  • @yatochka7777
    @yatochka7777 Год назад

    Wow, it's the best SVG guid ever!
    Thank you so much! 💖💖💖💖💖

  • @radigaming1584
    @radigaming1584 3 года назад +22

    High quality content + Moving speed = Fire 🔥

    • @swoorp
      @swoorp 3 года назад

      High quality content + Moving speed = Friction causing x+y = Fire🔥

  • @paulmitchell2916
    @paulmitchell2916 2 года назад

    nice image at 1:04.. brings back memories of all those many years at community college catching up to the folks who actually worked hard in high school..

  • @ugarz
    @ugarz 3 года назад

    Thank you very much you couldn't release this video at a better time ! This is exactly what I was looking for the past few days ! I was even reverse engineering Stripe's buttons 😂

  • @catalinim4227
    @catalinim4227 3 года назад +1

    Always wanted to learn this, many thanks 😊

  • @shamiul_islam
    @shamiul_islam Год назад +1

    Really an impressive one!
    Thanks!

  • @jonathan-arias
    @jonathan-arias 3 года назад +15

    The way you animate the bolt icons blew my mind, the inline CSS variables are amazing.

  • @Bstiler100
    @Bstiler100 3 года назад

    I can't thank you enough, I was looking for something like this.

  • @WellSaint001
    @WellSaint001 2 года назад

    man! thank you! this is a lot more than what I expected!

  • @ic3xiii
    @ic3xiii 3 года назад

    OMG that --order variable trick is amazing!

  • @utvikler-no
    @utvikler-no 2 года назад

    Loved the css variable --order at the end. Very creative!!

    • @GamingTSH
      @GamingTSH 2 года назад

      Top Js Effect ruclips.net/video/V4Aq9yGWpA4/видео.html :)

  • @snakeeyesOFFICIAL76
    @snakeeyesOFFICIAL76 Год назад +1

    Just when i thought i knew a litle bit about animations... i find this stuff... i already subscribe

  • @mohamed_elmardi
    @mohamed_elmardi 3 года назад +2

    thank you so much, SVG is awesome.

  • @harshbrownes
    @harshbrownes Год назад

    I feel like I knew this the whole time! What a great video!

  • @kwamenaplays5899
    @kwamenaplays5899 3 года назад

    I really needed this video. My app needs a UI update and this gave a few excellent ideas 👌

  • @CoryTheSimmons
    @CoryTheSimmons 3 года назад

    Didn't realize you could use calc with time durations. Very nice stagger technique! 👏

  • @thebavarian8726
    @thebavarian8726 3 года назад +7

    I love it how I always get this "AHHHH nice" effect from your tutorials.

  • @jdubina6078
    @jdubina6078 3 года назад +40

    Videos have been 🔥 lately

  • @leosouza3008
    @leosouza3008 2 года назад

    what a video!!! i dont usually subscribe to channels on YT but had to subscribe to you! thanks a lot for the content on this video

  • @aitboss85
    @aitboss85 2 года назад

    Love your videos. You are one of the best guides on RUclips.

  • @agrittiwari5485
    @agrittiwari5485 2 года назад

    Thanks for the elaborative introduction to SVGs

  • @axa993
    @axa993 3 года назад

    Holy shit you just taught me how to SVG. Brilliant.
    I love this channel and I've been subscribed for a long time but you just keep impressing me.

  • @CHITUS
    @CHITUS 2 года назад

    Whoa
    I’m accustomed to use all these features in my 7+ years of front-end development career , but damn - that last trick with the inline css variable just blowed my mind

  • @ahmedroberts4883
    @ahmedroberts4883 Год назад

    Great video. Thank you!

  • @fieldtrip2178
    @fieldtrip2178 Год назад

    Just learned how to make svg animations from this. Nice.

  • @brendensong8000
    @brendensong8000 Год назад

    Fantastic Video! Thank you sharing!!!

  • @EmmanuelNgwandu
    @EmmanuelNgwandu 3 года назад +1

    Thanks bro, I never liked svg cuz I didn't understand ém but now I feel like you gave me super powers

  • @Spainog
    @Spainog 3 года назад

    Mr Delaney these last weeks you have became my favorite channel.. love your content

  • @steveeparsonsjr7929
    @steveeparsonsjr7929 2 года назад

    This is pretty much how you would do it in Inkscape, using layers, grouping, containers and ID's etc. Nice

  • @LoveThatSceneChannel
    @LoveThatSceneChannel 3 года назад

    Okay... I literally need this!

  • @babakkarimiasl8127
    @babakkarimiasl8127 3 года назад +1

    such a helpful and time-saver video thank you

  • @curiosdevcookie
    @curiosdevcookie 3 года назад

    I’m so super happy I had you by my side when I started self-teaching. Everyone who hasn’t subscribed is missing the hell out of web dev and programming in general. That said, I owe you a lot. When I’ll hold my first dev job, I’m going to bake you a cake, and/or consider anything else*), that makes you smile/happy, yours 🙃
    *) in my realm of possibilities (no end world hunger stuff, no soul of my first born, … you get the picture 🧐.

  • @stylesg7818
    @stylesg7818 2 года назад

    That was a cool one.
    Thank you.

  • @yavuzerkal2551
    @yavuzerkal2551 7 месяцев назад +1

    amazing video as always. You are like a gift from the web development gods

  • @eduardointech
    @eduardointech 3 года назад

    Wow. Thank you so much!!

  • @klutch4198
    @klutch4198 3 года назад +24

    Finally, something fun to do today 🔥🎸🍺🍔

  • @pijushbarik
    @pijushbarik 3 года назад

    Man, you are on fire! Keep up the good work. ❤️

  • @WilliamJuan
    @WilliamJuan 3 года назад

    Wow, amazing content as always! 🔥🔥

  • @conradocampetella2253
    @conradocampetella2253 3 года назад

    Thanks Jeff!! awesome content as always!

  • @itsgunu5393
    @itsgunu5393 3 года назад

    It has the best Content available to try and create things , Without any length tutorials

  • @SSGVB
    @SSGVB 4 месяца назад

    Before this video I was scared of scalable vector graphics, but now, I can’t leave home without one, thanks FireShip

  • @Dunktastic17
    @Dunktastic17 3 года назад

    This is awesome! Thank you!

  • @user-zo2ky4mz7d
    @user-zo2ky4mz7d 3 года назад

    THANK YOU FOR THIS. LEARNT A WHOLE LOT🔥

  • @_parsat
    @_parsat 2 года назад

    Amazing. Love your videos man!

  • @nitroflap
    @nitroflap 3 года назад +3

    You listened to me! Thanks!

  • @d3v431
    @d3v431 2 года назад

    This is awesome. Thanks for sharing ❤️

  • @AkshayKumar-kz6zh
    @AkshayKumar-kz6zh 2 года назад +2

    Jeff you're a hero! Thank you a ton for making these videos. Hope they cryogenically preserve you so that the dev community never loses you. You need to be protected.

  • @PaulWackerow
    @PaulWackerow 3 года назад

    Loving these videos lately! Already using stuff I learned from your last SVG video... keep up the great content, much appreciated!

  • @bhaveshbhide
    @bhaveshbhide 3 года назад

    Brilliant explaination!! Love this channel!

  • @MVIVN
    @MVIVN Год назад

    This is mindblowing stuff! Wow!

  • @GaborGubicza
    @GaborGubicza 8 месяцев назад +1

    Great content thanks for sharing. Since the video Figma became a subscription based SW.

  • @aleksandarstoev1611
    @aleksandarstoev1611 2 года назад

    Man that's some quality content right there! Respect!

  • @SouravDuttaROCKSTAR
    @SouravDuttaROCKSTAR 3 года назад +1

    This one is GOLD STANDARD ...so much SVG and animation knowledge packed in just a few mins. JUST AWESOME!

  • @uibyade
    @uibyade 3 года назад

    This is really helpful, thanks man

  • @mukiibipeter07
    @mukiibipeter07 2 года назад

    Hohohooooo ... Bro, you have more??
    I enjoyed every bit of it.

  • @ayanmukherjee9744
    @ayanmukherjee9744 3 года назад +1

    To me you are the best web dev channel.

  • @faroukbousselmi1732
    @faroukbousselmi1732 Год назад +2

    Though it's a year late, but great work man. You hand out a good, short and efficient explanation and you covered 90% of the technical parts! thanks

    • @pjos6406
      @pjos6406 Год назад

      Though it's a year and three weeks late, but great work man. You hand out a good, short and efficient explanation and you covered 90% of the technical parts! thanks

  • @eggescobar
    @eggescobar 2 года назад

    Outstanding video! Great use of CSS variables!

    • @GamingTSH
      @GamingTSH 2 года назад

      Top Js Effect ruclips.net/video/V4Aq9yGWpA4/видео.html :)

  • @sbJin
    @sbJin Год назад

    thanks for your great teaching.

  • @tomasslezak3628
    @tomasslezak3628 2 года назад

    Great tutorial!

  • @MrKostas336
    @MrKostas336 3 года назад

    Your videos are extremely helpful. Thanks brother

  • @jeremyrubio1531
    @jeremyrubio1531 2 года назад

    *subscribed. Great content and very well explained. Thank you !! I learned a lot with this video.