<?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>Teknotica&#039;s blog</title>
	<atom:link href="http://www.silviarebelo.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.silviarebelo.com</link>
	<description></description>
	<lastBuildDate>Sat, 30 Mar 2013 19:21:38 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Rubik&#8217;s Cube animated</title>
		<link>http://www.silviarebelo.com/2013/03/rubiks-cube-animated/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=rubiks-cube-animated</link>
		<comments>http://www.silviarebelo.com/2013/03/rubiks-cube-animated/#comments</comments>
		<pubDate>Sat, 30 Mar 2013 13:32:45 +0000</pubDate>
		<dc:creator>Silvia Rebelo</dc:creator>
				<category><![CDATA[CSS3]]></category>

		<guid isPermaLink="false">http://silviarebelo.com/?p=464</guid>
		<description><![CDATA[Something I&#8217;ve been playing with lately is CSS3, exploring its capabilities to create animations and transitions. During my research I&#8217;ve seen truly jaw-dropping demos and it seems like people is taking advantage of those capabilities to do really cool stuff. &#8230; <a href="http://www.silviarebelo.com/2013/03/rubiks-cube-animated/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><a href="http://silviarebelo.com/demos/css3-rubiks-cube/" target="_blank"><img class="size-full wp-image-465 alignleft" alt="rubiks-cube-css" src="http://silviarebelo.com/wp-content/uploads/2013/03/rubiks-cube-css.jpg" width="579" height="359" /></a></p>
<p>Something I&#8217;ve been playing with lately is CSS3, exploring its capabilities to create animations and transitions.</p>
<p>During my research I&#8217;ve seen truly jaw-dropping demos and it seems like people is taking advantage of those capabilities to do really cool stuff. I thought I might try something myself, so I ended up doing this simple example of a Rubik&#8217;s cube, showing a mix of transitions, perspective, rotations and a pinch of jQuery (to update some of those values).</p>
<p>It is a bit disappointing that some of those capabilities only exist in some browsers, but hopefully one day that will change.</p>
<p>(1) <a href="http://silviarebelo.com/demos/css3-rubiks-cube/" target="_blank">See the demo here<br />
</a><br />
(2) <a href="http://jsfiddle.net/teknotica/WrUz2/3/" target="_blank">Demo &amp; Code here</a> - Please note I&#8217;ve used the <a href="http://leaverou.github.com/prefixfree/" target="_blank">&#8220;Prefix Free&#8221;</a> js which allows you to write CSS not bothering about all the different browser&#8217;s prefixes (-moz, -webkit, -o). Really handy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.silviarebelo.com/2013/03/rubiks-cube-animated/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding callbacks to Twitter Bootstrap&#8217;s Javascript plugins</title>
		<link>http://www.silviarebelo.com/2013/03/adding-callbacks-to-twitter-bootstraps-javascript-plugins/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=adding-callbacks-to-twitter-bootstraps-javascript-plugins</link>
		<comments>http://www.silviarebelo.com/2013/03/adding-callbacks-to-twitter-bootstraps-javascript-plugins/#comments</comments>
		<pubDate>Sat, 09 Mar 2013 14:12:01 +0000</pubDate>
		<dc:creator>Silvia Rebelo</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Twitter Bootstrap]]></category>

		<guid isPermaLink="false">http://silviarebelo.com/?p=445</guid>
		<description><![CDATA[The minute I first saw Twitter&#8217;s Bootstrap I knew I was going to use it continuously. Either for prototyping or building a site in a short period of time, Twitter Bootstrap has an incredible amount of features/plugins that will ensure your website/app will &#8230; <a href="http://www.silviarebelo.com/2013/03/adding-callbacks-to-twitter-bootstraps-javascript-plugins/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><a href="http://silviarebelo.com/demos/bootstrap_callback/" target="_blank"><img class="aligncenter size-full wp-image-460" alt="popover_callback" src="http://silviarebelo.com/wp-content/uploads/2013/03/popover_callback.png" width="705" height="174" /></a></p>
<p>The minute I first saw <a href="http://twitter.github.com/bootstrap/index.html" target="_blank">Twitter&#8217;s Bootstrap</a> I knew I was going to use it continuously. Either for prototyping or building a site in a short period of time, Twitter Bootstrap has an incredible amount of features/plugins that will ensure your website/app will look great under any browser/device.</p>
<p>However, after using some of the Javascript plugins, I notice some of them don&#8217;t have a callback function, which is pretty handy when you want to do more custom stuffs. Luckily, after doing some research I found out that in Javascript a callback function can be added through the function property <a href="http://pivotallabs.com/javascript-constructors-prototypes-and-the-new-keyword/" target="_blank">&#8220;prototype&#8221;</a>.</p>
<p><span id="more-445"></span>So imagine you want to do something after a <a href="http://twitter.github.com/bootstrap/javascript.html#popovers" target="_blank">popover</a> is opened. To add a callback function do the following. Notice that you can call it whatever you want:</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">var</span> pt <span style="color: #339933;">=</span> $.<span style="color: #660066;">fn</span>.<span style="color: #660066;">popover</span>.<span style="color: #660066;">Constructor</span>.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">show</span><span style="color: #339933;">;</span><br />
$.<span style="color: #660066;">fn</span>.<span style="color: #660066;">popover</span>.<span style="color: #660066;">Constructor</span>.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">show</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
pt.<span style="color: #660066;">call</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">options</span>.<span style="color: #660066;">afterShowed</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">options</span>.<span style="color: #660066;">afterShowed</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>Once you have done that, you can call the callback function when initialising your popover object:</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#example'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">popover</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><br />
afterShowed<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<span style="color: #006600; font-style: italic;">// do something</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>Look at the demo <a href="http://silviarebelo.com/demos/bootstrap_callback/" target="_blank">here</a>.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.silviarebelo.com/2013/03/adding-callbacks-to-twitter-bootstraps-javascript-plugins/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simetría &#8211; Symmetry</title>
		<link>http://www.silviarebelo.com/2013/01/simetria-symmetry/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=simetria-symmetry</link>
		<comments>http://www.silviarebelo.com/2013/01/simetria-symmetry/#comments</comments>
		<pubDate>Sun, 20 Jan 2013 22:02:43 +0000</pubDate>
		<dc:creator>Silvia Rebelo</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[Photoshop]]></category>

		<guid isPermaLink="false">http://silviarebelo.com/?p=427</guid>
		<description><![CDATA[Using Photoshop, this little work has been inspired by my days at Uni and the snow outside.]]></description>
				<content:encoded><![CDATA[<p>Using Photoshop, this little work has been inspired by my days at Uni and the snow outside.<a href="http://silviarebelo.com/wp-content/uploads/2013/01/simetria.jpg"><br />
<img class="size-full wp-image-428 alignleft" title="simetria" alt="" src="http://silviarebelo.com/wp-content/uploads/2013/01/simetria.jpg" width="499" height="709" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.silviarebelo.com/2013/01/simetria-symmetry/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTML5 custom data attributes will save your life</title>
		<link>http://www.silviarebelo.com/2012/10/html5-custom-data-attributes-will-save-your-life/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=html5-custom-data-attributes-will-save-your-life</link>
		<comments>http://www.silviarebelo.com/2012/10/html5-custom-data-attributes-will-save-your-life/#comments</comments>
		<pubDate>Tue, 30 Oct 2012 22:14:36 +0000</pubDate>
		<dc:creator>Silvia Rebelo</dc:creator>
				<category><![CDATA[HTML5]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://silviarebelo.com/?p=365</guid>
		<description><![CDATA[I know. I&#8217;m exaggerating a bit with that title. However, If you are a jQuery fan (like me) I can assure you it will save you some valuable time and code. jQuery allows you to manipulate elements in a page &#8230; <a href="http://www.silviarebelo.com/2012/10/html5-custom-data-attributes-will-save-your-life/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><a href="http://i.telegraph.co.uk/multimedia/archive/02173/Lionel_Messi_2173492b.jpg"><img class="aligncenter size-full wp-image-385" title="Lionel_Messi_2173492b" src="http://silviarebelo.com/wp-content/uploads/2012/10/Lionel_Messi_2173492b.jpg" alt="" width="620" height="388" /></a></p>
<p>I know. I&#8217;m exaggerating a bit with that title. However, If you are a <a href="http://www.jquery.com" target="_blank">jQuery</a> fan (like me) I can assure you it will save you some valuable time and code.<span id="more-365"></span></p>
<p>jQuery allows you to manipulate elements in a page normally identified by an unique id or a class name:</p>
<p>HTML:</p>
<div class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;players-list&quot;</span>&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/ul.html"><span style="color: #000000; font-weight: bold;">ul</span></a>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;player&quot;</span>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Lionel Messi<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;player&quot;</span>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Andres Iniesta<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;player&quot;</span>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Xavi Hernandez<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/ul.html"><span style="color: #000000; font-weight: bold;">ul</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span></div></div>
<p>jQuery:</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#players-list .player a'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
<span style="color: #006600; font-style: italic;">// will print the players link text</span><br />
console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'this'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>&nbsp;<br />
But what about adding some extra information of these elements? Let&#8217;s stick with the example and imagine the case you also need the nationality of the players to be saved in a DB.</p>
<p>One solution could be adding a descriptive id or class to each player, something along these lines:</p>
<div class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;players-list&quot;</span>&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/ul.html"><span style="color: #000000; font-weight: bold;">ul</span></a>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;player&quot;</span>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;arg&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Lionel Messi<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;player&quot;</span>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;es&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Xavi Hernandez<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;player&quot;</span>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;es&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Andres Iniesta<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/ul.html"><span style="color: #000000; font-weight: bold;">ul</span></a>&gt;</span></div></div>
<p>&nbsp;<br />
Then you find out that you will also need their ages&#8230; and the teams they play for&#8230; and&#8230;.  Worry no more!</p>
<p>The solution you were dreaming for already exists: &#8220;HTML5 Custom Data Attributes&#8221;. They&#8217;re a custom way of adding attributes with any string value you need. And the best part: they can be added to ANY HTML element.</p>
<p>Following the example above, you can then do something like:</p>
<div class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;players-list&quot;</span>&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/ul.html"><span style="color: #000000; font-weight: bold;">ul</span></a>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;player&quot;</span>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span> data-nationality<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;argentinian&quot;</span> data-age<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;25&quot;</span>&gt;</span>Lionel Messi<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;player&quot;</span>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span> data-nationality<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;spanish&quot;</span> data-age<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;32&quot;</span>&gt;</span>Xavi Hernandez<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;player&quot;</span>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span> data-nationality<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;spanish&quot;</span> data-age<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;32&quot;</span>&gt;</span>Andres Iniesta<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/ul.html"><span style="color: #000000; font-weight: bold;">ul</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span></div></div>
<p>&#8230;and get the attributes values using jQuery:</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#players-list .player a'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
<span style="color: #006600; font-style: italic;">// will print the player's nationality</span><br />
console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'this'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'data-nationality'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #006600; font-style: italic;">// will print the player's age</span><br />
console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'this'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'data-age'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>Update: You can also use $(&#8216;this&#8217;).data(&#8216;attribute-name&#8217;) to get the attribute&#8217;s value, like my friend Irving suggested on his comment below.</p>
<p>Enjoy!</p>
<p>PS.- Yes, that is a picture of Messi <img src='http://www.silviarebelo.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.silviarebelo.com/2012/10/html5-custom-data-attributes-will-save-your-life/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>The jump of Felix (the cat)</title>
		<link>http://www.silviarebelo.com/2012/10/the-jump-of-felix-the-cat/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-jump-of-felix-the-cat</link>
		<comments>http://www.silviarebelo.com/2012/10/the-jump-of-felix-the-cat/#comments</comments>
		<pubDate>Sat, 20 Oct 2012 17:42:52 +0000</pubDate>
		<dc:creator>Silvia Rebelo</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://silviarebelo.com/?p=356</guid>
		<description><![CDATA[I hope this make you smile like it did to me.]]></description>
				<content:encoded><![CDATA[<p>I hope this make you smile like it did to me.</p>
<p><a href="http://silviarebelo.com/wp-content/uploads/2012/10/4716e8ae956cd0feb4cb3d526a00d07fb77086de_m.gif"><img class="size-full wp-image-357 alignleft" title="felix" src="http://silviarebelo.com/wp-content/uploads/2012/10/4716e8ae956cd0feb4cb3d526a00d07fb77086de_m.gif" alt="" width="350" height="314" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.silviarebelo.com/2012/10/the-jump-of-felix-the-cat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>3D effect using CSS3 + jQuery</title>
		<link>http://www.silviarebelo.com/2012/07/3d-effect-using-css3-jquery/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=3d-effect-using-css3-jquery</link>
		<comments>http://www.silviarebelo.com/2012/07/3d-effect-using-css3-jquery/#comments</comments>
		<pubDate>Sun, 08 Jul 2012 22:01:32 +0000</pubDate>
		<dc:creator>Silvia Rebelo</dc:creator>
				<category><![CDATA[CSS / CSS3]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://silviarebelo.com/?p=334</guid>
		<description><![CDATA[I saw this effect in a blog the other day (which unfortunately didn&#8217;t save on my bookmarks) but what caught my attention was the way some pieces of content popped up over the page, making a 3D effect. I believe &#8230; <a href="http://www.silviarebelo.com/2012/07/3d-effect-using-css3-jquery/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><a href="http://silviarebelo.com/demos/3d-effect/" target="_blank"><img class="aligncenter size-full wp-image-335" title="mouseover" src="http://silviarebelo.com/wp-content/uploads/2012/07/mouseover.png" alt="" width="454" height="255" /></a></p>
<p>I saw this effect in a blog the other day (which unfortunately didn&#8217;t save on my bookmarks) but what caught my attention was the way some pieces of content popped up over the page, making a 3D effect.</p>
<p>I believe it was made on Flash and when I saw it I thought &#8220;I should try and replicate it using jQuery&#8221;&#8230;</p>
<p><span id="more-334"></span>&#8230; so here it is: a little <a title="3D effect using jquery and css3" href="http://silviarebelo.com/demos/3d-effect/" target="_blank">demo</a> I&#8217;ve created myself. It&#8217;s a 3D effect using CSS3 transformation and jQuery.</p>
<p>I&#8217;m pretty sure there must be so many ways to do this, probably more efficiently. I didn&#8217;t really do any research, it&#8217;s entirely an experiment.</p>
<p>So, what I&#8217;ve done?</p>
<p>First of all. A &#8220;3D&#8221; rectangle, using CSS3 transformation. Have a look at this <a title="CSS3 shapes" href="http://www.css3shapes.com/" target="_blank">link</a> which will show you how much you can do using transformation. The rectangle is simply divs in top of each other: the front, the bottom and right side (and some extra for positioning).</p>
<p>Absolute positioning and z-index will help you to draw a perfect rectangle with a 3D effect. This is the code I used:</p>
<div class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;rectangle&quot;</span>&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;content&quot;</span>&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/h2.html"><span style="color: #000000; font-weight: bold;">h2</span></a>&gt;</span>Put your mouse over me!<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/h2.html"><span style="color: #000000; font-weight: bold;">h2</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;rotate-container&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;bottom-depth&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span></div></div>
<p>Some CSS to position and hide the &#8220;depth&#8221; divs so will only be displayed when animated. Here&#8217;s my CSS:</p>
<div class="codecolorer-container css default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;height:300px;"><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">.<span style="color: #000000; font-weight: bold;">content</span> <span style="color: #00AA00;">&#123;</span><br />
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">400px</span><span style="color: #00AA00;">;</span><br />
<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">200px</span><span style="color: #00AA00;">;</span><br />
<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#FFF</span><span style="color: #00AA00;">;</span><br />
<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#CCC</span><span style="color: #00AA00;">;</span><br />
<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span><br />
<span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span><span style="color: #00AA00;">;</span><br />
<span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><br />
<span style="color: #000000; font-weight: bold;">z-index</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">2</span><span style="color: #00AA00;">;</span><br />
<span style="color: #000000; font-weight: bold;">cursor</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">pointer</span><span style="color: #00AA00;">;</span><br />
<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">20px</span><span style="color: #00AA00;">;</span><br />
<span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">center</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span><br />
<br />
<span style="color: #6666ff;">.bottom-depth</span> <span style="color: #00AA00;">&#123;</span><br />
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">411px</span><span style="color: #00AA00;">;</span><br />
<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">21px</span><span style="color: #00AA00;">;</span><br />
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span><br />
-webkit-transform<span style="color: #00AA00;">:</span> skew<span style="color: #00AA00;">&#40;</span>20deg<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span><br />
-moz-transform<span style="color: #00AA00;">:</span> skew<span style="color: #00AA00;">&#40;</span>20deg<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span><br />
-o-transform<span style="color: #00AA00;">:</span> skew<span style="color: #00AA00;">&#40;</span>20deg<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span><br />
transform<span style="color: #00AA00;">:</span> skew<span style="color: #00AA00;">&#40;</span>20deg<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span><br />
<span style="color: #000000; font-weight: bold;">z-index</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">1</span><span style="color: #00AA00;">;</span><br />
<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span><br />
<span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">280px</span><span style="color: #00AA00;">;</span><br />
<span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-16px</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span><br />
<br />
<span style="color: #6666ff;">.right-depth</span> <span style="color: #00AA00;">&#123;</span><br />
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">214px</span><span style="color: #00AA00;">;</span><br />
<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">20px</span><span style="color: #00AA00;">;</span><br />
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span><br />
-webkit-transform<span style="color: #00AA00;">:</span> skew<span style="color: #00AA00;">&#40;</span>-20deg<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span><br />
-moz-transform<span style="color: #00AA00;">:</span> skew<span style="color: #00AA00;">&#40;</span>-20deg<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span><br />
-o-transform<span style="color: #00AA00;">:</span> skew<span style="color: #00AA00;">&#40;</span>-20deg<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span><br />
transform<span style="color: #00AA00;">:</span> skew<span style="color: #00AA00;">&#40;</span>-20deg<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span><br />
<span style="color: #000000; font-weight: bold;">z-index</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">1</span><span style="color: #00AA00;">;</span><br />
<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span><br />
<span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">280px</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span><br />
<br />
<span style="color: #6666ff;">.rotate-container</span> <span style="color: #00AA00;">&#123;</span><br />
-webkit-transform<span style="color: #00AA00;">:</span> rotate<span style="color: #00AA00;">&#40;</span>-90deg<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span><br />
-moz-transform<span style="color: #00AA00;">:</span> rotate<span style="color: #00AA00;">&#40;</span>-90deg<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span><br />
-ms-transform<span style="color: #00AA00;">:</span> rotate<span style="color: #00AA00;">&#40;</span>-90deg<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span><br />
-o-transform<span style="color: #00AA00;">:</span> rotate<span style="color: #00AA00;">&#40;</span>-90deg<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span><br />
transform<span style="color: #00AA00;">:</span> rotate<span style="color: #00AA00;">&#40;</span>-90deg<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span><br />
<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span><br />
<span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">298px</span><span style="color: #00AA00;">;</span><br />
<span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span></div></div>
<p>And finally, the little jQuery script. It will animate the divs when the mouse enters in the content area, displaying the &#8220;depth&#8221; divs which will make the 3D effect and when the mouse leaves will do the opposite.</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;height:300px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
<br />
<span style="color: #006600; font-style: italic;">// To verify animation is finish so mouseeneter event can be triggered agaib</span><br />
<span style="color: #003366; font-weight: bold;">var</span> animation_finished <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Boolean<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
animation_finished <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #006600; font-style: italic;">// Hide depth effect divs</span><br />
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.rotate-container'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.bottom-depth'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #006600; font-style: italic;">// Mouse enter</span><br />
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.content'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">mouseenter</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
<br />
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>animation_finished<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<span style="color: #006600; font-style: italic;">// Animate div</span><br />
$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><br />
top<span style="color: #339933;">:</span> <span style="color: #3366CC;">'-=20'</span><span style="color: #339933;">,</span><br />
left<span style="color: #339933;">:</span> <span style="color: #3366CC;">'-=20'</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">250</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'linear'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.rotate-container'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.bottom-depth'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
animation_finished <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #006600; font-style: italic;">// Mouse leave</span><br />
.<span style="color: #660066;">mouseleave</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
<br />
<span style="color: #006600; font-style: italic;">// Hide depth effect divs</span><br />
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.rotate-container'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.bottom-depth'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #006600; font-style: italic;">// Not ready to animate</span><br />
animation_finished <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span><br />
<span style="color: #006600; font-style: italic;">// Animate container to original position</span><br />
$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><br />
top<span style="color: #339933;">:</span> <span style="color: #3366CC;">'100'</span><span style="color: #339933;">,</span><br />
left<span style="color: #339933;">:</span> <span style="color: #3366CC;">'0'</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">100</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
animation_finished <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span><br />
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.rotate-container'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.bottom-depth'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>And voila!</p>
<p>See the <a href="http://silviarebelo.com/demos/3d-effect/">demo</a> here.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.silviarebelo.com/2012/07/3d-effect-using-css3-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Portugal vs Spain. 2 years later.</title>
		<link>http://www.silviarebelo.com/2012/06/portugal-vs-spain-2-years-later/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=portugal-vs-spain-2-years-later</link>
		<comments>http://www.silviarebelo.com/2012/06/portugal-vs-spain-2-years-later/#comments</comments>
		<pubDate>Sun, 24 Jun 2012 12:08:57 +0000</pubDate>
		<dc:creator>Silvia Rebelo</dc:creator>
				<category><![CDATA[Euro 2012]]></category>
		<category><![CDATA[Sports]]></category>
		<category><![CDATA[Wallpapers]]></category>

		<guid isPermaLink="false">http://silviarebelo.com/?p=285</guid>
		<description><![CDATA[Next Wednesday 27 Portugal will be playing Spain at the Euro 2012. Exciting! Not only because there is a sense of revenge after Portugal being defeated by their neighbours in the World Cup two years ago, but personally because these &#8230; <a href="http://www.silviarebelo.com/2012/06/portugal-vs-spain-2-years-later/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<div id="attachment_286" class="wp-caption aligncenter" style="width: 970px"><a href="http://silviarebelo.com/wp-content/uploads/2012/06/euro2012.png"><img class=" wp-image-286 " title="euro2012" src="http://silviarebelo.com/wp-content/uploads/2012/06/euro2012.png" alt="" width="960" height="640" /></a><p class="wp-caption-text">by Silvia Rebelo</p></div>
<p><span id="more-285"></span>Next Wednesday 27 Portugal will be playing Spain at the Euro 2012. Exciting! Not only because there is a sense of revenge after Portugal being defeated by their neighbours in the World Cup two years ago, but personally because these two teams are REALLY special to me.</p>
<p>I&#8217;m half portuguese so Portugal means a lot to me, but Spain have the players I follow along the whole year and most importantly, they have a lot of Barcelona players, the team of my heart. I actually started supporting Barcelona because of the well known portuguese player Figo, so there it is&#8230;</p>
<p>So, if you ask me to name ONE team to go through I will say Portugal, definitely! But I won&#8217;t be too sad if Spain goes instead.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.silviarebelo.com/2012/06/portugal-vs-spain-2-years-later/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>HTML5 canvas and the memory game</title>
		<link>http://www.silviarebelo.com/2012/04/html5-canvas-and-the-memory-game/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=html5-canvas-and-the-memory-game</link>
		<comments>http://www.silviarebelo.com/2012/04/html5-canvas-and-the-memory-game/#comments</comments>
		<pubDate>Sat, 14 Apr 2012 15:09:37 +0000</pubDate>
		<dc:creator>Silvia Rebelo</dc:creator>
				<category><![CDATA[Canvas]]></category>
		<category><![CDATA[HTML / HTML5]]></category>

		<guid isPermaLink="false">http://silviarebelo.com/?p=240</guid>
		<description><![CDATA[This week I finally had the chance to start looking at this book I bought a few months ago,  it&#8217;s called The essential guide to HTML5. The book is based on a bunch of exercises (games really) using JavaScript and HTML5 Canvas, &#8230; <a href="http://www.silviarebelo.com/2012/04/html5-canvas-and-the-memory-game/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>This week I finally had the chance to start looking at this book I bought a few months ago,  it&#8217;s called <a title="The Essential guide to HTML5" href="http://www.amazon.co.uk/The-Essential-Guide-HTML5-JavaScript/dp/1430233834" target="_blank">The essential guide to HTML5</a>. The book is based on a bunch of exercises (games really) using JavaScript and HTML5 Canvas, ready to put into code and test. It doesn&#8217;t get into theory but for those looking to get things working quickly, this is definitely a good one.</p>
<p>So I decided to make the &#8220;<a title="Memory Game using canvas" href="http://silviarebelo.com/demos/memorygame/" target="_blank">Memory Game</a>&#8221; to learn about the basics of canvas:</p>
<p><a title="Memory Game using canvas" href="http://silviarebelo.com/demos/memorygame/" target="_blank"><img class="aligncenter size-full wp-image-241" title="memorygame" src="http://silviarebelo.com/wp-content/uploads/2012/04/memorygame.jpg" alt="" width="863" height="353" /></a></p>
<p>So, what is canvas? and what you can do with it?<span id="more-240"></span></p>
<p><strong>&lt;canvas&gt;</strong> is a HTML5 element used to draw graphics using JavaScript (most of the times). Imagine a blank paper where you can draw shapes, images and text. When adding  it to your page it exposes one or more rendering contexts which are used to create and manipulate the content that will be displayed. The demo uses the 2d context.</p>
<p>Canvas are mostly used for creating graphics, animations, games and images compositions.</p>
<p>The basic code for using and initialising a canvas will look like this:</p>
<p><strong>HTML code</strong></p>
<div class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;canvas <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;mainCanvas&quot;</span> <span style="color: #000066;">width</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;900&quot;</span> <span style="color: #000066;">height</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;600&quot;</span>&gt;</span><br />
Sorry, your browser doesn't support the HTML5 element canvas.<br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>canvas&gt;</span></div></div>
<p>The id wil be used to initialise the canvas using JavaScript, the width and height to set the size of it and the text inside will be used as a callback when the browser doesn&#8217;t support it (check this useful <a title="Browsers that support canvas" href="http://caniuse.com/#feat=canvas" target="_blank">link</a> to see the list of browsers and versions that support canvas).</p>
<p><strong>JavaScript code</strong></p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">var</span> canvas <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'mainCanvas'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #006600; font-style: italic;">// check if browser supports it</span><br />
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>canvas <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> canvas.<span style="color: #660066;">getContext</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
ctx <span style="color: #339933;">=</span> canvas.<span style="color: #660066;">getContext</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'2d'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>ctx<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<span style="color: #006600; font-style: italic;">// Start drawing here</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p><strong><br />
Start drawing!<br />
</strong>If you want to learn more about canvas check out this <a title="Basic usage of canvas" href="https://developer.mozilla.org/en/Canvas_tutorial%3ABasic_usage" target="_blank">link</a>. It&#8217;s from the Mozilla developer&#8217;s website and it helped me a lot with the theory behind canvas and all the things you can create. As you will see, there is a lot of possibilities and all depends in what you want to achieve.</p>
<p><strong>Check out the demo<br />
</strong>To see the memory card demo click <a title="Memory card canvas demo" href="http://silviarebelo.com/demos/memorygame/" target="_blank">here</a> and its javaScript code <a href="http://silviarebelo.com/demos/memorygame/js/game.js" target="_blank">here</a>. Bear on mind this is a basic example only for practice purposes =)</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.silviarebelo.com/2012/04/html5-canvas-and-the-memory-game/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS: box-sizing, so glad I&#8217;ve found you!</title>
		<link>http://www.silviarebelo.com/2012/02/css-box-sizing-so-glad-ive-found-you/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=css-box-sizing-so-glad-ive-found-you</link>
		<comments>http://www.silviarebelo.com/2012/02/css-box-sizing-so-glad-ive-found-you/#comments</comments>
		<pubDate>Sun, 19 Feb 2012 22:48:59 +0000</pubDate>
		<dc:creator>Silvia Rebelo</dc:creator>
				<category><![CDATA[CSS / CSS3]]></category>

		<guid isPermaLink="false">http://silviarebelo.com/?p=198</guid>
		<description><![CDATA[So you&#8217;re writing some CSS for your website. You are about to &#8220;theme&#8221; an element, let&#8217;s say a DIV, you set a width to it in order to look as you want. Then you add some content inside and most &#8230; <a href="http://www.silviarebelo.com/2012/02/css-box-sizing-so-glad-ive-found-you/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>So you&#8217;re writing some CSS for your website. You are about to &#8220;theme&#8221; an element, let&#8217;s say a DIV, you set a width to it in order to look as you want. Then you add some content inside and most likely you will add some padding (to add some space).</p>
<p>In the <a href="http://www.w3schools.com/css/css_boxmodel.asp" target="_blank">CSS &#8220;box-model&#8221;</a> what will happen is that the width of the element (and the height) will be increased due to the padding applied. If the width was set to 100px and you added 20px padding, the rendered element will measure 140px (100px + 20px padding left + 20px padding right)</p>
<p><a href="http://silviarebelo.com/wp-content/uploads/2012/02/box-model1.jpg"><img class="aligncenter size-full wp-image-215" title="box-model" src="http://silviarebelo.com/wp-content/uploads/2012/02/box-model1.jpg" alt="" width="333" height="329" /><span id="more-198"></span></a>But 140px doesn&#8217;t fit in your layout! (that&#8217;s why you set it to be 100px in first place!) You will need then to re-mesure all over again and start decreasing widths all around your CSS&#8230;. in short: a bit of a nightmare!</p>
<p>But hey! did you know there is a MAGIC property that allows you to add padding and borders to your elements without even bothering about the expanding issue explained above?</p>
<p>It&#8217;s called <strong>box-sizing</strong>, and what it does is to subtract pixels from the original size (instead of adding them). To use it just add these lines to the element you want to keep the size you are specifically setting:</p>
<div class="codecolorer-container css default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #cc00cc;">#main</span> <span style="color: #00AA00;">&#123;</span><br />
box-sizing<span style="color: #00AA00;">:</span> border-box<span style="color: #00AA00;">;</span><br />
-moz-box-sizing<span style="color: #00AA00;">:</span> border-box<span style="color: #00AA00;">;</span><br />
-webkit-box-sizing<span style="color: #00AA00;">:</span> border-box<span style="color: #00AA00;">;</span><br />
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span><span style="color: #00AA00;">;</span><br />
<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">20px</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span></div></div>
<p>There is a great <a href="http://paulirish.com/2012/box-sizing-border-box-ftw/" target="_blank">article</a> by Paul Irish suggesting the idea of using the property to the universal selector, meaning all elements will have it. I personally find it brilliant, but it&#8217;s up to you to use it that way.</p>
<p>Unfortunately, as you may have already guessed, this only works for new browsers (IE8+) but that&#8217;s not that bad, isn&#8217;t? <img src='http://www.silviarebelo.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.silviarebelo.com/2012/02/css-box-sizing-so-glad-ive-found-you/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Romina Amaro Photography</title>
		<link>http://www.silviarebelo.com/2012/02/romina-amaro-photography/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=romina-amaro-photography</link>
		<comments>http://www.silviarebelo.com/2012/02/romina-amaro-photography/#comments</comments>
		<pubDate>Sat, 18 Feb 2012 19:22:03 +0000</pubDate>
		<dc:creator>Silvia Rebelo</dc:creator>
				<category><![CDATA[Photography]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://silviarebelo.com/?p=187</guid>
		<description><![CDATA[Hello everybody! It&#8217;s been a while since my last post. Just wanted to share this website, it&#8217;s a beautiful portfolio from a very talented friend. I helped her putting the site together but the photos stand out by themselves. If &#8230; <a href="http://www.silviarebelo.com/2012/02/romina-amaro-photography/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Hello everybody! It&#8217;s been a while since my last post. Just wanted to share this website, it&#8217;s a beautiful portfolio from a very talented friend. I helped her putting the site together but the photos stand out by themselves.</p>
<p>If you like the photos, feel free to share them using the social buttons inside of each gallery or pinning them on <a href="http://www.pinterest.com">Pinterest</a>! Big Thanks!</p>
<p>This is the link: <a href="http://www.rominaamaro.com" target="_blank">www.rominaamaro.com</a></p>
<p><a href="http://www.rominaamaro.com" target="_blank"><img class="aligncenter size-full wp-image-188" title="rominaamaro" src="http://silviarebelo.com/wp-content/uploads/2012/02/rominaamaro.jpg" alt="" width="605" height="364" /></a></p>
<p>If you are interested in the WordPress theme used in the website, check it out <a href="http://portfolium.wpshower.com/" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.silviarebelo.com/2012/02/romina-amaro-photography/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
