Live data from Hacker News

HTML5 Deck of Cards

pakastin.github.io

11–20 of 165 posts

Re: HTML5 Deck of Cards

#13

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. 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?

I suck at pseudo-elements – that's why.. :)

Re: HTML5 Deck of Cards

#14
post #5

More like JS + CSS3 Deck of Cards.

I used HTML5 just because the original version was made with Flash back in 2006 (http://pakastin.fi/cards_2006). Then I made a Angular.js version, which is lost, but was featured on Chrome Experiments. This is actually HTML5 Deck of Cards 2 :)

Re: HTML5 Deck of Cards

#16
Meh, 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

#19

Meh, 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.

Maybe instead of trashing other people's work you could just link to yours instead.

Re: HTML5 Deck of Cards

#20
post #9

Maybe 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)"

Yes, but it is 18% faster do run the bitwise or on my machine:

https://jsperf.com/or-vs-floor/2

Post reply on HN