Parallax scrolling in 3 lines of code!

Поделиться
HTML-код
  • Опубликовано: 28 сен 2022
  • I can't stop, won't stop making videos on Framer Motion because it's just too dang fun! Check out how to add parallax scrolling with so few lines of code that you can count em' on one hand.
    📖 useScroll docs: www.framer.com/docs/use-scroll/
    👉 Framer Motion course: samselikoff.com/framer-motion...
  • РазвлеченияРазвлечения

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

  • @mryechkin
    @mryechkin Год назад +4

    This is so good! Loving all the neat tricks. Looking forward to the full course!

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

    I can't wait for the course to drop 💪 thank you for an absolutely amazing content!

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

    I love the way and style you deliver your thoughts. Great stuff!

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

    can't get enough of your videos, very looking forward to your course!

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

    Dude, you're the living definition of the frontend. Thnx for the great content

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

    Hope your channel keeps growing, love your videos.

  • @isholapinheiro
    @isholapinheiro Год назад +18

    Always so glad when you drop content, easily one of my favorite content creators right now. Eagerly waiting for your course and this site to be released

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

      it's the voice right...

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

      @@jww0007 It is not the voice, Sam knows what he is talking about compared to most.

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

    Sam you're the absolute best, love the way you explained the scrollY concept. Thank you so much for this tutorial its exactly what I was looking for!

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

    I, too, cannot wait for the course to drop. Awesome vid, thanks.

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

    Makes a lot of sense, your very good at explaining things in plain english, I used Framer Motion on a website but I haven't messed around with scroll yet, now I have the confidence to try it!

  • @TasniMarwane
    @TasniMarwane 9 месяцев назад

    A trillion thanks Sam for this tutorial, it's exactly what I was looking for to complete my skills.
    Thank you very much 👍

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

    🔥effect looks amazing with the subtle background

  • @wfl-junior
    @wfl-junior Год назад

    That's so cool, and impressive how easy it is to do with framer motion.
    And it is very performant.

  • @user-sh5qp6uu1e
    @user-sh5qp6uu1e 10 месяцев назад +1

    I love this video’s preview SO MUCH! I can’t even express it 😅

  • @salmansadi9842
    @salmansadi9842 8 месяцев назад

    Great Video. Learned a lot. I saw parralax in other video but you explained more clearly. And I just needed to watch it once to understand.

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

    Favourite video so far!

  • @objectorientedguy6613
    @objectorientedguy6613 9 месяцев назад

    Best video reference for Parallax Effect, I have been looking for a long time and found one, it was simple and easy to understand.
    Thanks :)

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

    Thanks sam learning so much from your videos! Framer motion should link your videos as an official guide haha.

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

    I can't understand the instructions in the official document at all, but after watching your video and thinking about it for 3 seconds, I got it. Thank you.

  • @pavanchalla3787
    @pavanchalla3787 2 месяца назад

    crazy video, really helpful thank you brother

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

    thanks, a nice and effective support of Framer's documentation, super clear

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

    So cool! Thanks for sharing!

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

    Best content I found after searching all day 😍

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

    Another great one

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

    Just what i needed ^^ thx

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

    Awesome! Thank you much!

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

    you are a genius !!!!! 👍👍👍👍 chapeaux!!

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

    TNice tutorials the best tutorial I've ever watched! Super informatic and love the softow in wNice tutorialch you taught everytNice tutorialng. Thanks a lot

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

    First time seeing someone doing a code tutorial from the couch.. 😀👍

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

    thank u so much

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

    thank you

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

    Wow! I've used a specific library for this because I thought it would be too complicated with framer motion but you just proved otherwise! Thank you so much for the high quality content. I'm just curious... any specific reason you're using "let" instead of "const"?

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

    Loved the explanation and the solution you came up with. I'm in the same boat, I was always curious how to do this but never had a reason to implement it myself.
    Word to the wise though, from the guidance I've read we should be cautious with parallax effects from an accessibility standpoint. In a live app there should probably be a check if the user has a preference for reduced motion set, and if so this should be disabled.

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

      Totally agree, FM even has a useReducedMotion hook. Will point that out next time 👍

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

    Wonderful!
    I am eager to see this website live. Can you tell me how did you create that dotted grid style (seems wonderful, like a bluepritn)? As I can see you are not using css-grid but flex.

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

    really nice video setup also, how you explain from showing us from your couch 😁

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

    Very in-depth explanation.
    Want to see how you create the video section? Or you plain something else?
    Thank you

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

    thanks BRO, Hello from Uzbekistan, center of Asia
    👍👍👍

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

    Thanks for sharing. How do you set the subtle background image grid? & Where do you get those assets?

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

    The title appeals to draconian brevity and efficiency. The video's length completely undermines that.

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

    Amazing as always. Can you also use what you just taught us to create animations/transitions on scroll?

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

      Yes, but FM even has a high-level utility to make this super easy! www.framer.com/docs/use-in-view/

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

    awesome

  • @user-yi3rq7jk2r
    @user-yi3rq7jk2r Год назад

    good content

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

    Good teacher

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

    Are you going to be my favorite channel or what?😍❤

  • @super-blues
    @super-blues Год назад

    nice

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

    check out my 3 ingredient cake!
    1. boxed cake mix
    2. water
    3. eggs

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

    Subscribeed love your content smooth and steady

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

    Have a good walk, Sam

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

    How did you make those gradients?

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

    Hey i was wonderwing what fond do you use in that video

  • @eronorbi
    @eronorbi 9 месяцев назад

    Hi Sam! How were the layout faded lines created on the background? 🤔

  • @user-yi3rq7jk2r
    @user-yi3rq7jk2r Год назад

    record some of video about best practices and design patterns and testing and optimize react and next app

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

    Very nice explanation! How would you handle the situation where using vertical scroll (main mouse wheel or top bottom motion on trackpad) to scroll a horizontal container using Framer-Motion - basically a scroll hijacking, but also using useSpring() utility? I've tried to figure this one out using Framer, but results was not great and found an example in React-Spring using interpolate() and imperative API that I modified to my purpose that performance-wise works, well... okay.

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

      Hmm, that is a great question! So something like where scrolling vertically actually moves the page horizontally? I don't think you'd want the actual overflow to be in the x direction because things like touchpads would expect that to be done with actual horizontal scrolling (e.g. scrolling a bookshelf on Netflix homepage). Do you have an example I could look at that kinda shows off what you're talking about?

  • @ikindacode
    @ikindacode 11 месяцев назад

    This is awesome! But why am I getting a Typescript error when I do exactly what you do?
    Argument of type '{ target: MutableRefObject; offset: string[]; }' is not assignable to parameter of type 'UseScrollOptions'.
    Object literal may only specify known properties, and 'offset' does not exist in type 'UseScrollOptions'.ts(2345)

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

    Do you have an ETA for your course. Can't wait for it to drop.

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

      Going to be on buildui.com very soon! I'll be sure to send an email when it's ready if you want to sign up: samselikoff.com/framer-motion-course

  • @colonder8034
    @colonder8034 3 месяца назад

    How would you make this parallax responsive though? You haven't explained that in the video. I tried to apply the trick from your other video "Responsive Framer Motion with Tailwind CSS" by defining the custom CSS tailwind variable and passing it to the useTransform as, say, ["0%", "var(--scroll-end-max")] where I defined --scroll-end-max as [--scroll-end-max:0%] lg:[--scroll-end-max:-20vh] but it doesn't work. Framer motion somehow can't figure out how to scale between 0% and CSS var. If you scroll even a bit it immediately jumps to max value instead of extrapolating it within the range. Any advice?

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

    why you dont do full turtorial ?

  • @vishalsah7778
    @vishalsah7778 9 месяцев назад

    but isn't always scrolling background image even when it's not in view ?

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

    That will forever be a problem

  • @super-blues
    @super-blues Год назад

    very

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

    😲

  • @super-blues
    @super-blues Год назад

    really

  • @super-blues
    @super-blues Год назад

    its

  • @nileshshetty2496
    @nileshshetty2496 11 месяцев назад

    3 lines of code but 16 mins video??