Awesome Card Flip Animation using CSS & JavaScript - Easy tutorial

Sdílet
Vložit
  • čas přidán 8. 09. 2024

Komentáře • 130

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

    I used this as a base to make an ionic vue simple card game. Thank you

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

    Javascript doesn't stop to amaze me

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

    I really laughed when I found we got the same theme, cool video btw

  • @d.ashley879
    @d.ashley879 Před 2 lety

    Did anyone else get overlapping text on the card when you used "Lorem" or any other longer text in the tag?

  • @aloobre
    @aloobre Před 4 lety +4

    More of this, really like these easy tutorials..so good for inspiration

    • @TylerPotts
      @TylerPotts  Před 4 lety +1

      Thank you! Will do!

    • @abdullahboston6963
      @abdullahboston6963 Před 3 lety

      You probably dont give a shit but if you guys are stoned like me during the covid times you can stream all the latest movies and series on instaflixxer. Been streaming with my brother for the last months =)

    • @franciscohen1299
      @franciscohen1299 Před 3 lety

      @Abdullah Boston Definitely, have been watching on InstaFlixxer for since november myself :)

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

    You deserve millions of subs. I accidently found this channel but the content is golden so I'm staying :)
    Thanks and keep up the good work.
    Superb content and presenting format.

  • @qwarlockz8017
    @qwarlockz8017 Před 2 lety +3

    This was a really great vid. It was clear and easy to follow and sort of set a lot of things in place. Thanks for the help and great work!

  • @user-ck8xt6hl2k
    @user-ck8xt6hl2k Před 2 měsíci +1

    Great video! That was exactly what I was looking for. Thanks!

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

    i stumbled on this video and i have to subscribe

  • @santiagoramirez5507
    @santiagoramirez5507 Před 3 lety +2

    Thank you so much!! Using this technic I'm gonna make prettier websites!
    Greetings from Chile!!

  • @prathamgenius
    @prathamgenius Před 2 lety

    Awesome buddy!!!! I used it for my Ecommerce Website.....Loved this.....Well explained

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

    looked on alot of these videos and liked this the most. Thanks man for a really good tutorial.

  • @boneykingofsomewhere
    @boneykingofsomewhere Před 2 lety

    Just found your videos and I love them! your videos are short-ish and well explained, these are good things. 12 hour react course is just a bit much from others lol

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

    Wow! Amazing video Tyler ! Thank you so much for sharing. Is it another video explaining how is the process if I want to create more flashcards ? Like 100 for example. I would like to create flashcards to study. Thank you in advance. !

    • @TylerPotts
      @TylerPotts  Před 2 lety +2

      Hey E.B, a lot of people have asked for this so I'm going to create another video explaining how you can create multiple flip cards on a single page!

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

      @@TylerPotts That's will be great Tyler! Thank you so much :)

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

    Tyler, this tutorial is so awesome. You are awesome!!!

  • @Sol-ty5nx
    @Sol-ty5nx Před 2 lety +1

    I love it! thank you. Greetings from Argentina

    • @TylerPotts
      @TylerPotts  Před 2 lety

      Thank you for watching! Hello in Argentina!

  • @manohisoa
    @manohisoa Před rokem

    Thanks a lot for this video! It was really helpful. Very simple and straightforward.

  • @malamhari_
    @malamhari_ Před 4 lety +2

    Thanks for this, learn so much

  • @kaderlakhdar5735
    @kaderlakhdar5735 Před 3 lety +2

    Lovely tutorial , keep on the hard work, it would be nicer to have your server window open on the side , this helps understand better the process and notice changes at ones it happens 👏👏

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

    A very good tutorial, everything is very clear. Thanks a lot!!!

  • @gabriel_lk
    @gabriel_lk Před rokem

    Thanks a lot!

  • @bedtimehorrorstoryyoutube
    @bedtimehorrorstoryyoutube Před 11 měsíci

    Freaking great! Crystal clear! Thank you !!

  • @duck_it
    @duck_it Před 4 lety +1

    I want more............ Thank you so much.

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

    OutStanding!

  • @maefaemusic
    @maefaemusic Před 2 lety

    Great vid! Thank you so much. This is perfect for the project I'm working on

  • @hvariawa
    @hvariawa Před 4 lety +1

    Brilliant tutorial

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

    Great vid, I do appreciate. Just what I needed to see...

  • @ricardoreales7316
    @ricardoreales7316 Před 2 lety

    excellent code... very useful... thank you very much

  • @estebanpedroguerravidal8336

    I love it. Thanks 👌

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

    i love u, thx!!! i need this

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

    Nice video, everything works! Thanks a lot ;)

  • @bepd
    @bepd Před 4 lety +1

    Loved this

  • @user-xk2dj4zi2p
    @user-xk2dj4zi2p Před rokem

    Thanks a lot, brother but can you please let me know How I can add multiple cards on a single page.

  • @oguzozdemir8886
    @oguzozdemir8886 Před rokem

    Good job Tyler. I would also suggest adding...
    body { overflow: hidden; }
    .card { margin-top:50px; }
    Also thank you...

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

    On the site, you need to turn over 8 different cards, but it works only on the very first one. Why?

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

      That's because we only target 1 card using querySelector if you want to select multiple you need to use querySelectorAll then loop through the results and apply the event listeners

    • @eugeneskrypnyk7396
      @eugeneskrypnyk7396 Před 2 lety

      @@TylerPotts thx)

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

    How can I put multiple cards in row? Next to each other?

    • @TylerPotts
      @TylerPotts  Před 2 lety

      You need to select all elements and not just thebone

  • @andrearivera7065
    @andrearivera7065 Před rokem

    Thanks, this was very helpfull ♥

  • @limpmebrasil4991
    @limpmebrasil4991 Před 2 lety

    Hey great video, thank you!
    Would it be possible to flip the card clicking a button instead of tapping the card?

  • @samjoseph5718
    @samjoseph5718 Před rokem

    Great video!

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

    Easy and effective! I used it for my interview work! Thanks a lot!

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

      Glad it helped!

    • @tamaskosa3283
      @tamaskosa3283 Před 3 lety

      @@TylerPotts The markup & css is simple enough to easily understand the mechanics behind it. However I still don't know how the css "knows" which html elements to use for card front and back sides.
      Is it because you set "transform-style:preserve-3d;" on an HTML element which MUST have exactly 2 children of which the first will be displayed on default and the second after the transformation?
      The mechanic goes hidden behind the scenes and I'd like to understand what's happening.
      Thanks again! 🙂

  • @HosseinPi921
    @HosseinPi921 Před 2 lety

    plz tell a tutorial about html and css to learn from basic
    tnx

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

    Wow 👍

  • @parkerthomson1447
    @parkerthomson1447 Před rokem

    Would someone happen to know why the back of the card is in the correct color but the side with all the content is a light gray? This is from me trying to learn and follow along I dont see what I messed up

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

    Hello! Thanks for this great tutorial. Im not much of a programmer so I have one problem. When I copy whole div with class card to have 2 cards with diferent descriptions, one/first can flip and the other cant. What should I change in js to have both cards flip?

    • @thomassavino3813
      @thomassavino3813 Před 2 lety

      I'm having the exact issue. I was hoping there'd be a reply.

    • @richardala3784
      @richardala3784 Před 2 lety

      @@thomassavino3813 use for each in javascript

  • @w.gene28
    @w.gene28 Před rokem

    i know its been two years but now i am here and i actually followed the whole video and fix some of my mistakes but i cannot seem to figure out why my p tag is taking a limited amount of text and whenever its exceed and number of lines it all crashes and scramble into each other , like its a total mess. Please help.

  • @doublevizzion
    @doublevizzion Před rokem

    I keep getting cannot read properties of null (reading 'addeventlistener')

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

    Hey, how would I make this work for more than one card?

    • @TylerPotts
      @TylerPotts  Před 2 lety

      Instead of selecting one card you'd need to select multiple with something like "querySelectorAll" then loop through and apply the same code - I hope that helps.

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

    Could anyone explain me where is_flipped is declared as class in html., because he is calling it in css and also added it in JS. Please explain

    • @TylerPotts
      @TylerPotts  Před 2 lety

      It gets applied to the ".card__inner" div via javascript but is not declared in the HTML it is only set via JavaScript.

  • @stefanpfadt4353
    @stefanpfadt4353 Před 2 lety

    Hey cool ☺ Any chance to start the flip when you toggle a switch? (e.g. monthly to yearly)

  • @dowelg1071
    @dowelg1071 Před 2 lety

    is there a way to make the container thicker on the side view when flipped?

  • @zepherscotty
    @zepherscotty Před rokem

    This is fantastic, but how come I can't copy it & make more than one? When I try to make a second card & either try to add a ".card__inner2" for example to the Javascript, It doesn't work, or if I copy & make a completely new JavaScript code & add ".card__inner2" to it's own version of the Javacode, it makes both cards stop working. I know this is 3 years old but I would love to know why.

  • @DllacyLimaJr
    @DllacyLimaJr Před 2 lety

    Muito bom o vídeo parabéns

  • @Michael-yb1bm
    @Michael-yb1bm Před 2 lety +1

    Hey! Sorry for asking, but i have a short question. How do i change the js, so that multiple cards would work?

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

      It's hard to explain over text but you need to use a querySelectorAll and loop through each one then apply the events

    • @Michael-yb1bm
      @Michael-yb1bm Před 2 lety

      @@TylerPotts yeah so thanks for answering so fast. I know, that I have to use querySelctorAll and I already tried it but somehow my code doesn't work.
      And btw. great tutorial
      My code:
      let card = document.querySelectorAll(".card__inner");
      card.forEach((link) => {
      card.addEventListener('click', function(e) {
      this.classList.toggle('is-flipped');
      });
      });

    • @TylerPotts
      @TylerPotts  Před 2 lety +2

      Instead of card.addevent try link.addevent your still referencing the list of cards instead of the individual one!

    • @Michael-yb1bm
      @Michael-yb1bm Před 2 lety +1

      ​@@TylerPotts Oh finally it works! I literally can't say thank you enough

    • @vitoriaaguiar3379
      @vitoriaaguiar3379 Před 2 lety +7

      Hi, if u replace the js code for this one, it will work
      ´´const card = document.querySelectorAll(".card__inner");
      function flipCard() {
      this.classList.toggle('is-flipped');
      }
      card.forEach((card) => card.addEventListener("click", flipCard));´´

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

    Hi, this tutorial was really helpful!! everything seems to work perfectly using chrome, but... using Safari instead, the property -webkit-backface-visibility: hidden; seems to work only on the front face of the card, while when the card is flipped i can see through the back face and i dont know how to fix that. is there any solution to this weird problem? :/

    • @TylerPotts
      @TylerPotts  Před 2 lety

      I'm unsure I'd have to take a further look. Sorry.

  • @user-gw6hy1md4b
    @user-gw6hy1md4b Před 2 lety

    i want to make 6 cards on the same page but just copy and paste the code does not work i tried some other things but none of them worked, how can i do ?

  • @romannovak375
    @romannovak375 Před 3 lety +2

    hi thanks for the tutorial
    if I add another card it doesn't work it please help XD

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

      You would need to change the document.querySelector to document.querySelectorAll and then loop through the results...

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

      const card = document.querySelectorAll(".card__inner");
      function flipCard() {
      this.classList.toggle('is-flipped');
      }
      card.forEach((card) => card.addEventListener("click", flipCard));
      thx works XD

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

      @@romannovak375 Woo happy you understood what you said! My comment wasn't very clear :)

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

    How to stop backface to rotate if there is a link?

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

      Hey Paul, did you find the answer to this??

    • @paulmoldovan9518
      @paulmoldovan9518 Před 3 lety

      @@IspittingFactzz no

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

      Hey Paul, It's hard to explain over text but you need to check the click path to check what was clicked and if it was a link return / stop propagation... If you need further help feel free to join the discord I can help more there.

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

      @@TylerPotts Hey. Thanks. Yepp its allready made.

    • @lucasdahl1118
      @lucasdahl1118 Před 2 lety

      @@paulmoldovan9518 Did you get it to work?

  • @alquran549
    @alquran549 Před 9 měsíci

    how to change image in this code? please help meeeeeeeeeeeeeeeeeeeeeeeeee

  • @shubkale376
    @shubkale376 Před 3 lety

    12:37 line.76 can you please elaborate more on the " .card__header::after "

  • @abgthscode6326
    @abgthscode6326 Před 2 lety

    not wroking for multiple cards

  • @imanbenetlewis6365
    @imanbenetlewis6365 Před 2 lety

    Is there a way to do this without the code? Like an app or a beginner friendly version?

    • @TylerPotts
      @TylerPotts  Před 2 lety

      Umm I only ever work with code so I don't know

  • @mikheilrukhadze8782
    @mikheilrukhadze8782 Před 2 lety

    its not working on me can u help?
    on call or something

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

    How can I do to place 2 or more cards?

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

      I've been asked multiple times for this so I will probably create a revised video :)

    • @vitoriaaguiar3379
      @vitoriaaguiar3379 Před 2 lety +3

      Hi, if u replace the js code for this one, it will work
      ´´const card = document.querySelectorAll(".card__inner");
      function flipCard() {
      this.classList.toggle('is-flipped');
      }
      card.forEach((card) => card.addEventListener("click", flipCard));´´

    • @JimmyDevAndGeek
      @JimmyDevAndGeek Před 2 lety

      @@vitoriaaguiar3379 Thanks.😁

    •  Před 2 lety

      @@vitoriaaguiar3379 I LOVE YOU YOU SAVED MY LIFE :')

    • @thomassavino3813
      @thomassavino3813 Před 2 lety

      @@vitoriaaguiar3379 Thank you! Thank you! Thank you!

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

    can you please provide code files? I want to use them as for my reference bro.

    • @TylerPotts
      @TylerPotts  Před 2 lety

      The link is in the description ? :)

  • @elschilling
    @elschilling Před 2 lety

    😍🤗

  • @factking2241
    @factking2241 Před 2 lety

    nyc tutorial !, can u pls tell me how to flip the page from the other side, like it is getting flipped from the side at which it is written card front, but I want it to get flipped from the other side where it is written the information....
    Please reply !, I want to know

  • @glendonphilippbaculio1811

    how can i rotate in 1 direction?

    • @TylerPotts
      @TylerPotts  Před 2 lety

      I'm not sure what you mean! If you need help feel free to join the discord and as there :)

  • @ranjeet5806
    @ranjeet5806 Před 3 lety

    Advice: instead of focusing more on styling, try to explain more about the Crux, the flipping effect, and the backface and stuff.

    • @TylerPotts
      @TylerPotts  Před 2 lety

      Thanks for the feedback. I'll keep that in mind for future videos

  • @Ricardoromero4444
    @Ricardoromero4444 Před rokem

    Would be nice if the tutorial showed only the flipping animation. We have to skip through the whole video just to get to the part we came to learn

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

    Thank you so much!