Magnetic Buttons On Mousemove - Using HTML, CSS & Javascript

Поделиться
HTML-код
  • Опубликовано: 8 мар 2021
  • In this video, you will learn how to design buttons with magnetic hover effect on mousemove using HTML, CSS, and Vanilla Javascript.
    + Like and Subscribe 🔔 for More! 🖤
    ∎ Get This Project Source Codes - / magnetic-buttons-on-mo...
    Book Me 🔖
    -----------------------
    ∎ Book me to Fix your project Bugs & Issues - www.buymeacoffee.com/codingsn...
    ∎ Book me to Convert your Figma, PSD, and XD Design to an HTML Website - www.buymeacoffee.com/codingsn...
    ∎ Source Codes & Download Images - codingsnow.com
    ∎ Download Source Files On Patreon - / 48487539
    ∎ Facebook Page - / codingsnow
    ∎ Support From Paypal - paypal.me/codingsnowget
    Support My Works ❤️❄️
    --------------------------------------------
    ∎ Buymeacoffee - www.buymeacoffee.com/codingsnow
    ∎ Patreon - / codingsnow
    #MagneticButtons #ButtonsMagneticEffect
    ____________________
    Copyright Disclaimer under section 107 of the Copyright Act of 1976, allowance is made for “fair use” for purposes such as criticism, comment, news reporting, teaching, scholarship, education, and research. Fair use is a use permitted by copyright statute that might otherwise be infringing.

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

  • @osuolaleabdullahi9121
    @osuolaleabdullahi9121 2 года назад

    Amazing video mehn...I love it

  • @cloxton031
    @cloxton031 3 года назад +1

    Very simple, clean and well done!

    • @CodingSnow
      @CodingSnow  3 года назад +1

      Thank you very much!

    • @cloxton031
      @cloxton031 3 года назад

      @@CodingSnow codepen.io/cory-al-loxton/pen/ZEBVpEK My codepen that I added some of the magnetic button effect :)

  • @kieran2347
    @kieran2347 3 года назад +2

    Great video John Snow! Thank you and Love the background music its peaceful and melodious

    • @CodingSnow
      @CodingSnow  3 года назад +1

      You are so clever. Actually, the channel name was created based on that name. You're most welcome my friend! ❤

    • @kieran2347
      @kieran2347 3 года назад

      @@CodingSnow Cheers! I loved the "John Snow" Character lol so yeppers.
      Btw FYI, I started learning React about 2 weeks ago and wanted to build a portfolio for my freelancing then I realized I must learn more to get all the stuff working and the old site I had made was lame. So I used the dev portfolio site you posted, I'm using that. It's simple and to the point not like those ready-made templates with thousands of lines of code. I'm a bit struggling to align those cards in the "Services" section, I wanted 3 cards in a row but it's not letting me I got 6 cards in total not sure where I'm going wrong.
      Btw whereabouts you from buddy?

    • @CodingSnow
      @CodingSnow  3 года назад

      Cheers GOT fans!!
      To align cards row-wise, you need to do some simple changes to the service section and its styles friend.
      Replace service section HTML code like below,
      My Services
      Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.




      Web Design
      Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.



      Web Development
      Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.



      Motion Graphic Design
      Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.




      Web Design
      Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.



      Web Development
      Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.



      Motion Graphic Design
      Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.


      And add the below selector to the styles.
      .services .service-row{
      display: flex;
      justify-content: center;
      align-items: center;
      flex-wrap: wrap;
      width: 100%;
      }
      Study it, you'll understand.

    • @kieran2347
      @kieran2347 3 года назад

      @@CodingSnow Thank you so much! Appreciate the quick response ♥

  • @samuelk1623
    @samuelk1623 3 года назад

    Wow...😍😍😍..Amazing and amazing..Always love your works bro..I am a big fan of yours.

    • @CodingSnow
      @CodingSnow  3 года назад

      Thank you very much! 😊

  • @SameerKumar-ee4qj
    @SameerKumar-ee4qj 3 года назад

    Nice video man

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

    Amazing! But is it possible ANTImagnetic effect?

  • @CreativeTutorialsWeb
    @CreativeTutorialsWeb 3 года назад

    Amazing Video Bro

  • @Codeflex
    @Codeflex 3 года назад

    how you have created your channel intro , it is so cool

  • @seeker3686
    @seeker3686 3 года назад

    Nice!!

  • @ClavelinMathias
    @ClavelinMathias 2 года назад +2

    Congrats ! but U should add window.scrollY so that it works in any situation (long page)

    • @cheart95
      @cheart95 2 года назад

      Hi, thanks for your help, but on don't founs where we need yo put this command, can you say more ? Please

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

      @@cheart95 card2.forEach(element => {
      element.addEventListener('mousemove', function(e) {
      const position = element.getBoundingClientRect();
      const x = e.pageX - position.left - position.width / 2;
      const y = (e.pageY - position.top - position.height / 2) - window.scrollY;
      element.style.transform = "translate(" + x * 0.3 + "px, " + y * 0.3 + "px)";
      })
      });

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

      THANK YOU. I was very confused as to why it wasn't working, in my case it was always translating my div down even when entering from above. Turns out I had to subtract the window offset as you suggested here.
      For those wondering, here's the code that worked for me:
      const position = event.target.getBoundingClientRect();
      const x = event.pageX - window.scrollX - position.left - position.width / 2;
      const y = event.pageY - window.scrollY - position .top - position.height / 2;

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

      @@JomaSnow i had no idea how to implement this thank youuuu

  • @syediqbalahmed3176
    @syediqbalahmed3176 2 года назад

    good ... ocay ...

  • @Reshad.Dawlat1
    @Reshad.Dawlat1 3 года назад

    & news box design record plz

  • @theclassicalstatus5625
    @theclassicalstatus5625 3 года назад +1

    How to make Jarvis pls sir

  • @OsmanEnayat
    @OsmanEnayat 2 года назад

  • @Codeflex
    @Codeflex 3 года назад +1

    how you have created your channel intro , it is so cool

    • @CodingSnow
      @CodingSnow  3 года назад

      Thanks!, with Aftereffects