<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>selfthinker &#187; gimmick</title>
	<atom:link href="http://blog.selfthinker.org/tag/gimmick/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.selfthinker.org</link>
	<description>The world according to me</description>
	<lastBuildDate>Wed, 07 Dec 2011 01:52:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>CSS Playing Cards</title>
		<link>http://blog.selfthinker.org/2010/08/23/css-playing-cards/</link>
		<comments>http://blog.selfthinker.org/2010/08/23/css-playing-cards/#comments</comments>
		<pubDate>Sun, 22 Aug 2010 23:40:09 +0000</pubDate>
		<dc:creator>selfthinker</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[accessibility]]></category>
		<category><![CDATA[cards]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[gimmick]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://blog.selfthinker.org/?p=185</guid>
		<description><![CDATA[Some days ago a friend of mine told me that he would be interested in using pure CSS playing cards for a personal project. A few people have tried CSS playing cards before. But I wasn&#8217;t satisfied with any of our findings, as ideally they should be semantic, accessible and scalable, they shouldn&#8217;t use more [...]]]></description>
			<content:encoded><![CDATA[<p>Some days ago a friend of mine told me that he would be interested in using pure <strong>CSS playing cards</strong> for a personal project. A few people have tried CSS playing cards before. But I wasn&#8217;t satisfied with any of our findings, as <strong>ideally they should be semantic, accessible and scalable, they shouldn&#8217;t use more markup than necessary and should be pleasing to the eye</strong>. So, I was up for the challenge and created them myself &#8230;<br />
<span id="more-185"></span></p>
<p>First, let&#8217;s recap what others have done before:</p>
<ul>
<li><a href="http://www.brainjar.com/css/cards/"><strong>Playing Cards with CSS</strong> by Mike Hall</a> was quite innovative at the time, but is very old by now (it is from 2001). Too much markup, only half semantic, but scalable and they don&#8217;t use any CSS3 goodness (because CSS3 didn&#8217;t exist back then).</li>
<li><a href="http://legitimatesounding.com/blog/XHTML_CSS_Playing_Cards.html"><strong>XHTML/CSS Playing Cards</strong> by Jerry Sievert</a> are half semantic, the amount of markup is okay-ish and they are the most accessible out of these four, but they are not scalable and don&#8217;t belong to the beautiful kind.</li>
<li><a href="http://htmyell.com/creating-playing-cards-with-css-html/"><strong>Creating playing cards with CSS &amp; HTML</strong> by Jamie Taylor</a> are quite beautiful, but are very unsemantic, not scalable and have a tad bit too much markup.</li>
<li><a href="http://dribbble.com/shots/37568-CSS-Playing-Cards"><strong>CSS Playing Cards</strong> by Kevin Thompson</a> are my personal favourites out of these four. They are really beautiful, are scalable (although the way they are built doesn&#8217;t display too well if the cards are too small) and plays neatly with CSS3. But although the class names are semantic, the markup (which again, is too much) is not semantic at all and completely inaccessible, i.e. it&#8217;s empty and contains no information about the cards if you turn CSS off.</li>
</ul>
<p>Why my CSS Playing Cards are better? Well, they contain less markup, they are much more semantic and accessible (so they even make sense in Lynx), they are perfectly scalable and good looking.<br />
The only negative thing: The CSS only works in modern browsers. (Tested on Win Firefox 3.6.8, Opera 10.61 and Chrome. Internet Explorer 8 cannot deal with many of the CSS3 goodness, but what makes the code unusable in IE8 is the lack of support for the &#8220;:nth-child(n)&#8221; selector. I implemented a rudimentary fix, though.)</p>
<p>And here&#8217;s the proof. This is the basic markup (only two spans in one div):</p>
<pre>
&lt;div class="card rank-7 spades"&gt;
    &lt;span class="rank"&gt;7&lt;/span&gt;
    &lt;span class="suit"&gt;&amp;spades;&lt;/span&gt;
&lt;/div>
</pre>
<p>Here is one example of a hand:</p>
<div class="playingCards fourColours faceImages rotateHand" style="padding-top: 2em; overflow: hidden;">
<ul class="hand" style="float: left;">
<li>
<div class="card rank-2 diams"><span class="rank">2</span><span class="suit">&diams;</span></div>
</li>
<li>
<div class="card rank-3 hearts"><span class="rank">3</span><span class="suit">&hearts;</span></div>
</li>
<li>
<div class="card rank-4 spades"><span class="rank">4</span><span class="suit">&spades;</span></div>
</li>
<li>
<div class="card rank-5 clubs"><span class="rank">5</span><span class="suit">&clubs;</span></div>
</li>
<li>
<div class="card rank-6 diams"><span class="rank">6</span><span class="suit">&diams;</span></div>
</li>
<li>
<div class="card rank-7 hearts"><span class="rank">7</span><span class="suit">&hearts;</span></div>
</li>
<li>
<div class="card rank-8 spades"><span class="rank">8</span><span class="suit">&spades;</span></div>
</li>
<li>
<div class="card rank-9 clubs"><span class="rank">9</span><span class="suit">&clubs;</span></div>
</li>
<li>
<div class="card rank-10 diams"><span class="rank">10</span><span class="suit">&diams;</span></div>
</li>
<li>
<div class="card rank-j hearts"><span class="rank">J</span><span class="suit">&hearts;</span></div>
</li>
<li>
<div class="card rank-q spades"><span class="rank">Q</span><span class="suit">&spades;</span></div>
</li>
<li>
<div class="card rank-k clubs"><span class="rank">K</span><span class="suit">&clubs;</span></div>
</li>
<li>
<div class="card rank-a diams"><span class="rank">A</span><span class="suit">&diams;</span></div>
</li>
</ul>
<div id="attachment_190" class="wp-caption alignright" style="width: 289px"><img src="http://blog.selfthinker.org/wp-content/uploads/2010/08/css-playing-cards-example.png" alt="" title="" width="279" height="185" class="size-full wp-image-190" /><p class="wp-caption-text">And this is how it looks in Opera</p></div>
<div class="clear"></div>
</div>
<p>Want more? You can see <strong><a href="http://blog.selfthinker.org/wp-content/uploads/2010/08/cards/examples.html">more examples</a></strong> or you can implement them and <a href="http://github.com/selfthinker/CSS-Playing-Cards">check out the code on GitHub</a> as I open-sourced it, of course.</p>
<hr />
<strong>Update</strong> (17 October 2010):<br />
Shortly after I published this, another variant surfaced the web:<br />
<a href="http://sixrevisions.com/css/css3-card-trick-a-fun-css3-experiment/"><strong>CSS3 Card Trick: A Fun CSS3 Experiment</strong> by Alexander Dawson</a> has cards which are not scalable at all, only half semantic and (like all the others) use too much markup, but are really beautiful and stylish.</p>
<p><strong>Update</strong> (2 December 2010):<br />
And I found another version:<br />
<a href="http://www.yaus.com/jeff/2009/07/23/css-cards/"><strong>CSS Cards</strong> by Jeff Yaus</a> are semantic, highly scalable, a bit weird looking, have the least markup of all so far, but are unfortunately not accessible at all.</p>
<p><strong>Last Update</strong> (28 May 2011):<br />
And I found another variety&#8230; But from now on I won&#8217;t update this post anymore, but will update my <strong><a href="http://socialcompare.com/en/comparison/css-playing-cards-pgnq7dx">Comparison of CSS Playing Cards</a></strong> on <a href="http://socialcompare.com/">SocialCompare.com</a> instead.</p>
<p><strong>Really Last Update</strong> (12 June 2011):<br />
I just updated my CSS Playing Cards. <a href="https://github.com/selfthinker/CSS-Playing-Cards/zipball/master">Get the new version from GitHub</a>.<br />
And additionally I built a <strong><a href="http://selfthinker.github.com/CSS-Playing-Cards/">beautiful new project page</a></strong>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.selfthinker.org/2010/08/23/css-playing-cards/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>CSS Mini-Me</title>
		<link>http://blog.selfthinker.org/2010/03/03/css-mini-me/</link>
		<comments>http://blog.selfthinker.org/2010/03/03/css-mini-me/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 01:36:13 +0000</pubDate>
		<dc:creator>selfthinker</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[gimmick]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://blog.selfthinker.org/?p=158</guid>
		<description><![CDATA[A few days ago I was trying to find my &#8220;body colours&#8221;. I took a photo of my face and colour-picked the most representative bits of my skin, hair, lips and eyes. While the results in themselves (#dcc09b, #3a2810, #b0625e, #3b453d) were nice but also completely unimportant, I wondered what else I could do with [...]]]></description>
			<content:encoded><![CDATA[<p>A few days ago I was trying to find my &#8220;body colours&#8221;. I took a photo of my face and colour-picked the most representative bits of my skin, hair, lips and eyes. While the results in themselves (<span style="background-color: #dcc09b; color: #000;" title="skin">#dcc09b</span>, <span style="background-color: #3a2810; color: #fff;" title="hair">#3a2810</span>, <span style="background-color: #b0625e; color: #000;" title="lips">#b0625e</span>, <span style="background-color: #3b453d; color: #fff;" title="eyes">#3b453d</span>) were nice but also completely unimportant, I wondered what else I could do with that information.</p>
<p>I first thought about personalising my online CV to match these colours (with hair colour at the top, lip colour at the bottom and eye colour for links, etc). But somehow my body colours don&#8217;t make good website colours.</p>
<div class="photo">
<div class="head">
<div class="hair">
<div class="face">
<div class="eyel"></div>
<div class="eyer"></div>
<div class="lips"></div>
</div>
</div>
</div>
<div class="text">me</div>
</div>
<p>Instead I played around with those colours and created a pure HTML and CSS &#8220;image&#8221; of myself (the core code consists of just five divs). <span lang="fr">Et voilà</span>, here it is.</p>
<p>You will only see the full beauty of it if you use a modern browser (and can see). It&#8217;s funny how IE6 still shows something which is recognisable as a face, but turns it into some kind of a monster:</p>
<div id="attachment_159" class="wp-caption aligncenter" style="width: 289px"><img src="http://blog.selfthinker.org/wp-content/uploads/2010/03/minime_browsers.png" alt="" title="" width="279" height="171" class="size-full wp-image-159" /><p class="wp-caption-text">Beauty is in the eyes of the browser</p></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.selfthinker.org/2010/03/03/css-mini-me/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

