<?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>Flying memes &#187; css3</title>
	<atom:link href="http://sandropaganotti.com/tag/css3/feed/" rel="self" type="application/rss+xml" />
	<link>http://sandropaganotti.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Fri, 23 Mar 2012 19:07:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Building a company logo using CSS3</title>
		<link>http://sandropaganotti.com/2012/03/15/building-a-company-logo-using-css3/</link>
		<comments>http://sandropaganotti.com/2012/03/15/building-a-company-logo-using-css3/#comments</comments>
		<pubDate>Thu, 15 Mar 2012 22:33:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Annunci]]></category>
		<category><![CDATA[Interfaccie]]></category>
		<category><![CDATA[css3]]></category>

		<guid isPermaLink="false">http://sandropaganotti.com/?p=578</guid>
		<description><![CDATA[I&#8217;ve recently left my job to found a new company called &#8216;Comparto Web&#8216;; to showcase some of our CSS3 skills I decided to implement the logo using only HTML elements and taking advantage of some new properties such as transitions and animations. Here&#8217;s the HTML code: &#60;div id="background_gears"&#62; &#60;img src="svg/gear.svg" class="big_gear"&#62; &#60;img src="svg/gear.svg" class="small_gear"&#62; &#60;/div&#62; &#60;div [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently left my job to found a new company called &#8216;<a href="http://www.compartoweb.com" target="_blank">Comparto Web</a>&#8216;; to showcase some of our CSS3 skills I decided to implement the logo using only HTML elements and taking advantage of some new properties such as transitions and animations.</p>
<p><span id="more-578"></span><br />
Here&#8217;s the HTML code:<br />
<code class="html"></p>
<pre>&lt;div id="background_gears"&gt;
&lt;img src="svg/gear.svg" class="big_gear"&gt;
&lt;img src="svg/gear.svg" class="small_gear"&gt;
&lt;/div&gt;

&lt;div id="home"&gt;
&lt;figure&gt;
&lt;img src="svg/gear.svg" class="big_gear"&gt;
&lt;img src="svg/gear.svg" class="small_gear"&gt;
&lt;h2&gt;&lt;a data-title="Comparto Web"&gt;Comparto Web&lt;/a&gt;&lt;/h2&gt;
&lt;/figure&gt;
&lt;div&gt;
</pre>
<p></code></p>
<p>To animate the two gears I used CSS3 animations:<br />
<code class="css">
<pre>
.big_gear{
	position: absolute;
	opacity: 0.85;
	width: 7.6em;
	top: -3.0em;
	right: -2.7em;
	animation-name: clockwise;
	animation-duration: 20s;
	animation-iteration-count: infinite;
	animation-timing-function: linear;
}

.small_gear{
	opacity: 0.8;
	position: absolute;
	width: 4em;
	bottom: 0.2em;
	left: -0.8em;
	animation-name: counterclockwise;
	animation-duration: 12.808s;
	animation-iteration-count: infinite;
	animation-timing-function: linear;
}

@keyframes clockwise{
	from{
		transform: rotate(0deg);
	}
	to{
		transform: rotate(360deg);
	}
}

@keyframes counterclockwise{
	from{
		transform: rotate(360deg);
	}
	to{
		transform: rotate(0deg);
	}
}
</pre>
<p></code></p>
<p>and to create a text inset shadow effect I followed <a href="http://dabblet.com/gist/1609945" target="_blank">this</a> beautiful example from <a href="http://hugwebdesign.com/" target="_blank">Daniel Hug</a> found on Dabblet.</p>
<p>You can check the result simply by visiting <a href="http://www.compartoweb.com" target="_blank">http://www.compartoweb.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://sandropaganotti.com/2012/03/15/building-a-company-logo-using-css3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using the :required pseudo selector to enhance forms</title>
		<link>http://sandropaganotti.com/2011/08/14/using-the-required-pseudo-selector-to-enhance-forms/</link>
		<comments>http://sandropaganotti.com/2011/08/14/using-the-required-pseudo-selector-to-enhance-forms/#comments</comments>
		<pubDate>Sun, 14 Aug 2011 11:29:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Interfaccie]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[required]]></category>

		<guid isPermaLink="false">http://sandropaganotti.com/?p=542</guid>
		<description><![CDATA[Lately I come up with this idea on how to enhance a form by using the :required pseudo element. What you can do is mix this new pseudo element with the &#8216;+&#8217; selector in order to modify elements that are adjacent to your input tag, such as the label. Here&#8217;s an example: input:required + label:after [...]]]></description>
			<content:encoded><![CDATA[<p>Lately I come up with this idea on how to enhance a form by using the <a href="http://www.w3.org/TR/css3-ui/#pseudo-required-value">:required</a> pseudo element. What you can do is mix this new pseudo element with the <a href="http://www.w3schools.com/cssref/sel_element_pluss.asp">&#8216;+&#8217;</a> selector in order to modify elements that are adjacent to your input tag, such as the label.</p>
<p><span id="more-542"></span>Here&#8217;s an example:</p>
<pre><code class="css">
input:required + label:after {
  content: ' *';
  color: black;
}
</code></pre>
<p>By this way you are able to dynamically append the classic &#8216;*&#8217; to the labels that belongs to input tags with the required flag. Obviously you have to put the label after the input tag but then you can revert this structure by using some CSS float instructions.</p>
<p>Here&#8217;s the running example:</p>
<p><iframe style="width: 100%; height: 300px;" src="http://jsfiddle.net/sandro_paganotti/9tyhz/3/embedded/css,html,result" width="320" height="240"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://sandropaganotti.com/2011/08/14/using-the-required-pseudo-selector-to-enhance-forms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A pure CSS3 coverflow effect for Chrome, Firefox and Safari</title>
		<link>http://sandropaganotti.com/2011/08/05/a-pure-css3-coverflow-effect-for-chrome-firefox-and-safari/</link>
		<comments>http://sandropaganotti.com/2011/08/05/a-pure-css3-coverflow-effect-for-chrome-firefox-and-safari/#comments</comments>
		<pubDate>Thu, 04 Aug 2011 22:23:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Interfaccie]]></category>
		<category><![CDATA[coverflow]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[transform]]></category>
		<category><![CDATA[transition]]></category>

		<guid isPermaLink="false">http://sandropaganotti.com/?p=516</guid>
		<description><![CDATA[I&#8217;ve been recently playing with some of the newest CSS3 features, such as pseudoclasses selectors, transition and transform properties and attr(). In order to have something concrete on which test these features  I created a coverflow effect that works only out of CSS instructions without the use of javascript. I used some of the amazing [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been recently playing with some of the newest CSS3 features, such as <a href="http://www.w3.org/TR/css3-selectors/" target="_blank">pseudoclasses selectors</a>, <a href="http://www.w3.org/TR/css3-transitions/" target="_blank">transition</a> and <a href="http://dev.w3.org/csswg/css3-3d-transforms/" target="_blank">transform</a> properties and <a href="http://www.w3.org/TR/css3-values/#attribute" target="_blank">attr()</a>. In order to have something concrete on which test these features  I created <a href="http://sandropaganotti.com/wp-content/goodies/demos/cards/index.html#aela" target="_blank">a coverflow effect that works only out of CSS instructions without the use of javascript</a>.</p>
<p><span id="more-516"></span><br />
I used some of the amazing CSS 3D transformations to archieve this effect under WebKit based browsers. Here&#8217;s a snippet from the page:</p>
<pre><code class="css"> 
  #container{
     margin: 0 auto;
     width: 100%;
     height: 90%;
     max-width: 1024px;
     -webkit-transform-style: preserve-3d;
     -webkit-perspective: 900;
     -webkit-perspective-origin: 100% 30%;
  }
</code></pre>
<p>The container, which is the div that hold the rest of the elements, has some <a href="http://www.webkit.org/blog/386/3d-transforms/" target="_blank">-webkit-*</a> experimental properties that set the position and the distance of the point of view of the user from the scene, as much as it happens with 3D software.</p>
<p>After this each card needs to be rotated against its Y axes; here comes to rescue another CSS3 property:</p>
<pre><code class="css">
  .card{
     -webkit-transform: rotateY( 120deg);
  }
</code></pre>
<p>Then, all you need is find a way to trigger a change of CSS properties in your .card elements while specifying a transition which handles this change smoothly. So first let&#8217;s add this transition:</p>
<pre><code class="css">
  .card{
     -webkit-transition: all 1s ease-out;
  }
</code></pre>
<p>And then let&#8217;s use the :target pseudoclass which gets applied to an &lt;a&gt; element when its name became part of the URL (either because clicked or typed):</p>
<pre><code class="css">
  .card:target{
    -webkit-transform: rotateY( 0deg);
  }
</code></pre>
<p><img src="http://sandropaganotti.com/wp-content/uploads/2011/08/ishot-516-1024x601.png" alt="" title="ishot-516" width="600" class="aligncenter size-large wp-image-535" /></p>
<p>The trickiest part is then try to make this thing works also under Firefox which doesn&#8217;t have 3D transformations. It turns out that you can emulate them by using wisely the skew(xdeg, ydeg) transform, so you can do the following:</p>
<pre><code class="css">
  .card{
     -moz-transform: skew(0deg,-35deg) scale(0.70);
  }
  .card:target{
     -moz-transform: skew(0deg,0deg) scale(1);
  }
</code></pre>
<p>Good, but now there&#8217;s another challenge: how to solve this ?</p>
<p><img src="http://sandropaganotti.com/wp-content/uploads/2011/08/ishot-513-1024x611.png" alt="" title="ishot-513" width="600" class="aligncenter size-large wp-image-526" /></p>
<p>The elements on the right side of the selected one have two issues: they should be inclined on the opposite angle and the way they overlap each other should also be reversed. </p>
<p>To solve the first part we can rely on the <a href="http://w3schools.com/cssref/sel_gen_sibling.asp" target="_blank">~ selector</a> to tell the browser that each element following the selected one must obey to a different skew angle:</p>
<pre><code class="css">
  .card:target ~ .card{
    -moz-transform: skew(0deg,20deg) scale(0.70);
  }
</code></pre>
<p><img src="http://sandropaganotti.com/wp-content/uploads/2011/08/ishot-514-1024x611.png" alt="" title="ishot-514" width="600" class="aligncenter size-large wp-image-529" /></p>
<p>The only solution I found to archive the second issue is to use the <a href="http://w3schools.com/cssref/sel_element_pluss.asp" target="_blank">+ selector</a> iteratively in order to assign a z-index to an element based on its distance from the selected one: </p>
<pre><code class="css">
  .card:target + .card{
    z-index: 10;
  }

  .card:target + .card + .card{
    z-index: 9;
  }

  .card:target + .card + .card + .card {
    z-index: 8;
  }

  .card:target + .card + .card + .card + .card{
    z-index: 7;
  }

  .card:target + .card + .card + .card + .card + .card{
    z-index: 6;
  }

  .card:target + .card + .card + .card + .card + .card + .card{
    z-index: 5;
  }

  .card:target + .card + .card + .card + .card + .card + .card + .card{
    z-index: 4;
  }

  .card:target + .card + .card + .card + .card + .card + .card + .card + .card{
    z-index: 3;
  }

  .card:target + .card + .card + .card + .card + .card + .card + .card + .card + .card{
    z-index: 2;
  }

  .card:target + .card + .card + .card + .card + .card + .card + .card + .card + .card + .card{
    z-index: 1;
  }
</code></pre>
<p>Here&#8217;s the final result:<br />
<img src="http://sandropaganotti.com/wp-content/uploads/2011/08/ishot-515-1024x611.png" alt="" title="ishot-515" width="600" class="aligncenter size-large wp-image-532" /></p>
<p>You can have a working demo at this address:<br />
<a href="http://sandropaganotti.com/wp-content/goodies/demos/cards/index.html#aela" target="_blank">http://sandropaganotti.com/wp-content/goodies/demos/cards/index.html#aela</a></p>
]]></content:encoded>
			<wfw:commentRss>http://sandropaganotti.com/2011/08/05/a-pure-css3-coverflow-effect-for-chrome-firefox-and-safari/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A mouse driven CSS3 &#8216;rotate3d&#8217; parallax gallery for Safari</title>
		<link>http://sandropaganotti.com/2010/09/09/a-mouse-driven-css3-rotate3d-parallax-gallery-for-safari/</link>
		<comments>http://sandropaganotti.com/2010/09/09/a-mouse-driven-css3-rotate3d-parallax-gallery-for-safari/#comments</comments>
		<pubDate>Wed, 08 Sep 2010 22:33:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Interfaccie]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[gallery]]></category>
		<category><![CDATA[parallax]]></category>
		<category><![CDATA[rotate3d]]></category>

		<guid isPermaLink="false">http://sandropaganotti.com/?p=437</guid>
		<description><![CDATA[I&#8217;m recently enjoying KillZone 2 so much; during one of my gaming sessions I noticed that the loading screen is designed as a bas-relief that you can partially rotate using the joypad oscilloscope, this technique, although easy to implement in a PS3 game, produce a very interesting effect and so I decided to try to [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m recently enjoying <a href="http://en.wikipedia.org/wiki/Killzone_2" target="_blank">KillZone 2</a> so much; during one of my gaming sessions I noticed that the loading screen is designed as a bas-relief that you can partially rotate using the joypad oscilloscope, this technique, although easy to implement in a PS3 game, produce a very interesting effect and so I decided to try to transpose it to a web gallery.</p>
<p><span id="more-437"></span></p>
<p>To archive such effect I used CSS3 3d properties, in particular the &#8216;<a href="http://developer.apple.com/library/safari/#documentation/appleapplications/reference/SafariCSSRef/Articles/Functions.html#//apple_ref/doc/uid/TP40007955-SW16" target="_blank">rotate3d</a>&#8216; one; here&#8217;s the portion of html used to define the picture: three divs have been used as layers with &#8216;preserve3d&#8217; and &#8216;translateZ&#8217; to specify the distance between each of them:</p>
<pre><code class="javascript">&lt;div style="position: absolute; top: 50%; left:50%; margin-left: -350px; margin-top: -233px;
            -webkit-perspective: 1000;" &gt;
  &lt;div id="picture" style="height: 466px;
          width: 699px;
          -webkit-transform-style: preserve-3d;
          background: url('flowers.png') no-repeat;
          "&gt;
          &lt;div style="width: 377px;
                height: 424px; background: url('body.png') no-repeat;
                position: absolute;
                -webkit-transform: translateZ(20px);
                top: 45px; left: 75px;"&gt;
          &lt;/div&gt;
          &lt;div style="position: absolute;
          -webkit-transform: translateZ(30px);
          bottom: 0px; right: 0px; padding-left: 30px; padding-right: 30px;
          background: rgba(0,0,0,0.6);     font-family: 'Lobster', arial, serif;
          color: #FFF; font-size: 30px; line-height: 60px; text-align:center;"&gt;
            Francy taking pictures
          &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
</code></pre>
<p>Next I wrote a small JQuery flavored Javascript to rotate the &#8216;layer0&#8242; div according to mouse position; the other two divs follows the rotation of the first automatically preserving the 3D spatial relations.</p>
<pre><code class="javascript">$(document).ready(function() {
    $('body').mousemove(function(event) {
        cx = Math.ceil($('body').width() / 2.0);
        cy = Math.ceil($('body').height() / 2.0);
        dx = event.pageX - cx;
        dy = event.pageY - cy;

        tiltx = (dy / cy);
        tilty = - (dx / cx);
        radius = Math.sqrt(Math.pow(tiltx,2) + Math.pow(tilty,2));
        degree = (radius * 20);

        $('#picture').css('-webkit-transform','rotate3d(' + tiltx + ', ' + tilty + ', 0, ' + degree + 'deg)');
    });
});
</code></pre>
<p>And that&#8217;s all; you can try the demo at this link: <a href="http://sandropaganotti.com/wp-content/goodies/demos/wow-parallax/parallax-gallery.html" target="_blank">Parallax Gallery</a>, please note <strong>that only works on Safari</strong>; here&#8217;s a screenshot of the effect in action:</p>
<p><a href="http://sandropaganotti.com/wp-content/goodies/demos/wow-parallax/parallax-gallery.html" target="_blank"><img class="aligncenter size-full wp-image-439" title="Francy taking pictures" src="http://sandropaganotti.com/wp-content/uploads/2010/09/ishot-2401.png" alt="" width="600" height="472" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://sandropaganotti.com/2010/09/09/a-mouse-driven-css3-rotate3d-parallax-gallery-for-safari/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Euruko 2010 and some CSS3 experiments</title>
		<link>http://sandropaganotti.com/2010/06/06/euruko-2010-and-some-css3-experiments/</link>
		<comments>http://sandropaganotti.com/2010/06/06/euruko-2010-and-some-css3-experiments/#comments</comments>
		<pubDate>Sun, 06 Jun 2010 13:34:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Annunci]]></category>
		<category><![CDATA[Approfondimenti]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[Euruko 2010]]></category>

		<guid isPermaLink="false">http://sandropaganotti.com/?p=386</guid>
		<description><![CDATA[update 14/07/2010: rubyinside.com featured my speaker showcase ! Here&#8217;s the post ! update 19/06/2010: my speakers showcase gets a dedicated post at euruko2010 official blog from Ela. Thanks guys ! Euruko 2010 is over. It was a great week-end spent among cool people having fun and talking about Ruby. As Matz said &#8220;we have a [...]]]></description>
			<content:encoded><![CDATA[<p><strong>update 14/07/2010: </strong><a href="http://rubyinside.com">rubyinside.com</a> featured my speaker showcase ! <a href="http://www.rubyinside.com/euruko-2010-presentations-3538.html">Here&#8217;s the post </a>!</p>
<p><strong>update 19/06/2010: </strong>my <a href="http://euruko2010.heroku.com" target="_blank">speakers showcase</a> gets a dedicated post at <a href="http://euruko2010.org" target="_blank">euruko2010 official blog</a> from <a href="http://twitter.com/elamadej">Ela</a>. Thanks guys !</p>
<p><a href="http://euruko2010.org">Euruko 2010</a> is over. It was a great week-end spent among cool people having fun and talking about Ruby. As Matz said &#8220;we have a nice community&#8221;, and that&#8217;s absolutely true. To honor this conference (and to test some CSS3 features ^_^ ) <a href="http://euruko2010.heroku.com" target="_blank">I&#8217;ve developed a page</a> showcasing the speakers and their talks. For each of them you may find a short summary and some resources (slide, etc..).</p>
<p><span id="more-386"></span>Working with CSS3 highlight some browser performances problem I was unaware before, for example I tried to have a scrolling background under a shadowed box, <a href="http://euruko2010.heroku.com/?bgon=true" target="_blank">you can try this in your browser and notice how it is slow</a>. However if we turn the shadows off the scrolling become smooth again (<a href="http://euruko2010.heroku.com/?bgon=true&amp;shadow_off=true" target="_blank">try this</a>).</p>
<p>Ok, nothing left to say, hope you&#8217;ll enjoy the showcase:</p>
<p style="text-align: center;"><a href="http://euruko2010.heroku.com" target="_blank"><img class="aligncenter size-full wp-image-387" style="border: 1px solid black;" title="ishot-179" src="http://sandropaganotti.com/wp-content/uploads/2010/06/ishot-179.png" alt="" width="529" height="570" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://sandropaganotti.com/2010/06/06/euruko-2010-and-some-css3-experiments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

