Skip to content

Instantly share code, notes, and snippets.

@scott23
Created February 10, 2012 19:18
Show Gist options
  • Save scott23/1791890 to your computer and use it in GitHub Desktop.
Save scott23/1791890 to your computer and use it in GitHub Desktop.
Testing perspective transform
/**
* Testing perspective transform
* Hover to see change
* Credit to Marco Kuiper
*/
/* BASIC RESET */
ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,body,html,p,blockquote,fieldset,input{margin:0; padding:0;}
/* HTML ELEMENTS */
body { background-color:#deddcd; font:14px/21px Arial,Helvetica,sans-serif; }
h1 { font: bold 65px/60px Helvetica, Arial, Sans-serif; text-align: center; color: #eee; text-shadow: 0px 2px 6px #333; }
h1 small{ font-size: 20px; text-transform:uppercase; letter-spacing: 14px; display: block; color: #000; }
h2 a { display: block; text-decoration: none; margin: 0 0 30px 0; font: italic 45px Georgia, Times, Serif; text-align: center; color: #bfe1f1; text-shadow: 0px 2px 6px #333; }
h2 a:hover { color: #90bcd0; }
/* COMMON CLASSES */
.break { clear:both; }
/* WRAPPER */
#wrapper { width:960px; margin:40px auto; }
/* CONTENT */
#content { }
#content .info { padding:10px; }
/* MOVIE POSTERS */
#movieposters { list-style:none; margin:100px 0; height:550px; }
#movieposters li { display:inline; float:left;
-webkit-perspective: 500; -webkit-transform-style: preserve-3d;
-webkit-transition-property: perspective; -webkit-transition-duration: 0.5s; }
#movieposters li:hover { -webkit-perspective: 5000; }
#movieposters li img { border:10px solid #fcfafa; -webkit-transform: rotateY(30deg);
-moz-box-shadow:0 3px 10px #888; -webkit-box-shadow:0 3px 10px #888;
-webkit-transition-property: transform; -webkit-transition-duration: 0.5s; }
#movieposters li:hover img { -webkit-transform: rotateY(0deg); }
<!-- content to be placed inside <body>…</body> -->
<div id="wrapper">
<ul id="movieposters">
<li>
<img src="http://demo.marcofolio.net/3d_animation_css3/images/01_iron_man_2.jpg" alt="Iron Man 2" />
</li>
<li>
<img src="http://demo.marcofolio.net/3d_animation_css3/images/02_the_last_airbender.jpg" alt="The Last Airbender" />
</li>
<li>
<img src="http://demo.marcofolio.net/3d_animation_css3/images/03_tron_legacy.jpg" alt="Tron Legacy" />
</li>
</ul>
</div>
{"view":"separate","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment