Skip to content

Instantly share code, notes, and snippets.

@lastguest
Forked from daneden/dabblet.css
Created August 21, 2012 09:31
Show Gist options
  • Save lastguest/3413917 to your computer and use it in GitHub Desktop.
Save lastguest/3413917 to your computer and use it in GitHub Desktop.
Photo Stack Gallery
/**
* Photo Stack Gallery
*/
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAVUlEQVQYGV2OgQ0AIQgDu4ZzMKBDMSBPeTEVEyQEri0AWESAlW9nLZm9F8alLFbOXlB9P6lK3krZH5JKRR6QSsNzZpJLJW+mDnk9ZyZaKEnPzaNzaB+YaWuR6GfrqQAAAABJRU5ErkJggg==),
linear-gradient(#456,#123);
min-height: 100%;
color: #eee;
text-shadow: 0 1px 1px rgba(0,0,0,.3);
font: 100%/1.5 Helvetica Neue, Helvetica, Arial, sans-serif;
text-align: center;
-webkit-font-smoothing: antialiased;
}
a {
color: #eee;
text-decoration: none;
font-weight: 700;
}
a.gallery {
display: inline-block;
margin: 50px;
position: relative;
width: 150px;
padding-top: 174px;
}
a.gallery strong {
display: block;
}
a.gallery img {
display: block;
position: absolute;
top: 0;
left: 0;
padding: 5px;
background: linear-gradient(#fff,#ccc);
width: 150px;
height: 150px;
box-shadow: 0 2px 4px rgba(0,0,0,.5);
transition: .4s cubic-bezier(0.860, 0.000, 0.070, 1.000);
}
a.gallery img:nth-child(3) { transform: rotate(3deg); }
a.gallery img:nth-child(2) { transform: rotate(6deg); }
a.gallery:hover img {
width: 75px;
height: 75px;
}
a.gallery:hover img:nth-child(1) { transform: translate(-3px, -3px); }
a.gallery:hover img:nth-child(3) { transform: translate(-3px, 78px); }
a.gallery:hover img:nth-child(2) { transform: translate(78px, -3px); }
a.gallery:hover img:nth-child(4) { transform: translate(78px, 78px); }
<a href="#" class="gallery">
<img src="http://placekitten.com/g/150/150">
<img src="http://placekitten.com/150/150">
<img src="http://placekitten.com/g/150/150">
<img src="http://placekitten.com/150/150">
<strong>Cats</strong>
<small>54 photos</small>
</a>
<a href="#" class="gallery">
<img src="http://placedog.com/g/150/150">
<img src="http://placedog.com/150/150">
<img src="http://placedog.com/g/150/150">
<img src="http://placedog.com/150/150">
<strong>Dogs</strong>
<small>42 photos</small>
</a>
<a href="#" class="gallery">
<img src="http://placebear.com/g/150/150">
<img src="http://placebear.com/150/150">
<img src="http://placebear.com/g/150/150">
<img src="http://placebear.com/150/150">
<strong>Bears</strong>
<small>72 photos</small>
</a>
{"view":"split-vertical","fontsize":"80","seethrough":"","prefixfree":"1","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment