This is similar to something my room mate is working on: <a href="https://github.com/thejoshwolfe/board-gamer-2d" rel="nofollow">https://github.com/thejoshwolfe/board-gamer-2d</a><p>The user can create a JSON string that represents a game (checkers, solitare, dominion, smash up, etc). Then the engine creates cards, tokens, dice, etc. It does not enforce rules but it supports multi player and some rules about visibility to other players. Its intended use case is for testing out new games or expansions before printing them.<p>It's a little bit early in the project though, so you'd have to run it from source if you want a demo.
Maybe it's a weird takeaway, but this line is really clever:<p>var suit = i / 13 | 0;<p>That's such a clean way to get a 0, 1, 2 or 3 from each card's `i` and I <i>never</i> would have thought of it.
This is very pleasing to the eye to shuffle/sort. Good work.<p>Now you just need to add a dropdown to select what drinking game you want to play.. ring of fire anyone?..
Any idea why the suits all render as smiley faces in Chrome/Mac?<p>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.<p>Perhaps the font they're using doesn't have those code points?<p>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.
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.
Each of these cards could probably be made with one element and some CSS3 pseudo-element selectors, as opposed to the four elements (wrapper element and three child elements) that are currently used per card.<p>Additionally, 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.<p>Edit: Can someone explain these downvotes for me?
Nice animation although card faces need some work.<p>My own CSS playing cards with proper card faces from 3 years ago is here:<p><a href="http://donpark.github.io/scalable-css-playing-cards/" rel="nofollow">http://donpark.github.io/scalable-css-playing-cards/</a>
This is quite nice! One "intuitive-but-counterintuitive" result -- when the cards are stacked and I drag from the corner, I end up pulling a card from the middle of the deck.<p>I suppose that's more for a second library that can manage stacks of cards, dealing and interacting with dealt cards, etc.
This kind of reminds me of something I almost ordered: <a href="http://varianto25.com/code-deck.html" rel="nofollow">http://varianto25.com/code-deck.html</a><p>Nice work by the way!
Wow! Really nice. I love the animations.<p>I made an endless random card (and die roll) generator: <a href="http://staticresource.com/shuffle.html" rel="nofollow">http://staticresource.com/shuffle.html</a> just tap anywhere to draw a new card.<p>Seeing what you've done with your Deck of Cards is a big inspiration!
How did you get it to show up at the URL: <a href="http://pakastin.github.io/deck-of-cards/" rel="nofollow">http://pakastin.github.io/deck-of-cards/</a>?<p>I thought we needed to make a separate repository for github pages first. My other repo doesn't show at all.
Very nice! I tried the CSS3 routes for card animations when I first built my card game ( <a href="https://solitaire.gg" rel="nofollow">https://solitaire.gg</a> ), but ended up going with WebGL since the cross-browser support for CSS3 animations was so wonky.
the animation is lovely and fluid. bit of a shame that the card faces don't have the pictures for the royal cards and the usual layout of multiple suit signs on the number cards, but this is still super.
Very neat! Mind if I borrow some of the CSS for my cards trick[0]?<p>[0] <a href="http://cluecode.com/cards/" rel="nofollow">http://cluecode.com/cards/</a>
I wrote a simpler version of very nearly the same thing not long ago. But this one is <i>much</i> nicer. The animations, in particular, add a lot of flash.
Looks great! Ability to flip cards would be awesome. When the cards are fanned, I'd love to see the end one being flipped and they all domino over :)
gorgeous! really fine work. (granted i have no design talent, though i did work for an online poker shop for six years and i have played a lot of poker with friends and a lot house poker in casinos.<p>particularly awesome is "sort", which i think really nicely simulates a (reverse) shuffle; it seemed like i could see the top edge of the cards lift as they rotated along the bottom edge
nitpick: when fanning out the cards and then clicking on one it should stay in the orientation it was in the fan, it jumps weirdly around.<p>same when clicking on the top card of a stack, it jumps ~40px.