Live data from Hacker News

HTML5 Deck of Cards

pakastin.github.io

151–160 of 165 posts

Re: HTML5 Deck of Cards

#153
post #59

Earlier quoted context omitted.

Why not just i % 4?

that would alternate the suit for each card, and all the aces would be the same suit, etc.

Yes, obviously it's not a drop in replacement as the behavior is different, but it does the same thing, giving you a number from 0 to 3 based on the card number. Pairing it with i%13 works just fine.

Re: HTML5 Deck of Cards

#155

Any 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…

Fixed!

Re: HTML5 Deck of Cards

#156

Any 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…

> On Mac Chrome, that must use smileys to represent unknown characters. You're seeing the Last Resort fallback font, which shows a symbol representative of the codepoint range, and the range's name, so you can identify what type of font you need. Since the suits are in the smiley block, you see a smiley. If you had no Latin alphabet font, you'd see an A. https://en.wikipedia.org/wiki/Fallback_font

Fixed now..

Re: HTML5 Deck of Cards

#157

Great work. There's a couple of small issues. First, regardless of where you click on a card, when you start dragging the card will jump so that its centre is at the cursor position. Second, there is a mismatch on the Z-index used for dragging and that used when a card is dropped into place.

Fixed!

Re: HTML5 Deck of Cards

#158

Nice animation although card faces need some work. My own CSS playing cards with proper card faces from 3 years ago is here: http://donpark.github.io/scalable-css-playing-cards/

I actually started using same vector faces now!

Re: HTML5 Deck of Cards

#160
post #72

Very nice! I tried the CSS3 routes for card animations when I first built my card game ( https://solitaire.gg ), but ended up going with WebGL since the cross-browser support for CSS3 animations was so wonky.

Whoa, really smooth animations!
Post reply on HN