Home>Deck of Playing Cards in JavaScript

Deck of Playing Cards in JavaScript

So, I drank a whole pot of coffee yesterday. And it was a black, black, pot of coffee–like the soul of an exploded quasar, black. Twelve hours later (midnight), I was buzzing. So, what did I do? I wrote a jQuery library. Check out the project on github: jquery.playingcards. Check out a demo here. The demo just writes the cards to the page and allows you to click them to flip the cards. Will add buttons for the other behaviors (shuffle, pile, etc) soon. How? I used jQuery as a base (it’s a jquery plugin). However, this code could easily be extracted out to be used with any other JavaScript framework or even stand alone. The cards are drawn mostly in CSS, using images only in the case of face cards–though, I have committed an open source card font that will eventually be implemented as a configuration option in place of the css/images. The images are courtesy of David Bellot with his awesome SVG card set. Why? I wanted to use github since just about every cool project I’ve seen in the ...

From:Intellectual Pirates Date:03/06/2010