Skip to content

Instantly share code, notes, and snippets.

@chiragchamoli
Created May 22, 2013 13:52
Show Gist options
  • Save chiragchamoli/5627685 to your computer and use it in GitHub Desktop.
Save chiragchamoli/5627685 to your computer and use it in GitHub Desktop.
Google Card UI
body {
background: #f3f3f3;
}
.card {
background: url(http://i.imgur.com/wpb9BKE.jpg) center center white;
width: 350px;
height: 303px;
box-shadow: 0 1px 2px rgba(0,0,0,0.5);
border-radius: 3px 3px;
margin: 0 auto 10px;
-webkit-transition: all 400ms ease;
-moz-transition: all 400ms ease;
-o-transition: all 400ms ease;
transition: all 400ms ease;
-webkit-transform: translate3d(0px, 100px, 0) rotateX(-30deg) scale(1.25, 1.25);
-moz-transform: translate3d(0px, 100px, 0) rotateX(-30deg) scale(1.25, 1.25);
transform: translate3d(0px, 100px, 0) rotateX(-30deg) scale(1.25, 1.25);
opacity: 0;
}
.card.appeared{
-webkit-transform: translate3d(0px, 0px, 0px) rotateX(0) scale(1, 1);
-moz-transform: translate3d(0px, 0px, 0px) rotateX(0) scale(1, 1);
transform: translate3d(0px, 0px, 0px) rotateX(0) scale(1, 1);
opacity: 1;
}
<div class="card">
</div>
<div class="card">
</div>
<div class="card">
</div>
<div class="card">
</div>
<div class="card">
</div>
<div class="card">
</div>
<div class="card">
</div>
<div class="card">
</div>
<div class="card">
</div>
<div class="card">
</div>
<div class="card">
</div>
<div class="card">
</div>
<div class="card">
</div>
<div class="card">
</div>
<div class="card">
</div>
<div class="card">
</div>
<div class="card">
</div>
<div class="card">
</div>
<div class="card">
</div>
<div class="card">
</div>
<div class="card">
</div>
<div class="card">
</div>
<div class="card">
</div>
<div class="card">
</div>
<div class="card">
</div>
<div class="card">
</div>
<div class="card">
</div>
<div class="card">
</div>
<div class="card">
</div>
<div class="card">
</div>
<div class="card">
</div>
<div class="card">
</div>
<div class="card">
</div>
$(function() {
$(document.body).on('appear', '.card', function(e, $affected) {
// this code is executed for each appeared element
$(this).addClass("appeared");
});
$('.card').appear({force_process: true});
});
@chiragchamoli
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment