-
-
Save hengkiardo/3962895 to your computer and use it in GitHub Desktop.
A CodePen by Maksim Surguy. CSS3 Thumbnails - Photo thumbnails of various styles : embossed, cutout, taped, Glossy, reflected, Morph and glow on hover, iphone style icons.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h4>Inspired by <a href="http://webdesignerwall.com/tutorials/css3-image-styles">http://webdesignerwall.com/tutorials/css3-image-styles</a></h4> | |
<div class="box normal"> | |
<h3>Normal Image (without jQuery background image wrap)</h3> | |
<a href="http://bootsnipp.com"><img src="http://png.findicons.com/files/icons/2682/construction/128/22.png" ></a> | |
<a href="http://bootsnipp.com"><img src="http://png.findicons.com/files/icons/2682/construction/128/21.png"></a> | |
<a href="http://bootsnipp.com"><img src="http://png.findicons.com/files/icons/2682/construction/128/20.png"></a> | |
</div> | |
<div id="demo"> | |
<div class="box circle"> | |
<h3>Circle Image</h3> | |
<a href="http://bootsnipp.com"><img src="http://png.findicons.com/files/icons/2682/construction/128/22.png" ></a> | |
<a href="http://bootsnipp.com"><img src="http://png.findicons.com/files/icons/2682/construction/128/21.png"></a> | |
<a href="http://bootsnipp.com"><img src="http://png.findicons.com/files/icons/2682/construction/128/20.png"></a> | |
</div> | |
<div class="box card"> | |
<h3>Card Image (iPhone style)</h3> | |
<a href="http://bootsnipp.com"><img src="http://png.findicons.com/files/icons/2682/construction/128/22.png" ></a> | |
<a href="http://bootsnipp.com"><img src="http://png.findicons.com/files/icons/2682/construction/128/21.png"></a> | |
<a href="http://bootsnipp.com"><img src="http://png.findicons.com/files/icons/2682/construction/128/20.png"></a> | |
</div> | |
<div class="box embossed"> | |
<h3>Embossed</h3> | |
<a href="http://bootsnipp.com"><img src="http://png.findicons.com/files/icons/2682/construction/128/22.png" ></a> | |
<a href="http://bootsnipp.com"><img src="http://png.findicons.com/files/icons/2682/construction/128/21.png"></a> | |
<a href="http://bootsnipp.com"><img src="http://png.findicons.com/files/icons/2682/construction/128/20.png"></a> | |
</div> | |
<div class="box soft-embossed"> | |
<h3>Soft Embossed</h3> | |
<a href="http://bootsnipp.com"><img src="http://png.findicons.com/files/icons/2682/construction/128/22.png" ></a> | |
<a href="http://bootsnipp.com"><img src="http://png.findicons.com/files/icons/2682/construction/128/21.png"></a> | |
<a href="http://bootsnipp.com"><img src="http://png.findicons.com/files/icons/2682/construction/128/20.png"></a> | |
</div> | |
<div class="box cutout"> | |
<h3>Cutout</h3> | |
<a href="http://bootsnipp.com"><img src="http://png.findicons.com/files/icons/2682/construction/128/22.png" ></a> | |
<a href="http://bootsnipp.com"><img src="http://png.findicons.com/files/icons/2682/construction/128/21.png"></a> | |
<a href="http://bootsnipp.com"><img src="http://png.findicons.com/files/icons/2682/construction/128/20.png"></a> | |
</div> | |
<div class="box morphing-glowing"> | |
<h3>Morphs and Glows on hover</h3> | |
<a href="http://bootsnipp.com"><img src="http://png.findicons.com/files/icons/2682/construction/128/22.png" ></a> | |
<a href="http://bootsnipp.com"><img src="http://png.findicons.com/files/icons/2682/construction/128/21.png"></a> | |
<a href="http://bootsnipp.com"><img src="http://png.findicons.com/files/icons/2682/construction/128/20.png"></a> | |
</div> | |
<div class="box glossy"> | |
<h3>Glossy Icons</h3> | |
<a href="http://bootsnipp.com"><img src="http://png.findicons.com/files/icons/2682/construction/128/22.png" ></a> | |
<a href="http://bootsnipp.com"><img src="http://png.findicons.com/files/icons/2682/construction/128/21.png"></a> | |
<a href="http://bootsnipp.com"><img src="http://png.findicons.com/files/icons/2682/construction/128/20.png"></a> | |
</div> | |
<div class="box reflection"> | |
<h3>Reflected Icons</h3> | |
<a href="http://bootsnipp.com"><img src="http://png.findicons.com/files/icons/2682/construction/128/22.png" ></a> | |
<a href="http://bootsnipp.com"><img src="http://png.findicons.com/files/icons/2682/construction/128/21.png"></a> | |
<a href="http://bootsnipp.com"><img src="http://png.findicons.com/files/icons/2682/construction/128/20.png"></a> | |
</div> | |
<div class="box glossy-reflection"> | |
<h3>Glossy + Reflected Icons</h3> | |
<a href="http://bootsnipp.com"><img src="http://png.findicons.com/files/icons/2682/construction/128/22.png" ></a> | |
<a href="http://bootsnipp.com"><img src="http://png.findicons.com/files/icons/2682/construction/128/21.png"></a> | |
<a href="http://bootsnipp.com"><img src="http://png.findicons.com/files/icons/2682/construction/128/20.png"></a> | |
</div> | |
<div class="box tape"> | |
<h3>Taped Icons</h3> | |
<a href="http://bootsnipp.com"><img src="http://png.findicons.com/files/icons/2682/construction/128/22.png" ></a> | |
<a href="http://bootsnipp.com"><img src="http://png.findicons.com/files/icons/2682/construction/128/21.png"></a> | |
<a href="http://bootsnipp.com"><img src="http://png.findicons.com/files/icons/2682/construction/128/20.png"></a> | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
$("#demo img").load(function() { | |
$(this).wrap(function(){ | |
return '<span class="image-wrap ' + $(this).attr('class') + '" style="position:relative; display:inline-block; background:url(' + $(this).attr('src') + ') no-repeat center center; width: ' + $(this).width() + 'px; height: ' + $(this).height() + 'px;" />'; | |
}); | |
$(this).css("opacity","0"); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
font: 90%/150% Arial, Helvetica, sans-serif; | |
background-image: url('http://subtlepatterns.subtlepatterns.netdna-cdn.com/patterns/billie_holiday.png'); | |
color: #333; | |
width: 800px; | |
margin: 20px auto; | |
} | |
a { | |
color: #F60; | |
text-decoration: none; | |
} | |
h1, h2, h3 { | |
line-height: 110%; | |
} | |
h3 { | |
font: bold 100% Arial, Helvetica, sans-serif; | |
font-size: 2em; | |
text-transform: uppercase; | |
text-shadow: rgba(0,0,0,0.5) -1px 0, rgba(0,0,0,0.3) 0 -1px, rgba(255,255,255,0.5) 1px 1px, rgba(0,0,0,0.3) -1px -1px; | |
margin: 10px; | |
color: #888; | |
} | |
.image-wrap { | |
margin-right: 15px; | |
} | |
.box { | |
margin: 0 0 50px; | |
border-top: solid 1px #ccc; | |
} | |
/************************************************************************************ | |
NORMAL | |
*************************************************************************************/ | |
.normal img { | |
border: solid 5px #000; | |
-webkit-border-radius: 20px; | |
-moz-border-radius: 20px; | |
border-radius: 20px; | |
-webkit-box-shadow: inset 0 1px 5px rgba(0,0,0,.5); | |
-moz-box-shadow: inset 0 1px 5px rgba(0,0,0,.5); | |
box-shadow: inset 0 1px 5px rgba(0,0,0,.5); | |
} | |
/************************************************************************************ | |
CIRCLE | |
*************************************************************************************/ | |
.circle .image-wrap { | |
border: #CCC solid 5px; | |
-webkit-border-radius: 50em; | |
-moz-border-radius: 50em; | |
border-radius: 50em; | |
} | |
/************************************************************************************ | |
PHOTO | |
*************************************************************************************/ | |
.card .image-wrap { | |
-webkit-box-shadow: inset 0 0 1px rgba(0,0,0,.8), inset 0 2px 0 rgba(255,255,255,.5), inset 0 -1px 0 rgba(0,0,0,.4); | |
-moz-box-shadow: inset 0 0 1px rgba(0,0,0,.8), inset 0 2px 0 rgba(255,255,255,.5), inset 0 -1px 0 rgba(0,0,0,.4); | |
box-shadow: inset 0 0 1px rgba(0,0,0,.8), inset 0 2px 0 rgba(255,255,255,.5), inset 0 -1px 0 rgba(0,0,0,.4); | |
-webkit-border-radius: 20px; | |
-moz-border-radius: 20px; | |
border-radius: 20px; | |
} | |
/************************************************************************************ | |
EMBOSSED | |
*************************************************************************************/ | |
.embossed .image-wrap { | |
-webkit-box-shadow: inset 0 0 2px rgba(0,0,0,.8), inset 0 2px 0 rgba(255,255,255,.5), inset 0 -7px 0 rgba(0,0,0,.6), inset 0 -9px 0 rgba(255,255,255,.3); | |
-moz-box-shadow: inset 0 0 2px rgba(0,0,0,.8), inset 0 2px 0 rgba(255,255,255,.5), inset 0 -7px 0 rgba(0,0,0,.6), inset 0 -9px 0 rgba(255,255,255,.3); | |
box-shadow: inset 0 0 2px rgba(0,0,0,.8), inset 0 2px 0 rgba(255,255,255,.5), inset 0 -7px 0 rgba(0,0,0,.6), inset 0 -9px 0 rgba(255,255,255,.3); | |
-webkit-border-radius: 20px; | |
-moz-border-radius: 20px; | |
border-radius: 20px; | |
} | |
/************************************************************************************ | |
SOFT EMBOSSED | |
*************************************************************************************/ | |
.soft-embossed .image-wrap { | |
-webkit-box-shadow: inset 0 0 4px rgba(0,0,0,1), inset 0 2px 1px rgba(255,255,255,.5), inset 0 -9px 2px rgba(0,0,0,.6), inset 0 -12px 2px rgba(255,255,255,.3); | |
-moz-box-shadow: inset 0 0 4px rgba(0,0,0,1), inset 0 2px 1px rgba(255,255,255,.5), inset 0 -9px 2px rgba(0,0,0,.6), inset 0 -12px 2px rgba(255,255,255,.3); | |
box-shadow: inset 0 0 4px rgba(0,0,0,1), inset 0 2px 1px rgba(255,255,255,.5), inset 0 -9px 2px rgba(0,0,0,.6), inset 0 -12px 2px rgba(255,255,255,.3); | |
-webkit-border-radius: 20px; | |
-moz-border-radius: 20px; | |
border-radius: 20px; | |
} | |
/************************************************************************************ | |
CUTOUT | |
*************************************************************************************/ | |
.cutout { | |
background: #222; | |
padding: 20px 40px 50px; | |
color: #fff; | |
-webkit-border-radius: 20px; | |
-moz-border-radius: 20px; | |
border-radius: 20px; | |
} | |
.cutout .image-wrap { | |
-webkit-box-shadow: 0 1px 0 rgba(255,255,255,.2), inset 0 4px 5px rgba(0,0,0,.6), inset 0 1px 0 rgba(0,0,0,.6); | |
-moz-box-shadow: 0 1px 0 rgba(255,255,255,.2), inset 0 4px 5px rgba(0,0,0,.6), inset 0 1px 0 rgba(0,0,0,.6); | |
box-shadow: 0 1px 0 rgba(255,255,255,.2), inset 0 4px 5px rgba(0,0,0,.6), inset 0 1px 0 rgba(0,0,0,.6); | |
-webkit-border-radius: 30em; | |
-moz-border-radius: 30em; | |
border-radius: 30em; | |
} | |
/************************************************************************************ | |
MORPHING + GLOWING | |
*************************************************************************************/ | |
.morphing-glowing { | |
background: #222; | |
padding: 20px 20px 50px; | |
color: #fff; | |
-webkit-border-radius: 20px; | |
-moz-border-radius: 20px; | |
border-radius: 20px; | |
} | |
.morphing-glowing .image-wrap { | |
-webkit-transition: 0.5s; | |
-moz-transition: 0.5s; | |
transition: 0.5s; | |
-webkit-border-radius: 20px; | |
-moz-border-radius: 20px; | |
border-radius: 20px; | |
} | |
.morphing-glowing .image-wrap:hover { | |
-webkit-box-shadow: 0 0 20px rgba(255,255,255,.6), inset 0 0 20px rgba(255,255,255,1); | |
-moz-box-shadow: 0 0 20px rgba(255,255,255,.6), inset 0 0 20px rgba(255,255,255,1); | |
box-shadow: 0 0 20px rgba(255,255,255,.6), inset 0 0 20px rgba(255,255,255,1); | |
-webkit-border-radius: 20em; | |
-moz-border-radius: 20em; | |
border-radius: 20em; | |
} | |
/************************************************************************************ | |
GLOSSY | |
*************************************************************************************/ | |
.glossy { | |
background: #333; | |
padding: 20px 40px 50px; | |
color: #fff; | |
-webkit-border-radius: 20px; | |
-moz-border-radius: 20px; | |
border-radius: 20px; | |
} | |
.glossy .image-wrap { | |
-webkit-box-shadow: inset 0 -1px 0 rgba(0,0,0,.5); | |
-moz-box-shadow: inset 0 -1px 0 rgba(0,0,0,.5); | |
box-shadow: inset 0 -1px 0 rgba(0,0,0,.5); | |
-webkit-border-radius: 20px; | |
-moz-border-radius: 20px; | |
border-radius: 20px; | |
} | |
.glossy .image-wrap:after { | |
position: absolute; | |
content: ' '; | |
width: 100%; | |
height: 50%; | |
top: 0; | |
left: 0; | |
-webkit-border-radius: 20px; | |
-moz-border-radius: 20px; | |
border-radius: 20px; | |
background: -moz-linear-gradient(top, rgba(255,255,255,0.7) 0%, rgba(255,255,255,.1) 100%); | |
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,0.7)), color-stop(100%,rgba(255,255,255,.1))); | |
background: linear-gradient(top, rgba(255,255,255,0.7) 0%,rgba(255,255,255,.1) 100%); | |
} | |
/************************************************************************************ | |
REFLECTION | |
*************************************************************************************/ | |
.reflection .image-wrap { | |
-webkit-box-shadow: inset 0 0 1px rgba(0,0,0,.5), inset 0 2px 0 rgba(255,255,255,.5), inset 0 -1px 0 rgba(0,0,0,.5); | |
-moz-box-shadow: inset 0 0 1px rgba(0,0,0,.5), inset 0 2px 0 rgba(255,255,255,.5), inset 0 -1px 0 rgba(0,0,0,.5); | |
box-shadow: inset 0 0 1px rgba(0,0,0,.5), inset 0 2px 0 rgba(255,255,255,.5), inset 0 -1px 0 rgba(0,0,0,.5); | |
-webkit-transition: .5s; | |
-moz-transition: .5s; | |
transition: .5s; | |
-webkit-border-radius: 20px; | |
-moz-border-radius: 20px; | |
border-radius: 20px; | |
} | |
.reflection .image-wrap:after { | |
position: absolute; | |
content: ' '; | |
width: 100%; | |
height: 30px; | |
bottom: -31px; | |
left: 0; | |
-webkit-border-top-left-radius: 20px; | |
-webkit-border-top-right-radius: 20px; | |
-moz-border-radius-topleft: 20px; | |
-moz-border-radius-topright: 20px; | |
border-top-left-radius: 20px; | |
border-top-right-radius: 20px; | |
background: -moz-linear-gradient(top, rgba(0,0,0,.3) 0%, rgba(255,255,255,0) 100%); | |
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(0,0,0,.3)), color-stop(100%,rgba(255,255,255,0))); | |
background: linear-gradient(top, rgba(0,0,0,.3) 0%,rgba(255,255,255,0) 100%); | |
} | |
.reflection .image-wrap:hover { | |
position: relative; | |
top: -8px; | |
} | |
/************************************************************************************ | |
GLOSSY + REFLECTION | |
*************************************************************************************/ | |
.glossy-reflection { | |
background: #444; | |
padding: 20px 40px 50px; | |
color: #fff; | |
-webkit-border-radius: 20px; | |
-moz-border-radius: 20px; | |
border-radius: 20px; | |
} | |
.glossy-reflection .image-wrap { | |
-webkit-box-shadow: inset 0 -1px 0 rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.6); | |
-moz-box-shadow: inset 0 -1px 0 rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.6); | |
box-shadow: inset 0 -1px 0 rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.6); | |
-webkit-transition: 1s; | |
-moz-transition: 1s; | |
transition: 1s; | |
-webkit-border-radius: 20px; | |
-moz-border-radius: 20px; | |
border-radius: 20px; | |
} | |
.glossy-reflection .image-wrap:before { | |
position: absolute; | |
content: ' '; | |
width: 100%; | |
height: 50%; | |
top: 0; | |
left: 0; | |
-webkit-border-radius: 20px; | |
-moz-border-radius: 20px; | |
border-radius: 20px; | |
background: -moz-linear-gradient(top, rgba(255,255,255,0.7) 0%, rgba(255,255,255,.1) 100%); | |
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,0.7)), color-stop(100%,rgba(255,255,255,.1))); | |
background: linear-gradient(top, rgba(255,255,255,0.7) 0%,rgba(255,255,255,.1) 100%); | |
} | |
.glossy-reflection .image-wrap:after { | |
position: absolute; | |
content: ' '; | |
width: 100%; | |
height: 30px; | |
bottom: -31px; | |
left: 0; | |
-webkit-border-top-left-radius: 20px; | |
-webkit-border-top-right-radius: 20px; | |
-moz-border-radius-topleft: 20px; | |
-moz-border-radius-topright: 20px; | |
border-top-left-radius: 20px; | |
border-top-right-radius: 20px; | |
background: -moz-linear-gradient(top, rgba(230,230,230,.3) 0%, rgba(230,230,230,0) 100%); | |
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(230,230,230,.3)), color-stop(100%,rgba(230,230,230,0))); | |
background: linear-gradient(top, rgba(230,230,230,.3) 0%,rgba(230,230,230,0) 100%); | |
} | |
/************************************************************************************ | |
TAPE | |
*************************************************************************************/ | |
.tape .image-wrap { | |
-webkit-box-shadow: inset 0 0 2px rgba(0,0,0,.7), inset 0 2px 0 rgba(255,255,255,.3), inset 0 -1px 0 rgba(0,0,0,.5), 0 1px 3px rgba(0,0,0,.4); | |
-moz-box-shadow: inset 0 0 2px rgba(0,0,0,.7), inset 0 2px 0 rgba(255,255,255,.3), inset 0 -1px 0 rgba(0,0,0,.5), 0 1px 3px rgba(0,0,0,.4); | |
box-shadow: inset 0 0 2px rgba(0,0,0,.7), inset 0 2px 0 rgba(255,255,255,.3), inset 0 -1px 0 rgba(0,0,0,.5), 0 1px 3px rgba(0,0,0,.4); | |
} | |
.tape .image-wrap:after { | |
position: absolute; | |
content: ' '; | |
width: 60px; | |
height: 25px; | |
top: -10px; | |
left: 50%; | |
margin-left: -30px; | |
border: solid 1px rgba(137,130,48,.2); | |
background: -moz-linear-gradient(top, rgba(254,243,127,.6) 0%, rgba(240,224,54,.6) 100%); | |
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(254,243,127,.6)), color-stop(100%,rgba(240,224,54,.6))); | |
background: linear-gradient(top, rgba(254,243,127,.6) 0%,rgba(240,224,54,.6) 100%); | |
-webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 1px 0 rgba(0,0,0,.2); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment