CSS can't animate gradients, but SVG can

แชร์
ฝัง
  • เผยแพร่เมื่อ 18 ธ.ค. 2024

ความคิดเห็น • 32

  • @tedsomething
    @tedsomething 2 ปีที่แล้ว +5

    Thank you! Really enjoyed the trick where it seems more like a random blob instead of a linear or radial gradient.

    • @MattVisiwig
      @MattVisiwig  2 ปีที่แล้ว

      You're welcome Teodors! Yeah, it is a nice simple trick to achieve dancing colors rather than the basic gradients we're accustomed to.

  • @kaustavroy6542
    @kaustavroy6542 ปีที่แล้ว +4

    Great man , I didn't know we can do this stuff so easily with svg.

    • @MattVisiwig
      @MattVisiwig  ปีที่แล้ว

      SVG is indeed powerful!

  • @sovereignlivingsoul
    @sovereignlivingsoul 9 หลายเดือนก่อน +1

    thanks, i am experimenting with svg's by making logos and animating the gradients is a great addition to what i am doing

    • @MattVisiwig
      @MattVisiwig  9 หลายเดือนก่อน

      Sounds like a great application

  • @SuggonM
    @SuggonM 11 หลายเดือนก่อน +1

    Never thought I could combine both gradient and animation! By the way a question, which vscode extension are you using? It looks super convenient

    • @MattVisiwig
      @MattVisiwig  11 หลายเดือนก่อน +1

      It's called 'SVG' and it's by 'Jock'

    • @TACDetective
      @TACDetective 8 หลายเดือนก่อน

      @@MattVisiwig I cant get that extension to work in win 10, do you know if there some tweak required please?

    • @MattVisiwig
      @MattVisiwig  8 หลายเดือนก่อน

      @@TACDetective I do not. It's worked for me on W8 and W11. I don't have many other extensions, so maybe you have a conflict?

  • @Cameronmcc
    @Cameronmcc ปีที่แล้ว +1

    Wow this reminds me of the beautiful stripe homepage! Thanks for the video!

    • @MattVisiwig
      @MattVisiwig  ปีที่แล้ว

      Thanks for the compliment :)

  • @seiuwatches
    @seiuwatches ปีที่แล้ว +1

    Great explanation and video!

    • @MattVisiwig
      @MattVisiwig  ปีที่แล้ว

      Glad you thought so :)

  • @ΝικόλαοςΤζουνάκος
    @ΝικόλαοςΤζουνάκος 2 ปีที่แล้ว

    Thanks for the tutorial!

  • @boydriver2978
    @boydriver2978 8 หลายเดือนก่อน

    could an image on a transparent background be overlaid on this for a hero section please?

    • @MattVisiwig
      @MattVisiwig  8 หลายเดือนก่อน +1

      Yes, I don't see why not. You could easily nest DIVs, where the animated gradient background is applied to the outer DIV and the transparent background is applied to the inner DIV.
      Alternatively, you can place multiple backgrounds comma separated in the background-image property, like so:
      background-image: url('image_1.svg'), url(image_2.png);

    • @boydriver2978
      @boydriver2978 8 หลายเดือนก่อน +2

      @@MattVisiwig maybe that could be your next video.......please?

    • @MattVisiwig
      @MattVisiwig  8 หลายเดือนก่อน +1

      @@boydriver2978 That's a good idea, but since that's not happening today, I also have an article I wrote, just scroll down to the "Layering multiple background images" section.
      www.svgbackgrounds.com/how-to-add-svgs-with-css-background-image/

  • @danieldiacon730
    @danieldiacon730 ปีที่แล้ว +1

    Thank you very much!!

    • @MattVisiwig
      @MattVisiwig  ปีที่แล้ว +1

      You're welcome Daniel

  • @Claxiux
    @Claxiux ปีที่แล้ว

    Nice, thank you !

  • @TACDetective
    @TACDetective 8 หลายเดือนก่อน +1

    Hi, 2 years on so maybe you won't see this comment. Great video. Your values are named colours ie red,ble,green etc but in xml colour is represented by statements, such as #rrggbb. If you wanted to mix up the colours could you do that using "jade geen" or could you change the colours using statements please?

    • @MattVisiwig
      @MattVisiwig  8 หลายเดือนก่อน +1

      I chose to use HTML color names (blue, green, etc.) because it's much easier to understand the color you'd expect for this demo. I personally opt for hex codes, but any valid HTML color code or color name would work.

  • @OPticalp0intV1
    @OPticalp0intV1 ปีที่แล้ว

    How would you put this on a path?

    • @MattVisiwig
      @MattVisiwig  ปีที่แล้ว +2

      and elements behave the same way. However, if you meant STROKE or OUTLINE of a shape when you said PATH, then instead of placing the gradient ID in the FILL, you'd place it in the STROKE attribute and ensure it has a STROKE-WIDTH.

  • @Human_Evolution-
    @Human_Evolution- 2 ปีที่แล้ว +1

    How is an SVG even made using only HTML? Or is it? I need a whole course on the SVG element before I can animate them.

    • @MattVisiwig
      @MattVisiwig  2 ปีที่แล้ว +1

      SVG looks like HTML, but it's technically XML. But inline SVG code will work right inside HTML code.

    • @Human_Evolution-
      @Human_Evolution- 2 ปีที่แล้ว +1

      @@MattVisiwig I have heard of this XML, but I am so lazy. I never Google it.

  • @VideoNOLA
    @VideoNOLA ปีที่แล้ว

    Emphasis on the first syllable in ATtribute. Unlike "a tribute", which is what I'm hearing here.