<html>
<head>
<meta charset=utf-8 />
<title>CSS Image Tint</title>
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<style>
article, aside, figure, footer, header, hgroup,
menu, nav, section { display: block; margin: 0; }
body {
color: #555;
}
h1 {
font-family: sans-serif;
font-size: 2em;
margin: 20px 0 0 0;
text-align: center;
}
p {
padding: 10px 0 0;
color: #222;
font-family: sans-serif;
font-weight: bold;
text-align: center;
}
img {
display: block;
}
.wrap {
overflow: hidden;
width: 840px;
margin: auto;
}
.tint {
position: relative;
float: left;
margin-right: 20px;
margin-bottom: 20px;
cursor: pointer;
shadow: rgba(0,0,0,.2) 3px 5px 5px;
shadow: rgba(0,0,0,.2) 3px 5px 5px;
box-shadow: rgba(0,0,0,.2) 3px 5px 5px;
}
.tint:before {
content: "";
display: block;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
transition: all .3s linear;
transition: all .3s linear;
transition: all .3s linear;
transition: all .3s linear;
transition: all .3s linear 5s;
}
.tint:hover:before {
background: rgba(0,255,255, 0.5);
transition: all .3s linear;
}
.t2:hover:before {
background: rgba(0,0,255, 0.5);
}
.t3:hover:before {
background: rgba(255,0,0, 0.5);
}
.t4:hover:before {
background: rgba(0,255,0, 0.5);
}
.t5:hover:before {
background: rgba(255,0,240, 0.5);
}
.t6:hover:before {
background: rgba(255,102,0, 0.6);
}
</style>
</head>
<body>
<h1>CSS Image Tint</h1>
<p>Hover over a photo to see the tint (<a href="http://www.impressivewebs.com/?p=4804">Original article</a>)</p>
<div class="wrap">
<img src="http://cdn.impressivewebs.com/2011-11/greece001.jpg" alt="" width="400" height="260">
<img src="http://cdn.impressivewebs.com/2011-11/greece002.jpg" alt="" width="400" height="260">
<img src="http://cdn.impressivewebs.com/2011-11/greece003.jpg" alt="" width="400" height="260">
<img src="http://cdn.impressivewebs.com/2011-11/greece004.jpg" alt="" width="400" height="260">
<img src="http://cdn.impressivewebs.com/2011-11/greece005.jpg" alt="" width="400" height="260">
<img src="http://cdn.impressivewebs.com/2011-11/greece006.jpg" alt="" width="400" height="260">
</div><!-- .wrap -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script>
$(function() {
$('img').each(function(n) {
n += 1;
$(this).wrap('<figure class="tint t'+ n + '"></figure>');
});
});
</script>
</body>
</html>
Output
You can jump to the latest bin by adding /latest
to your URL
Keyboard Shortcuts
Shortcut | Action |
---|---|
ctrl + [num] | Toggle nth panel |
ctrl + 0 | Close focused panel |
ctrl + enter | Re-render output. If console visible: run JS in console |
Ctrl + l | Clear the console |
ctrl + / | Toggle comment on selected lines |
ctrl + ] | Indents selected lines |
ctrl + [ | Unindents selected lines |
tab | Code complete & Emmet expand |
ctrl + shift + L | Beautify code in active panel |
ctrl + s | Save & lock current Bin from further changes |
ctrl + shift + s | Open the share options |
ctrl + y | Archive Bin |
Complete list of JS Bin shortcuts |
JS Bin URLs
URL | Action |
---|---|
/ | Show the full rendered output. This content will update in real time as it's updated from the /edit url. |
/edit | Edit the current bin |
/watch | Follow a Code Casting session |
/embed | Create an embeddable version of the bin |
/latest | Load the very latest bin (/latest goes in place of the revision) |
/[username]/last | View the last edited bin for this user |
/[username]/last/edit | Edit the last edited bin for this user |
/[username]/last/watch | Follow the Code Casting session for the latest bin for this user |
/quiet | Remove analytics and edit button from rendered output |
.js | Load only the JavaScript for a bin |
.css | Load only the CSS for a bin |
Except for username prefixed urls, the url may start with http://jsbin.com/abc and the url fragments can be added to the url to view it differently. |