SVG Animation With Text Tutorial | HTML CSS

Поділитися
Вставка
  • Опубліковано 25 лис 2024

КОМЕНТАРІ • 817

  • @tomcatbuzz
    @tomcatbuzz 5 років тому +348

    It is appearing that using the methods in Figma from the video may have changed some for the output that is pasted into the html. I had a double set of values beginning with to with values inside. I commented the first set for testing and it works. So for anyone having an issue just examine your svg code and comment out the first set of code surrounded by . The second set beginning in path contains all letter paths. Good luck. And great video.

    • @developedbyed
      @developedbyed  5 років тому +46

      Thanks for the update! Figma is constantly changing so I appreciate you writing the fix!

    • @austinlynum7112
      @austinlynum7112 5 років тому +17

      You are a lifesaver!! I was just about to give up thinking @DevEd doesnt know what he is talking about lol. Glad I looked at the comments first!!

    • @jaygreg6329
      @jaygreg6329 5 років тому +14

      I am absolutely loving your channel. I am a new subscriber by the way.
      But I feel the need to recommend that you look at what is happening with exporting SVGs from Figma now. For me it is giving me a single which means that I can not select individual child paths. I tried to work around this by exporting the letters one by one after getting the whole size and placing the paths on top of each other. I know that Figma changing this is not your fault but your video unfortunately does not address this. I am still working on a fix but I have other things that I need to do for now. If you can update this it would be great. Thanks!
      Great idea though and got me inspired. Keep up the great content.

    • @FrankWauters
      @FrankWauters 5 років тому +126

      Hi, if you choose "Center" instead of "Inside" or "Outside" in the stroke options, there is no issue with the mask.

    • @ekechkeidze745
      @ekechkeidze745 5 років тому

      Thank you

  • @rajivonarx5958
    @rajivonarx5958 5 років тому +364

    For those of you who get a single path after following this video, here is a solution I've found (I'm a complete noob at this, took me a full day to solve and wanted to share my workaround).
    Do not remove the fill color like he did, removing fill and adding strokes then outlining then copying as svg always gave me a single path. Something like this happens:
    Instead,
    1. keep the fill color
    2. don't add strokes (we will do it manually)
    3. get outline stroke of filled text (no strokes!)
    4. copy as svg
    you should get
    remove the fill property and add stroke="white" & stroke-width="5" to the path tags. The paths should look like
    It is important that you remove the fill property or else the fill animation at the end won't work. I hope this helps.

    • @VIKASSAINI007
      @VIKASSAINI007 5 років тому +9

      Thanks for saving my time, yes methods in figma changed

    • @virginietrubiano3062
      @virginietrubiano3062 5 років тому +8

      Thank you so much for sharing!!! That's exactly what I was looking for.

    • @umitatak5396
      @umitatak5396 5 років тому +2

      thanks

    • @Raspace
      @Raspace 5 років тому +6

      i was losing my brain dude thanks

    • @sriramrepaka7003
      @sriramrepaka7003 5 років тому +3

      THANKS A LOT DUDE YOU SAVED MY DAY

  • @chrismauerer
    @chrismauerer 5 років тому +263

    Love this guy - so humble and excited about what he shares - so dope!

    • @djsargex7777
      @djsargex7777 4 роки тому

      definitely!

    • @andytataw5466
      @andytataw5466 4 роки тому

      Ikr!

    • @k.r181
      @k.r181 9 місяців тому

      Hello, I don’t see much chance, but could you upload the good files somewhere?
      Whatever i do is no good…
      Thank you!

  • @asdf09er
    @asdf09er 4 роки тому +13

    I like that I learn things you aren’t even trying to teach, like how to perfectly center the text (especially for times you don’t know the text width). Really enjoying your videos.

  • @AkashsinghSisodiya
    @AkashsinghSisodiya 4 роки тому +4

    Hey man, your enthusiasm / smile / excitement on the start of the video is contagious! I came here tensed but left with a smile!

  • @ЮрийНосов-щ8ц
    @ЮрийНосов-щ8ц 4 роки тому +8

    You can use stroke-dasharray and stroke-dashoffset properties with percentages to avoid javascript. Also you can use stroke-linecap with different values to remove gaps from edges of characters.

  • @joyahmed_007
    @joyahmed_007 4 роки тому +4

    Appreciate it a lot. And changing the stroke linecap and linejoine worked perfect for me...
    stroke-linecap="round"
    stroke-linejoin="round"

  • @silverdaymon8786
    @silverdaymon8786 5 років тому +35

    If you have problem applying the stroke-dasharray, just put the code at the bottom of the paths in the into the html file.
    It becomes:
    1
    2
    to 8
    And edit:
    #logo path
    to:
    #logo > path
    To not select paths into mask node. (If not you will get 16 path instead of 8).
    Into js and css file.
    Hope it helps!

  • @developedbyed
    @developedbyed  6 років тому +114

    This took a while to process sorry about that! But this was really fun to make!

    • @jaygreg6329
      @jaygreg6329 5 років тому +1

      I am really struggling with using Figma. I left a comment earlier in the pinned comment at the top of this video. It is the first time that I ever tried it and I am honestly less than impressed with it. That is not your fault I understand that and I also recognize that it is currently an industry standard but the fact is the more I try to figure out how to reproduce this tutorial using it I have seen strange choices that Figma made.
      When looking more closely at the way that Figma compiles it SVGs it seems that when dealing with text elements the stokes are not actually strokes but instead are fills. If you change the HTML from stroke to fill in what is supposed to be a stroke a strange grid-like pattern appears. I am new to a lot of these things but am learning very quickly from constant focus on JS and React. So, forgive my lack of knowledge in this particular instance. What I am wondering is, is there a way to cause the fill to render like you did with the stroke. I am trying to find a solution because I would love to use this effect in my current project but Figma's compiling of its SVGs has caused me to waste a day. But it is not a total loss because I have learned quite a lot about SVGs so thanks for the tutorial anyways. Anyone that wants to point me in the right direction I offer a thanks in advance. Thanks!

    • @mustafaaur4019
      @mustafaaur4019 5 років тому +9

      Iam having trouble with the fill property.its not filling the svg as you did in the video pls help.

    • @kove_sr
      @kove_sr 5 років тому

      @@mustafaaur4019 same problem here

    • @suzamuidesign
      @suzamuidesign 4 роки тому

      3d image hover css
      ua-cam.com/video/yyDey1Iid0c/v-deo.html

    • @DebasishDas-vp5dg
      @DebasishDas-vp5dg 4 роки тому

      I write every single code and it didn't work can you help me sir ??

  • @emanuelamaviglia7919
    @emanuelamaviglia7919 3 роки тому +4

    For those who are having problems with figma and have only a single path. For me worked this:
    1) Write the text, WITHOUT adding the stroke.
    2)Right click and select Outline Stroke
    3)Copy as SVG
    You should have the right numbers of paths in this way :)

    • @maheshlandage1
      @maheshlandage1 Рік тому

      Yes but whats the point of doing that if we dont get stroke for animation.?..is there another way to get stroke?

  • @josantiago109
    @josantiago109 5 років тому +4

    I loved the simplicity of your explanations. Will check out more of your videos for sure!

  • @Ponk_80
    @Ponk_80 9 місяців тому

    It’s very nice of these guys to create videos for the viewer.

  • @evakuator8118
    @evakuator8118 6 років тому +46

    Jesus Christ, that's what I've been looking for like years. I just stumbled upon this video, and finally here it is.
    It's super cool, subscribed. Waiting for more videos to come, really hyped up. Your channel must blow up, this is some quality content. Now, need to watch your other videos, which I'm about to do. Sorry for my english, I am not a native speaker, not even a good speaker. Again, thanks for the video

    • @developedbyed
      @developedbyed  6 років тому

      thanks for the lovely comment! Will do my best to post alot of videos! Feel free to share the video!

    • @yaseenshaik2682
      @yaseenshaik2682 5 років тому

      @@developedbyed how to make it responsive

    • @vladfreishmidt2707
      @vladfreishmidt2707 5 років тому +1

      Yaseen Shaik set width for svg in media-queries but I’m not sure will the amount of dots will stay the same

    • @wolfgangr.3268
      @wolfgangr.3268 5 років тому

      @@vladfreishmidt2707 & Yaseen Shaik : Setting width to a percentage (50%) makes it responsive without changing anything else.

    • @paulsonstechpoint773
      @paulsonstechpoint773 4 роки тому

      @@wolfgangr.3268 That works!

  • @japsimransingh9933
    @japsimransingh9933 4 роки тому +1

    Your tuts are always worth watching

  • @agamemnon-Fr
    @agamemnon-Fr 2 роки тому

    What you do and what you did, for us, is just a miracle ! Thank you very very much ! Best regards from Paris

  • @ob7349
    @ob7349 3 роки тому

    Time flies so fast with you, you explain so easily, 👍the truth with Js is not very clear for me, but still, thank you🙏🌹🇺🇦

  • @surpriseclub305
    @surpriseclub305 5 років тому

    To all having just one path, write click and flatten your text before copying as svg. Good work anyway Dex Ed.

  • @DanielRodriguez-iv5rw
    @DanielRodriguez-iv5rw 6 місяців тому

    I love the way you explain and make everything look so easy, excellent video!

  • @alistaw1866
    @alistaw1866 3 роки тому

    I really can't get enough if your tutorials

  • @stn3042
    @stn3042 5 років тому +14

    little effort, big result - like watching your videos

  • @welingtonwel8799
    @welingtonwel8799 3 роки тому

    Hello, I'm from Brazil and I'm addicted to your videos, I'm already a new subscriber. Thank you.

  • @ammarahmed84
    @ammarahmed84 4 роки тому +2

    I love how you explain this stuff. I’ve been watching so many web dev videos and this is by far the best. This is the first video of yours that I watched and instant subscribe. You deserve success.

  • @4MXW
    @4MXW 2 роки тому

    so much inspiration and excitement!
    I'm not only inspired but I also lost my fear to these svg types of animations.
    Tysm! Keep it up. Much love

  • @AndresRodriguez-wu6nj
    @AndresRodriguez-wu6nj 5 років тому +1

    Great video! I've been looking to learn how to do this for quite a bit but never found a resource as good as this one. Also, another way to center the content of the body using flexbox:
    body {
    width: 100%;
    height: 100vh;
    background-color: rgb(32, 35, 48);
    display: flex;
    justify-content: center;
    align-items: center;
    }
    This way you wouldn't need to style the SVG's position :)

  • @heavenprado2538
    @heavenprado2538 3 роки тому

    i've been trying so hard to learn svg and this amazing dude just made it so easy omg thank you so much

  • @anmolsekhon3865
    @anmolsekhon3865 4 роки тому +2

    I clicked few ads just for this guy!

  • @agk2011
    @agk2011 5 років тому +1

    The first video to watch on your channel. Great one. Keep it up.

  • @lachnr0ll
    @lachnr0ll 2 роки тому

    Awesome tuturial. Simple, effective, creative, and useful.

  • @DDoesT
    @DDoesT 5 років тому +1

    I’m so glad I found your channel!

  • @d3v431
    @d3v431 2 роки тому

    bro. I love you so much. After struggling with Gsap draw svg plugin, i was trying to find easy way out.. then i found you .. damn this is cool.

  • @alex.graywolf
    @alex.graywolf 5 років тому +14

    Great video!
    An advice, you can do in a better way than do a js script to get te total length of the stroke:
    var logo = document.querySelectorAll("#logo path");
    logo.forEach(function(i){
    console.log(i);
    i.style.strokeDasharray = i.getTotalLength()+"px";
    i.style.strokeDashoffset = i.getTotalLength()+"px";
    i.style.animation = "anim 2s ease forwards";
    });
    that save a lot of time for a big amount of letters

    • @Surya-vj4yn
      @Surya-vj4yn 5 років тому +1

      To add time offset
      var logo = document.querySelectorAll("#logo path");
      var t = 0.3;
      logo.forEach(function(i){
      console.log(i);
      i.style.strokeDasharray = i.getTotalLength()+"px";
      i.style.strokeDashoffset = i.getTotalLength()+"px";
      i.style.animation = "anim 2s ease forwards"+" " + t +"s";
      t = t+0.4;
      })

    • @samuelrajasingh506
      @samuelrajasingh506 5 років тому

      @@Surya-vj4yn this doesn't work please help

    • @adnanhakim
      @adnanhakim 5 років тому

      Thanks a lot man!

    • @samuelrajasingh506
      @samuelrajasingh506 5 років тому

      @@adnanhakim is it working for you

    • @adnanhakim
      @adnanhakim 5 років тому

      @@samuelrajasingh506 yup!

  • @nicksparks3543
    @nicksparks3543 4 роки тому

    Amazing, I didn't quite get the 'no-fill' white outline right in figma, but I followed your code straight through....and it worked I am amazed that something that simple can look so classy! Thankyou my lovely friend on the internet. :)

  • @AymanLkhawa
    @AymanLkhawa 5 років тому

    YOU'RE THE BEST WEB DEV IN THE WORLDDDDDDD !!

  • @zygimantasjasiunas5240
    @zygimantasjasiunas5240 5 років тому +3

    I love your enthusiasm. Keep doing a great job! Thanks for the tutorial

  • @maresolaris
    @maresolaris 5 років тому

    I really love your enthousiasm and humor. Very useful video with lots of information. Thank you very much for posting this!

  • @KeshavAneja
    @KeshavAneja 11 місяців тому +1

    we can set the pathlength="1" that way we don't have to every use JS to calculate the pathLength, because everytime it will be 1. so stroke-dasharray="1" stroke-dashoffset="1" is gonna disappear it, and to animate it turn the offfset to 0.

    • @NikitaVan
      @NikitaVan 2 місяці тому

      awesome it worked for me

  • @tom5890
    @tom5890 5 років тому

    I've been confused about SVG animation forever, using hacks here and there. This is a very nice tutorial!

  • @juliamovsisyan593
    @juliamovsisyan593 2 роки тому

    You are my programming motivation 👨‍💻

  • @Al_Gonzo
    @Al_Gonzo 4 роки тому

    Interesting video. Your collab with web dev simplified got you a new viewer

  • @isaacdaniel9180
    @isaacdaniel9180 3 роки тому +1

    Quality content. Really enjoying your videos.

  • @Sausty
    @Sausty 3 роки тому

    Thanks Ed, this is really great. So many posibilities!

  • @shikhershukla7650
    @shikhershukla7650 2 роки тому +1

    Hey very nice tutorial, just wanted to add that we can add those styles directly form javascript after DOM loads with for loop so it works for any text you add.

  • @RC-bl2pm
    @RC-bl2pm 5 років тому

    This is a fantastic introduction to SVG manipulation. I really appreciated this lesson, thanks so much for sharing.

  • @suryanath8150
    @suryanath8150 4 роки тому

    Finally even though I am a python dev I subscribed

  • @tam2000k2
    @tam2000k2 4 роки тому

    Beautiful, absolutely beautiful

  • @m75172
    @m75172 4 роки тому

    I love your energy! And the video was really helpful - imagine all the possibilities!

  • @vanjacvetkovic3788
    @vanjacvetkovic3788 5 років тому +4

    Keep making videos! And smiling too 😁 Great work, thank you!

  • @wpbites6722
    @wpbites6722 5 років тому +2

    That was amazing! Loved it.

  • @kendalljones99
    @kendalljones99 4 роки тому

    I've been binging on your videos the last couple of days and have learned a ton! Thanks!

  • @avashurov
    @avashurov 3 роки тому

    That looks so awesome! That’s for sharing!

  • @reedbrousseau5884
    @reedbrousseau5884 5 років тому +1

    Subscribed, and I use Inkscape to create my SVG files, with the caveat that you have to save your final SVG as a standard SVG vs Inkscape’s native SVG which contains non-standard XML tags that Inkscape uses to store layers, groups, etc. that just clutters your in-line SVG in your HTML document.

  • @resty1672
    @resty1672 4 роки тому

    Its amazing you made such complex skill feels understandable, thank you so much !

  • @dragosdesign4563
    @dragosdesign4563 5 років тому +3

    more css and js effects please. Great work on this tutorial. I just subbed to your channel.

  • @23Miniatures
    @23Miniatures 5 років тому

    Wow, your tutorial is really smooth and your reaction is so friendly,

  • @Drzfinest929
    @Drzfinest929 5 років тому

    Loved this video, your excitement alone throughout the video made me enjoy it even more. Thank you for this wonderful video! Going to use it for my landing page group project !

  • @kermitthefrog5885
    @kermitthefrog5885 5 років тому

    It was a very simple way yet cool result to animate a text. thumbs up :)

  • @karmahchannel
    @karmahchannel 5 років тому +3

    Its'cool, that's exactly i've been looking for

  • @jonahbutler9079
    @jonahbutler9079 5 років тому

    Hey dave ed. Thanks for this tutorial! I've often come across these and have often wondered how this little piece of magic works. I never really took the time to do the research, until one day this appeared in my feed. Thanks for unraveling the mystery in such a great format. Your enthusiasm for teaching and programming is really second to none. (:

  • @anasyunus3389
    @anasyunus3389 5 років тому

    Hey Yo....Yours Is the most perfect understandable video i have seen. Please continue making such videos

  • @pranavchandra1662
    @pranavchandra1662 5 років тому +1

    That is really amazing, thanks for bringing such great content, love your creativity :)

  • @jaysenb
    @jaysenb 2 роки тому

    my man, always on point

  • @alexlegoG
    @alexlegoG 2 роки тому

    Amazing video! Really elegant and easy to implement design idea!

  • @abhishek_k7
    @abhishek_k7 5 років тому +1

    Awesome animation effect! Thank you!

  • @trustjamin3023
    @trustjamin3023 4 роки тому

    I really enjoyed how you made everything fun, thanks for making this tutorial been looking for something like this

  • @allagligora5534
    @allagligora5534 Рік тому

    Thanks Ed, you're the best!

  • @soulfreak001
    @soulfreak001 Рік тому

    saved myy dayyy buddy !!!!!!!!!!!!!!!!!!!!!!!!!!! mayy the forceee bee withhh youuuuuuuuuuuuuuuuuuuuuuu

  • @TPc0
    @TPc0 5 років тому

    Well sir you’ve just won a subscriber for life!

  • @nicksparks3543
    @nicksparks3543 4 роки тому

    Thankyou so much, did the figma bit slightly different(newbie), absolutely amazing tho! did the code and boom! it worked. thankyou

  • @goranmaras5216
    @goranmaras5216 4 роки тому

    Delete ... if you want to apply stroke-dasharray, then change paths stroke width to 4

  • @stylesg7818
    @stylesg7818 5 років тому

    Finally!! This is how it's made.
    Thank you so much!

  • @khaledoghli1894
    @khaledoghli1894 5 років тому +1

    Man i love the way you talk with video .. 💙

  • @cintron3d
    @cintron3d 5 років тому

    Excellent tutorial, and very creative idea. Thanks!

  • @milosleng1175
    @milosleng1175 3 роки тому

    this guy is a CSS god.

  • @triplef3v3r
    @triplef3v3r 4 роки тому

    this guy is so fucking happy, I can't watch this it always lend you to the wrong direction.

  • @IshchenkoVitaliy
    @IshchenkoVitaliy 2 роки тому

    thank you friend! Thanks to your video, I made an epic loader based on the company logo :)

  • @unknown_channel_name
    @unknown_channel_name 5 років тому

    That was really cool. As I am new to web designing, I really enjoy your content. It helps a lot to me in different aspects. Thanks for making such awesome tutorials.

  • @johnyacoub2290
    @johnyacoub2290 5 років тому

    I really enjoyed it . keep it going man! thumbs-up!!

  • @gazzzou
    @gazzzou 5 років тому +1

    Love your tutorials! keep it up please!

  • @luis96xd
    @luis96xd 3 роки тому

    Wow, this was an amazing video, I loved the effect! 🤩 It worked for me, Thank you so much! 😄👏
    On the other hand, Figma is an Amazing tool for Web design 😱

  • @marianagrnk
    @marianagrnk 5 років тому +5

    10:55 "I was garbage ok" hahahah the best, loved the tutorial btw! :)

  • @luisvargas7525
    @luisvargas7525 4 роки тому +7

    Hi, if you choose "Center" instead of "Inside" or "Outside" in the stroke options, there is no issue with the mask.
    by: Frank Wauters (who has commented here this solution)

  • @blasebeg
    @blasebeg 9 місяців тому

    If you are having trouble implementing this (e.g. one long svg file, can't animate the outline, etc.), I may be able to help you.
    1. In Figma, forget using the text stroke. You won't need it. Just create your text as normal.
    2. Take the outline text from the text in Figma as normal. Copy as SVG as normal. Then paste it into your project. You should have filled in text. This is a good thing cause now all your text is an SVG and SVGs have a fill property that determines the color of the inside of the SVG and a stroke property which is the outline you need to affect.
    3. Within each path element, of the SVG file you just pasted, set the fill attribute to transparent (fill="transparent")
    4. If you don't already have a stroke color, set you stroke's color by appending a stroke (stroke="#141414") to the end.
    5. Set your preferred stroke width by appending a stroke width at the end (strokeWidth={2} or stroke-width="2")
    6. Follow his instructions as normal.
    7. If I was able to help you, let me know with a like or a comment. I want to know how many people I was able to help with this 💚

  • @mohammedmuizz4825
    @mohammedmuizz4825 5 років тому

    Love your videos .. its super helpful being a starter into web designing and development.. superb bro loads of love .. ❤️

  • @chans9055
    @chans9055 5 років тому

    Always thank you for your great tutorials.

  • @jugaltiwari5908
    @jugaltiwari5908 5 років тому

    I Love your videos Dev Ed. Thank You so much.. Really appreciate your creativity.

  • @saumyashukla5013
    @saumyashukla5013 4 роки тому

    Thank you Dev Ed... You are amazing💥

  • @shoaibmiraki6631
    @shoaibmiraki6631 4 роки тому

    I looooveeeee youuuu boyyyy.... I love your coding and and your face when coding with love ❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️

  • @klesk44
    @klesk44 5 років тому +10

    Hello, FYI when you use console.log, String interpolation is not necessary to get it readable.
    You can use (with your example) console.log('Letter', i, 'is', logo[i].getTotalLength()) and have the same result :D

  • @edwindodoh164
    @edwindodoh164 5 років тому +1

    This guy looks so happy

  • @r.gtz.4521
    @r.gtz.4521 5 років тому +2

    You can also write:
    #logo{
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    }
    #logo {
    stroke-dasharray: 0 2000;
    animation: signature 12s linear forwards;
    }
    @keyframes signature {
    from {
    stroke-dasharray: 0 2000;
    }
    to {
    stroke-dasharray: 2000 0;
    }
    }
    in CSS (this is right after the step he finalizes at 7:53) then manipulate the 12 seconds (after - animation: signature) and/or the stroke values (after - stroke-dasharray:) to fit the style your looking to achieve, this is a similar end result.

  • @asadali4153
    @asadali4153 3 роки тому

    awesome... you clearly explain whats actually hapening.

  • @andrewmcwilliam1764
    @andrewmcwilliam1764 5 років тому

    You, sir, are a legend.

  • @fabiof4946
    @fabiof4946 5 років тому +1

    I want to see more complex animations!
    =D

  • @pabloenina
    @pabloenina Рік тому

    Thank you, works perfectly

  • @juanignaciolandolfi3673
    @juanignaciolandolfi3673 3 роки тому +1

    For those who gets one only path in the svg when making the copy/past. You have to right-click on the text and press 'Flatten' (Ctr + E in Windows). Then you can copy as svg.

  • @shahbokhari
    @shahbokhari 5 років тому +1

    Beautiful work man! Thank You

  • @mahdiazizi6342
    @mahdiazizi6342 5 років тому +2

    Bro u are sick 🔥🔥🔥

  • @UrraSergio
    @UrraSergio 5 років тому +1

    I got lost halfway! I subscribe to continue tomorrow (the lord of the sleepy is the one who is giving orders here).

  • @christiankeiling8112
    @christiankeiling8112 4 роки тому

    Hat mir gut gefallen, auch deine Art der Präsentation. Endlich versteh ich auch den größten Teil vom English. Ich komm wieder.

  • @Chocokaylarobin
    @Chocokaylarobin 4 роки тому

    You are the absolute BEST!!!