HTML5 Deck of Cards
pakastin.github.io
HTML5 Deck of Cards
1–10 of 165 posts
Re: HTML5 Deck of Cards
#2Re: HTML5 Deck of Cards
#3Now you just need to add a dropdown to select what drinking game you want to play.. ring of fire anyone?..
Re: HTML5 Deck of Cards
#4Re: HTML5 Deck of Cards
#5Re: HTML5 Deck of Cards
#6Additionally, with three elements (possible just one if you're crazily good at CSS), it'd be possible to have flippable cards. Still just using CSS3.
Edit: Can someone explain these downvotes for me?
Re: HTML5 Deck of Cards
#7var suit = i / 13 | 0;
That's such a clean way to get a 0, 1, 2 or 3 from each card's `i` and I never would have thought of it.
Re: HTML5 Deck of Cards
#8Inspecting the cards, you can see that they are using the unicode character for spade/heart/etc. But in the browser itself you get nothing but smileys.
Perhaps the font they're using doesn't have those code points?
Edit: Yes, that's the case. Font is not specified, so it comes in as "inherit" by default, using whatever the browser feels like. On Mac Chrome, that must use smileys to represent unknown characters. Switching the document font to Arial in CSS fixes the issue and makes the cards look like cards.
Re: HTML5 Deck of Cards
#9Maybe it's a weird takeaway, but this line is really clever: var suit = i / 13 | 0; That's such a clean way to get a 0, 1, 2 or 3 from each card's `i` and I never would have thought of it.
Re: HTML5 Deck of Cards
#10Any idea why the suits all render as smiley faces in Chrome/Mac? Inspecting the cards, you can see that they are using the unicode character for spade/heart/etc. But in the browser itself you get nothing but smileys. Perhaps the font they're using doesn't have those code points? Edit: Yes, that's the case. Font is not specified, so it comes in as "inherit" by default, using whatever the browser feels like. On Mac Chr…