Skip to content

Instantly share code, notes, and snippets.

@xav76
Created October 23, 2012 18:15
Show Gist options
  • Save xav76/3940459 to your computer and use it in GitHub Desktop.
Save xav76/3940459 to your computer and use it in GitHub Desktop.
A CodePen by Ana Tudor. Sliding door effect (box-shadow method) - Same effect as http://codepen.io/html5web/pen/EFyzB and http://codepen.io/thebabydino/pen/Kkvum
<div class='s s1'></div>
<div class='s s2'></div>
<div class='s s3'></div>
<div class='s s4'></div>
body { background: dimgrey; color: silver; text-align: center; }
.s {
display: inline-block;
margin: 1em;
width: 12.3em; height: 5.9em;
border-radius: .35em;
background: url(http://imgsrc.hubblesite.org/hu/db/images/hs-2007-16-e-small_web.jpg) 0 50%;
transition: .85s;
cursor: pointer;
}
.s1 {
box-shadow: 0 0 .35em black, 0 0 0 .5em,
inset 12.3em 0;
}
.s2 {
box-shadow: 0 0 .35em black, 0 0 0 .5em,
inset 0 6em;
}
.s3 {
box-shadow: 0 0 .35em black, 0 0 0 .5em,
inset -12.3em 0;
}
.s4 {
box-shadow: 0 0 .35em black, 0 0 0 .5em,
inset 0 -6em;
}
.s:hover {
box-shadow: 0 0 .35em black, 0 0 0 .5em,
inset 0 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment