HTML5 Deck of Cards
11–20 of 165 posts
Re: HTML5 Deck of Cards
#12What's so HTML5 about this?
Re: HTML5 Deck of Cards
#13Each 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. 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. Edit: Can someone explain these downvotes for me?
Re: HTML5 Deck of Cards
#14More like JS + CSS3 Deck of Cards.
Re: HTML5 Deck of Cards
#15Re: HTML5 Deck of Cards
#16I implemented the same functionality (minus drag/drop, which isn't actually useful) a few times myself when I was working on poker bots.
Re: HTML5 Deck of Cards
#17Re: HTML5 Deck of Cards
#18Re: HTML5 Deck of Cards
#19Meh, it's all shiny and no functionality: I can't play any games or hook this up to anything. And it's not even that shiny: it would be quite difficult in casual play to differentiate cards at a glance: there are no faces on face cards, etc. I implemented the same functionality (minus drag/drop, which isn't actually useful) a few times myself when I was working on poker bots.
Re: HTML5 Deck of Cards
#20Maybe 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.
I think "value | 0" is basically same as "Math.floor(value)"