Try this Multi-Path SVG Scroll Animation Technique

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

КОМЕНТАРІ • 65

  • @DesignCourse
    @DesignCourse  Рік тому +39

    More SVG content to come! I love this stuff.

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

      Please do svg text smear and stretch having some bezeir

    • @theman7050
      @theman7050 Рік тому +1

      Yesss please continue on the svg path :)

  • @PaulMcCannWebBuilder
    @PaulMcCannWebBuilder Рік тому +17

    Appreciation for the vanilla stuff.
    To add:
    If the scrollPercentage == 1, transition in a fillOpacity (from 0, set in the CSS, to 1, set in the JS) so it fills in at the end.
    To stop the initial transition when the page loads, you can add a .preload * { transition: none !important;} and a preload class to the body and remove that class on the window load.

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

      ah yes, !important my old nemesis

  • @CarlMahnke
    @CarlMahnke Рік тому +5

    Love how simple the code behind this is!

  • @fersahahmet9597
    @fersahahmet9597 3 місяці тому

    this is a very smart hack of the stroke dash property of svg. i loved it

  • @dsdcorp
    @dsdcorp Рік тому +1

    Brilliant idea. Thanx.
    In browsers with "elastic scroll" ability, the scroll percentage may go out of range, like below zero and above 1. And it causes flickering when you reach the maximum scroll point. So after calculation the scrollPercentage value it should be trimmed like that:
    if (scrollPercentage1.0) scrollPercentage=1.0;

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

      Tell me if I'm wrong but JS parses 0.0 as 0, and 1.0 as 1 because the right side is equal to 0. So there is no need to add .0 to any integer.

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

      @@gknt7234 ​ You right. My style is dictated by other scripting languages where there is some difference between integer and float types. It guarantees correct parsing in any case.

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

    For not doing any web development myself I found this very instructive and well explained.

  • @krishtamboli7909
    @krishtamboli7909 Рік тому +7

    Please do negative space really waiting for it Love from India 🇮🇳 ❤️

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

    this is pretty cool. i think i can't wait for the watch.

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

    SVG is such an underrated tool

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

    You are very good at teaching, and thank you for zooming in.

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

    ❤incredibly smart. Thanks 👍

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

    Hi sir
    this a very insteresting video and you are a great teacher
    thanks

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

    Great tutorial. I tend to use Vivus and also Vivus instant for general animated svgs but this is great especially as its used with vanilla JS, css and scroll percentages. Great job.

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

    I love messing around with the SVG's to do some creative designs with. I have an extension that I use with VS Code called Svg Preview. When you have a svg file in VS Code the screen will split and show you the image. The image will update in real-time when making changes.
    👍

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

    It is so much fun to do stuff like this.

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

    Learned something new, thanks!
    Small nitpick btw, if you removed the style definition inside the SVG, might as well as remove the *cls-1* class of the ** :D

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

    WOW... thanks, this is super cool!

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

    very elegant and simple 👍
    (If I had approached the same problem i would have done it way to complicated)

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

    NGL, Cool & Easy!

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

    Thx for the lesson sir.

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

    this really helps me because I was thinking of making this sort of handwriting letter reveal and I cant just do a simple reveal from left to right...I have to make sure the letters are written like they would be written in hand and this multi-path svg scroll technique will be used..just without the scroll

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

    The result went very creative and professional.
    I am a free software adept, Gimp SVG conversion is messed, what are the great recommendations for download?

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

    You, Sir.. are AMAZING!!! Thanks for using vanilla JS. :D

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

    awesome dude!

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

    that was really cool!

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

    Nice one Gaz. I've created something similar for my own website. Looks super cool.

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

    Im typing this at the video intro, im curious to see if you can prevent repaints without something like greensocks, cuz that's what you use it for.

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

    Thank you for the great content as always.

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

    Very good content!! 😊

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

    just a suggestion can make a video about svgomg video tutorial for beginner?

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

    What tool he used to zoom & highlight in like that at around 1:53?
    Great video btw!

  • @ΒινςΜοργκαν
    @ΒινςΜοργκαν Рік тому

    Please Gary can you tell me your theme settings?

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

    nice video
    👍

  • @Teng-t8p
    @Teng-t8p Рік тому

    Why my console didn't show the length of the paths??

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

    what about if I have one path on my svg ?

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

    Hey man, Great tutorial as always. If we animate the svg in after effects and upload it as bg video, would that get us the same result ?

  • @electrolyteorb
    @electrolyteorb Рік тому +1

    You are featured on @Fireship 🤯

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

    I was wondering if you could share the whole formula to get the scroll percentage, because it got cut on frame, great video nonetheless!

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

      let scrollPercentage = (document.documentElement.scrollTop + document.body.scrollTop) / (document.documentElement.scrollHeight - document.documentElement.clientHeight);

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

    coding is hard .-. good thing people still hire front front front end designers. haha

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

    What about Figma? Is it possible to create this design by Figma?

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

      Yes, the SVG elements.

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

      @@DesignCourse It would be great to see a tutorial video of this

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

      @@Franbua it's not needed. Just use the pen tool in Figma to do the same thing I did in illustrator

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

      Just so we're clear, you can't create this type of animation in Figma. You can only complete the initial part of this tutorial in Figma (creating the svg shapes)

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

      @@DesignCourse That's actually what I was trying to find out. Thank you so much :)

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

    Hello, when i launch the page, drawing is complete before i scroll, i search something to change this :(
    Thanks for all :)

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

      I've found the solution by myself, opacity:0 in CSS, and this small line of javascript: path.style.opacity = 1;

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

    I wish people would spend less time on making scrolling look good and more time on getting rid of scrolling.

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

    When I saw the thumbnail of this video, I thought it was a girl on it. You could start wearing makeup too. LOL

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

    Love this but hard to not think how much easier this would be done in Webflow... You can do it in under a minute

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

    U looks brad pitt

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

    Dude, time for a haircut :)

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

    Don't use this unless you want to drain mobile device batteries

  • @ephrin-ligand
    @ephrin-ligand Рік тому

    man. vanilla JS is not what you think :) stop using this words)