Skip to content

Instantly share code, notes, and snippets.

@tyv
Created May 1, 2012 15:18
Show Gist options
  • Save tyv/2568739 to your computer and use it in GitHub Desktop.
Save tyv/2568739 to your computer and use it in GitHub Desktop.
Untitled
.frame
{
position: relative;
width: 300px;
height: 200px;
background-image: linear-gradient(bottom, #f5f5e0 0, #8ccdec 100%);
transition: width 0.3s linear;
}
.frame:focus
{
outline: 0;
}
.front,
.center,
.back
{
transition: left 0.3s linear;
}
.front
{
position: absolute;
top: 80px;
left: 45%;
z-index:3;
width: 110px;
height: 80px;
border-radius: 30px;
box-shadow: inset 0 0 80px rgba(255,255,255,0.85), 0 0 40px #fff;
}
.center
{
position: absolute;
z-index: 2;
top: 40px;
left: 10%;
width: 150px;
height: 130px;
border-radius: 30px;
background: rgba(255,255,255,0.5);
}
.back
{
position: absolute;
top: 130px;
left: 5%;
z-index:1;
width: 65px;
height: 40px;
border-radius: 30px;
box-shadow: inset 0 0 80px rgba(255,255,255,0.25), 0 0 40px #fff;
}
.frame:focus .front
{
left: 55%;
}
.frame:focus .center
{
left: 40%;
}
.frame:focus .back
{
left: 15%;
}
<div class="frame" tabindex="1">
<div class="front"></div>
<div class="center"></div>
<div class="back"></div>
</div>
{"view":"separate","fontsize":"100","seethrough":"","prefixfree":"1","page":"result"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment