Cool UI Effect with SVG Clip Path, CSS Aspect Ratio & More..

Sdílet
Vložit
  • čas přidán 29. 06. 2024
  • bit.ly/2MMrQSq - Become a frontend developer (50% off limited time!)
    -- Want to learn UI/UX? designcourse.com​
    -- Today, we're going to hop back into the world of frontend development (of the intermediate/advanced variety) to create a cool UI effect using SVG clip path, the new CSS aspect-ratio, and much more.
    Codepen demo for this project:
    codepen.io/designcourse/pen/q...
    Unsplash credits:
    unsplash.com/photos/GYumuBnTqKc
    unsplash.com/photos/xT7OuIFew3Q
    0:00 - Introduction
    1:46 - An Awesome Offer
    2:20 - Creating the SVG
    5:00 - Project Structure
    6:18 - Writing the HTML
    9:43 - Writing the CSS
    21:10 - Closing
    Let's get started!
    - - - - - - - - - - - - - - - - - - - - - -
    Subscribe for NEW VIDEOS!
    Learn UI/UX: designcourse.com
    My personal FB account: logodesigner
    Coursetro FB: coursetro
    Coursetro's Twitter: / designcoursecom
    Join my Discord! / discord
    ^-Chat with me and others
    - - - - - - - - - - - - - - - - - - - - - -
    Who is Gary Simon? Well, I'm a full stack developer with 2+ decades experience and I teach people how to design and code. I've created around 100+ courses for big brands like LinkedIn, Lynda.com, Pluralsight and Envato Network.
    Now, I focus all of my time and energy on this channel and my website Designcourse.com.
    Come to my discord server or add me on social media and say Hi!
  • Jak na to + styl

