Awesome Card Flip Animation using CSS & JavaScript - Easy tutorial

  Рет қаралды 70,978

Tyler Potts

Tyler Potts

3 жыл бұрын

Learn how to create an awesome animating card flip with only the use of HTML, CSS and JavaScript. You can use this in games, website reveal cards or even for a portfolio piece!
Github repo: github.com/TylerPottsDev/card...
// JOIN THE DISCORD
/ discord
// FOLLOW ME ON TWITTER
/ tyler_potts_
// INTERESTED IN GAME DEV?
Game development channel: / muddywolf
// CHECK OUT MY GAME
play.google.com/store/apps/de...
// SUPPORT MY GRIND
Patreon: / tyler_potts_
LIKE // SUBSCRIBE // SHARE // COMMENT
#CSS #JavaScript

Пікірлер: 131
@qwarlockz8017
@qwarlockz8017 2 жыл бұрын
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!
@kristofbalinth2071
@kristofbalinth2071 2 жыл бұрын
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.
@TylerPotts
@TylerPotts 2 жыл бұрын
Wow, thanks!
@boneykingofsomewhere
@boneykingofsomewhere 2 жыл бұрын
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
@kajberg9111
@kajberg9111 3 жыл бұрын
looked on alot of these videos and liked this the most. Thanks man for a really good tutorial.
@TylerPotts
@TylerPotts 3 жыл бұрын
Glad you liked it!
@prathamgenius
@prathamgenius 2 жыл бұрын
Awesome buddy!!!! I used it for my Ecommerce Website.....Loved this.....Well explained
@manohisoa
@manohisoa Жыл бұрын
Thanks a lot for this video! It was really helpful. Very simple and straightforward.
@iselaregain9301
@iselaregain9301 3 жыл бұрын
Tyler, this tutorial is so awesome. You are awesome!!!
@TylerPotts
@TylerPotts 3 жыл бұрын
Glad you think so!
@maefaemusic
@maefaemusic Жыл бұрын
Great vid! Thank you so much. This is perfect for the project I'm working on
@user-ck8xt6hl2k
@user-ck8xt6hl2k Ай бұрын
Great video! That was exactly what I was looking for. Thanks!
@TylerPotts
@TylerPotts Ай бұрын
Glad it was helpful!
@bedtimehorrorstoryyoutube
@bedtimehorrorstoryyoutube 9 ай бұрын
Freaking great! Crystal clear! Thank you !!
@linhbebu912
@linhbebu912 2 жыл бұрын
A very good tutorial, everything is very clear. Thanks a lot!!!
@TylerPotts
@TylerPotts 2 жыл бұрын
Glad it helped!
@estebanpedroguerravidal8336
@estebanpedroguerravidal8336 2 жыл бұрын
I love it. Thanks 👌
@mcm4981
@mcm4981 3 жыл бұрын
Great vid, I do appreciate. Just what I needed to see...
@TylerPotts
@TylerPotts 2 жыл бұрын
Glad it helped
@d.ashley879
@d.ashley879 2 жыл бұрын
Did anyone else get overlapping text on the card when you used "Lorem" or any other longer text in the tag?
@roshdyessam3480
@roshdyessam3480 2 жыл бұрын
I really laughed when I found we got the same theme, cool video btw
@Amilcar99
@Amilcar99 2 жыл бұрын
i love u, thx!!! i need this
@Dxaskotek
@Dxaskotek 3 жыл бұрын
Nice video, everything works! Thanks a lot ;)
@TylerPotts
@TylerPotts 2 жыл бұрын
You're welcome!
@andrearivera7065
@andrearivera7065 Жыл бұрын
Thanks, this was very helpfull ♥
@aloobre
@aloobre 3 жыл бұрын
More of this, really like these easy tutorials..so good for inspiration
@TylerPotts
@TylerPotts 3 жыл бұрын
Thank you! Will do!
@abdullahboston6963
@abdullahboston6963 3 жыл бұрын
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 3 жыл бұрын
@Abdullah Boston Definitely, have been watching on InstaFlixxer for since november myself :)
@wanishoaib_
@wanishoaib_ 3 жыл бұрын
i stumbled on this video and i have to subscribe
@samjoseph5718
@samjoseph5718 Жыл бұрын
Great video!
@santiagoramirez5507
@santiagoramirez5507 3 жыл бұрын
Thank you so much!! Using this technic I'm gonna make prettier websites! Greetings from Chile!!
@TylerPotts
@TylerPotts 3 жыл бұрын
Awesome!!! :D
@bepd
@bepd 3 жыл бұрын
Loved this
@TylerPotts
@TylerPotts 3 жыл бұрын
Awesome! :D
@petipois28
@petipois28 3 жыл бұрын
I used this as a base to make an ionic vue simple card game. Thank you
@TylerPotts
@TylerPotts 3 жыл бұрын
Excellent!
@gabriel_lk
@gabriel_lk Жыл бұрын
Thanks a lot!
@malamhari_
@malamhari_ 3 жыл бұрын
Thanks for this, learn so much
@TylerPotts
@TylerPotts 3 жыл бұрын
Glad it was helpful!
@ricardoreales7316
@ricardoreales7316 2 жыл бұрын
excellent code... very useful... thank you very much
@Sol-ty5nx
@Sol-ty5nx 2 жыл бұрын
I love it! thank you. Greetings from Argentina
@TylerPotts
@TylerPotts 2 жыл бұрын
Thank you for watching! Hello in Argentina!
@lucasdahl1118
@lucasdahl1118 2 жыл бұрын
OutStanding!
@TylerPotts
@TylerPotts 2 жыл бұрын
Thank you
@dowelg1071
@dowelg1071 2 жыл бұрын
is there a way to make the container thicker on the side view when flipped?
@hvariawa
@hvariawa 3 жыл бұрын
Brilliant tutorial
@TylerPotts
@TylerPotts 3 жыл бұрын
Thanks!
@DllacyLimaJr
@DllacyLimaJr 2 жыл бұрын
Muito bom o vídeo parabéns
@kaderlakhdar5735
@kaderlakhdar5735 3 жыл бұрын
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 👏👏
@TylerPotts
@TylerPotts 3 жыл бұрын
Thanks, will do!
@yevgenia7785
@yevgenia7785 3 жыл бұрын
Thank you so much!
@TylerPotts
@TylerPotts 2 жыл бұрын
You're welcome!
@limpmebrasil4991
@limpmebrasil4991 Жыл бұрын
Hey great video, thank you! Would it be possible to flip the card clicking a button instead of tapping the card?
@palashxm
@palashxm 3 жыл бұрын
Wow 👍
@TylerPotts
@TylerPotts 3 жыл бұрын
🤗
@stefanpfadt4353
@stefanpfadt4353 2 жыл бұрын
Hey cool ☺ Any chance to start the flip when you toggle a switch? (e.g. monthly to yearly)
@nestorfontalvo1061
@nestorfontalvo1061 3 жыл бұрын
Javascript doesn't stop to amaze me
@TylerPotts
@TylerPotts 3 жыл бұрын
It's awesome!
@duck_it
@duck_it 3 жыл бұрын
I want more............ Thank you so much.
@TylerPotts
@TylerPotts 3 жыл бұрын
Working on it!! :D
@parkerthomson1447
@parkerthomson1447 Жыл бұрын
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
@tamaskosa3283
@tamaskosa3283 3 жыл бұрын
Easy and effective! I used it for my interview work! Thanks a lot!
@TylerPotts
@TylerPotts 3 жыл бұрын
Glad it helped!
@tamaskosa3283
@tamaskosa3283 3 жыл бұрын
@@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! 🙂
@ezebado
@ezebado 2 жыл бұрын
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 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 2 жыл бұрын
@@TylerPotts That's will be great Tyler! Thank you so much :)
@user-gw6hy1md4b
@user-gw6hy1md4b 2 жыл бұрын
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 ?
@user-xk2dj4zi2p
@user-xk2dj4zi2p Жыл бұрын
Thanks a lot, brother but can you please let me know How I can add multiple cards on a single page.
@doublevizzion
@doublevizzion Жыл бұрын
I keep getting cannot read properties of null (reading 'addeventlistener')
@sanjaybalaji9367
@sanjaybalaji9367 2 жыл бұрын
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 2 жыл бұрын
It gets applied to the ".card__inner" div via javascript but is not declared in the HTML it is only set via JavaScript.
@huckerxxx
@huckerxxx 2 жыл бұрын
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 Жыл бұрын
I'm having the exact issue. I was hoping there'd be a reply.
@richardala3784
@richardala3784 Жыл бұрын
@@thomassavino3813 use for each in javascript
@elschilling
@elschilling Жыл бұрын
😍🤗
@mikheilrukhadze8782
@mikheilrukhadze8782 2 жыл бұрын
its not working on me can u help? on call or something
@zepherscotty
@zepherscotty Жыл бұрын
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.
@vitoriaaguiar3379
@vitoriaaguiar3379 2 жыл бұрын
How can I put multiple cards in row? Next to each other?
@TylerPotts
@TylerPotts 2 жыл бұрын
You need to select all elements and not just thebone
@alquran549
@alquran549 8 ай бұрын
how to change image in this code? please help meeeeeeeeeeeeeeeeeeeeeeeeee
@w.gene28
@w.gene28 11 ай бұрын
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.
@slendermann7610
@slendermann7610 3 жыл бұрын
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 2 жыл бұрын
I'm unsure I'd have to take a further look. Sorry.
@jesy1732
@jesy1732 2 жыл бұрын
M Mm
@shubkale376
@shubkale376 3 жыл бұрын
12:37 line.76 can you please elaborate more on the " .card__header::after "
@TylerPotts
@TylerPotts 2 жыл бұрын
What do you want me to explain?
@HosseinPi921
@HosseinPi921 2 жыл бұрын
plz tell a tutorial about html and css to learn from basic tnx
@eugeneskrypnyk7396
@eugeneskrypnyk7396 2 жыл бұрын
On the site, you need to turn over 8 different cards, but it works only on the very first one. Why?
@TylerPotts
@TylerPotts 2 жыл бұрын
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 2 жыл бұрын
@@TylerPotts thx)
@janina1240
@janina1240 Жыл бұрын
Hey, how would I make this work for more than one card?
@TylerPotts
@TylerPotts Жыл бұрын
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.
@oguzozdemir8886
@oguzozdemir8886 Жыл бұрын
Good job Tyler. I would also suggest adding... body { overflow: hidden; } .card { margin-top:50px; } Also thank you...
@imanbenetlewis6365
@imanbenetlewis6365 2 жыл бұрын
Is there a way to do this without the code? Like an app or a beginner friendly version?
@TylerPotts
@TylerPotts 2 жыл бұрын
Umm I only ever work with code so I don't know
@Michael-yb1bm
@Michael-yb1bm 2 жыл бұрын
Hey! Sorry for asking, but i have a short question. How do i change the js, so that multiple cards would work?
@TylerPotts
@TylerPotts 2 жыл бұрын
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 2 жыл бұрын
@@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 2 жыл бұрын
Instead of card.addevent try link.addevent your still referencing the list of cards instead of the individual one!
@Michael-yb1bm
@Michael-yb1bm 2 жыл бұрын
​@@TylerPotts Oh finally it works! I literally can't say thank you enough
@vitoriaaguiar3379
@vitoriaaguiar3379 2 жыл бұрын
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));´´
@sahajranipa
@sahajranipa 3 жыл бұрын
can you please provide code files? I want to use them as for my reference bro.
@TylerPotts
@TylerPotts 2 жыл бұрын
The link is in the description ? :)
@glendonphilippbaculio1811
@glendonphilippbaculio1811 2 жыл бұрын
how can i rotate in 1 direction?
@TylerPotts
@TylerPotts 2 жыл бұрын
I'm not sure what you mean! If you need help feel free to join the discord and as there :)
@romannovak375
@romannovak375 3 жыл бұрын
hi thanks for the tutorial if I add another card it doesn't work it please help XD
@TylerPotts
@TylerPotts 3 жыл бұрын
You would need to change the document.querySelector to document.querySelectorAll and then loop through the results...
@romannovak375
@romannovak375 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 3 жыл бұрын
@@romannovak375 Woo happy you understood what you said! My comment wasn't very clear :)
@abgthscode6326
@abgthscode6326 2 жыл бұрын
not wroking for multiple cards
@paulmoldovan9518
@paulmoldovan9518 3 жыл бұрын
How to stop backface to rotate if there is a link?
@IspittingFactzz
@IspittingFactzz 3 жыл бұрын
Hey Paul, did you find the answer to this??
@paulmoldovan9518
@paulmoldovan9518 3 жыл бұрын
@@IspittingFactzz no
@TylerPotts
@TylerPotts 2 жыл бұрын
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 2 жыл бұрын
@@TylerPotts Hey. Thanks. Yepp its allready made.
@lucasdahl1118
@lucasdahl1118 2 жыл бұрын
@@paulmoldovan9518 Did you get it to work?
@factking2241
@factking2241 2 жыл бұрын
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
@JimmyDevAndGeek
@JimmyDevAndGeek 3 жыл бұрын
How can I do to place 2 or more cards?
@TylerPotts
@TylerPotts 2 жыл бұрын
I've been asked multiple times for this so I will probably create a revised video :)
@vitoriaaguiar3379
@vitoriaaguiar3379 2 жыл бұрын
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 2 жыл бұрын
@@vitoriaaguiar3379 Thanks.😁
2 жыл бұрын
@@vitoriaaguiar3379 I LOVE YOU YOU SAVED MY LIFE :')
@thomassavino3813
@thomassavino3813 Жыл бұрын
@@vitoriaaguiar3379 Thank you! Thank you! Thank you!
@Ricardoromero4444
@Ricardoromero4444 Жыл бұрын
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
@ranjeet5806
@ranjeet5806 3 жыл бұрын
Advice: instead of focusing more on styling, try to explain more about the Crux, the flipping effect, and the backface and stuff.
@TylerPotts
@TylerPotts 2 жыл бұрын
Thanks for the feedback. I'll keep that in mind for future videos
Learn REACTJS by Making a Reddit Feed App
19:08
Tyler Potts
Рет қаралды 15 М.
CSS Flip Card Effect
6:16
Arjun Khara
Рет қаралды 241 М.
Sigma girl and soap bubbles by Secret Vlog
00:37
Secret Vlog
Рет қаралды 14 МЛН
Пранк пошел не по плану…🥲
00:59
Саша Квашеная
Рет қаралды 6 МЛН
Easy Flipcard Tutorial | HTML & CSS
11:20
Coding With Russ
Рет қаралды 64 М.
We can now transition to and from display: none
21:20
Kevin Powell
Рет қаралды 90 М.
Top 10 CSS One Liners That Will Blow Your Mind
13:34
developedbyed
Рет қаралды 931 М.
Smooth Back To Top Button - CSS Effects
8:54
Tyler Potts
Рет қаралды 10 М.
Flip Card in CSS (Like Apple)
5:45
Taha Shashtari
Рет қаралды 6 М.
Every CSS Animation property
9:26
chunkydotdev
Рет қаралды 62 М.
Top 20 CSS & Javascript Effects | March 2020
4:42
Online Tutorials
Рет қаралды 1,3 МЛН
Subtle, yet Beautiful Scroll Animations
5:04
Beyond Fireship
Рет қаралды 1,6 МЛН
Vanilla CSS Scroll Animations Now Possible!
10:44
developedbyed
Рет қаралды 96 М.