Komentáře • 75

  • @DesignCourse
    @DesignCourse  Před 3 lety +8

    What are some other UI effects/practices/techniques should I feature?

    • @EshwarNorthEast
      @EshwarNorthEast Před 3 lety

      Can u make like all typical animations like slide up and reveal, and all those? From scratch without using any library?

    • @SantotoLeandro
      @SantotoLeandro Před 3 lety +4

      Hi Gary!! This was awesome! Can you please share that article about the "hack" that you mention in the video? Thanks!

    • @otazkin2937
      @otazkin2937 Před 3 lety

      Modal forms with calendar, time pickers and so on :)

    • @darklucifer2853
      @darklucifer2853 Před 3 lety +1

      Hey I don't know why but on clipping that svg the image just disappeared 😓

    • @wamukota
      @wamukota Před 2 lety

      You mention an article, that explains why you should use the "0 0 1 1" viewbox but you never linked to it

  • @hammad-ilyas
    @hammad-ilyas Před 3 lety +37

    Floating head tutorials!

  • @sidson_aidson
    @sidson_aidson Před 3 lety +4

    From a fullstack developer...I love these sort of 'cool discoveries' and your channel has been delivering for YEARS (at least for me)!
    Oh btw, if you hit Ctrl + Alt + F in vscode, it will automatically format your code! I noticed that you hit tab very often!

  • @andreja107
    @andreja107 Před 3 lety +27

    "The deer is actually right here, unfortunately I cut it's head off "
    -Gary Simon 2021

    • @Z3ROR
      @Z3ROR Před 3 lety

      Counts as a zombie too :P

    • @dev10shah
      @dev10shah Před 3 lety +1

      gARRY SIMON'S FACE IS ALSO CUT OFF BUT IT IS LIVING

    • @NBA6Fan
      @NBA6Fan Před 3 lety

      Its head actually got moved to bottom left side

  • @magdasokolovic
    @magdasokolovic Před 3 lety

    I admire how consistent and productive you are with your videos. Each video teaches me so much. Thanks!!

  • @omkarkottawar8309
    @omkarkottawar8309 Před 3 lety

    You're the best Gary!!! Keep it up!!

  • @thepunisher1917
    @thepunisher1917 Před 2 lety

    Dude, you are a Godsend. Your channel is a goldmine. Thanks for sharing your skills.

  • @hossamayman3587
    @hossamayman3587 Před 8 měsíci

    I just want to say one thing I love you OMG it helps me a lot after 3 hours of searching and you come to save the day ♥♥

  • @maviniii
    @maviniii Před 3 lety

    You are the best sir, please keep it up!

  • @sonoftroy8572
    @sonoftroy8572 Před 3 lety +6

    I was actually more interested in the css filter rule and how it applied the shadows

  • @abhishekshukla7803
    @abhishekshukla7803 Před 3 lety +1

    Today, I was searching for how to make a Svg clip path, Thank You it was great help.

  • @rahulsbhatt
    @rahulsbhatt Před 3 lety

    Your videos are gold🔥🙏

  • @juanmolinas
    @juanmolinas Před 3 lety

    Hi Gary!, that's cool!, greetings from Paraguay!

  • @yahyawiab1423
    @yahyawiab1423 Před 3 lety

    I have so much fun watching your Tuto

  • @ViktorOddy
    @ViktorOddy Před 3 lety

    Got idea for my next vid, thanks 😊

  • @elmalleable
    @elmalleable Před 3 lety

    Epic work

  • @egbaogheneakon4266
    @egbaogheneakon4266 Před 3 lety

    Love it 😍

  • @ilyesbrh7667
    @ilyesbrh7667 Před 3 lety +1

    nice closing

  • @christian_life
    @christian_life Před 3 lety +1

    muy buen tutorial, muchas gracias, muy buenos los atributos que utilizaste, no conocía el aspect ratio. por cierto ¿qué le sucedió a tu cabello?... me gustan tus videos.

  • @rattansingh4081
    @rattansingh4081 Před 3 lety

    You are great boss👍

  • @akshayvb6854
    @akshayvb6854 Před 3 lety

    Dope🔥

  • @frz_akbar
    @frz_akbar Před 3 lety

    awesome tutorials

  • @Anth-ony
    @Anth-ony Před 3 lety +1

    It hurts me when I see people clicking the taskbar to switch between programs. ALT + Tab is your best friend when it comes to switching quickly. Other than that, this video was really cool and inspiring. Think I'm going to test something like this out except with some more complicated shapes. I'm hoping it won't be too difficult. I'm assuming I can't use the aspect ratio thing if I want it to work on all browsers.

  • @kapilxtio3330
    @kapilxtio3330 Před 3 lety

    Awsm

  • @tomaszkumiega4325
    @tomaszkumiega4325 Před 3 lety +3

    Hey, can you share link to the article with this 1x1px svg hack?

  • @shekishral6570
    @shekishral6570 Před 3 lety

    You should probably use more the browser inspect so that one can see live the changes.

  • @pauljohn3898
    @pauljohn3898 Před 3 lety

    cool

  • @ShantanuAryan67
    @ShantanuAryan67 Před 3 lety +1

    4:08 so that scale factor == size in px ?

  • @BranGRadio
    @BranGRadio Před 2 lety +1

    I tried the viewbox trick with a more complex shape but it ended up slightly cropped on the edges...

  • @strange5700
    @strange5700 Před 3 lety

    1:12 the dear is actually right here

  • @ildikoedit9110
    @ildikoedit9110 Před 2 lety

    I just love that you cut out the eyes and the face of the deer :O Huge fail

  • @einfachnurlegendar7947

    Couldnt this also be done by overlaying those 2 pictures and setting a mix-blend-mode?

  • @sblanz
    @sblanz Před 3 lety

    I'm trying to do something similar but moving the clip-path to css file instead of having that in the html, but I'm having troubles with the centering of the clip-path. Anyone tried that?

  • @franktielemans6624
    @franktielemans6624 Před 3 lety +4

    I tried to recreate this with another simple shape that I made in Illustrator, scaled it to 1px * 1px and exported it as an svg.
    I cleaned up the svg and added the defs an clipPath bit, gave it an id,... Wrote the CSS and it didn't work.
    First thing I noticed when I look at the exported SVG was that the viewbox is not 0 0 1 1 but 0 0 0.1 0.1.
    Second, I see it exported in group, it has an ID from the layer and even a data attribute (data-name).
    I deleted all that code, so I only have the path.
    Also, when I look at your svg I see a transform translate property in the path. Where is this coming from?
    I don't have that, I only have the path coords in the svg.
    Strange thing is, when I copy paste your path from the codepen, it does work.

    • @amankothari220
      @amankothari220 Před 2 lety +1

      The same thing happened to me you are right bro

    • @shreyanshsharma9228
      @shreyanshsharma9228 Před 2 lety

      Just try using with only by adding id to clipPath tag don't delete anything

  • @medusiora8695
    @medusiora8695 Před 2 lety +1

    Could you share the article that you talking about SVG file please ?
    I'm a web developer, That's interesting article.
    Thanks.

    • @irfantayyib
      @irfantayyib Před 2 lety

      If you find it, share it with me please.

  • @sushantkunkekar2155
    @sushantkunkekar2155 Před 3 lety

    First one to comment..you are simply the best

  • @mondejarmarron18
    @mondejarmarron18 Před 2 lety

    How can we change the shape of svg using animation?

  • @muhaimincs
    @muhaimincs Před 3 lety

    Can you do it side by side screen instead of keep switching it

  • @sriramsrinivasan4965
    @sriramsrinivasan4965 Před 3 lety +3

    When is designcourse.com getting released , eagerly waiting

    • @Tsomimotso
      @Tsomimotso Před 3 lety

      me too but I haven't found any release info yet

  • @metelomaniac
    @metelomaniac Před 2 lety

    Man I was dealing with that in Figma, even if I would set the height 1 and width was less than 1px (constrained proportions) it was being bigger than 1px. Then I just removed "constrain proportions" and set the width and height both to 1px and boom, problem solved!

  • @anfas184
    @anfas184 Před 3 lety

    awesome but too frequent advertisements are killing it

  • @qwerty74
    @qwerty74 Před 3 lety

    Ok this is actually scary.

  • @siamekanto
    @siamekanto Před 3 lety +1

    2:59 That's what she said

  • @manpatel6984
    @manpatel6984 Před 3 lety

    I always use Figma to make stuff like this and then import it as an img. Is that fine??

  • @davidfitcher2953
    @davidfitcher2953 Před 3 lety

    what does the hair say?

  • @oleksandrleskiv
    @oleksandrleskiv Před 3 lety

    12:14 I though there was going to be a punchline

  • @olegkoselev6975
    @olegkoselev6975 Před 3 lety

    Hi I found one issue... there is huge blank space under your design. How to get rid of that?
    If I use clip-path then svg itself is always place somewhere on the worst palce :D
    Does anyone has any advice ? Thanks ))

    • @ze_chooch
      @ze_chooch Před 3 lety

      I’m not at an editor to test this out, but you can try adding a div around the content, then using flexbox, then aligning the items to center.

    • @BranGRadio
      @BranGRadio Před 2 lety

      you can include your svg without pasting it into your HTML with clip-path: url( [path-to-your-svg].svg#your-id )

  • @manwailai7828
    @manwailai7828 Před 3 lety +1

    In my opinion, I will cut off the deer too and move it in front to look better.

  • @doriomer
    @doriomer Před 3 lety

    Gary, first of all thanx for your tuts.
    But with all the respect, if you can't explain something - it means you dont understad it.
    Maybe this tut would be better if you make it with a shape that is not the same width and height.

  • @Moopse101
    @Moopse101 Před 6 měsíci

    i can't for the life of me get this to work, so frustrating!

  • @aravindhhere
    @aravindhhere Před 3 lety

    First comment squad😘😘😘😘

  • @vampirejs758
    @vampirejs758 Před 3 lety +1

    How are your pets ?

  • @senior_developer
    @senior_developer Před 3 lety

    Flying head

  • @Arttyor
    @Arttyor Před 3 lety

    Why....Why would you use svg for as simple element as box with rounded corners?
    If you already showing clip-path at least do some unique shape.

  • @tailofahippopotamus9775

    Please put a trigger warning before showing decipitated animals (and Garies)