Skip to content

Instantly share code, notes, and snippets.

@iOS0x00
Forked from anonymous/Door-by-RayPS.com.markdown
Created January 30, 2014 01:20
Show Gist options
  • Save iOS0x00/8700889 to your computer and use it in GitHub Desktop.
Save iOS0x00/8700889 to your computer and use it in GitHub Desktop.
<div id="window">
<div id="door">
<a id="circle" onclick="myFunction()">
<span></span>
</a>
</div>
</div>
var open = false;
var door = document.getElementById("door");
function myFunction() {
if (!open){
door.style.top = "350px";
open = true
} else {
door.style.top = "100px";
open = false
}
}
*{margin:0;padding:0;}
body{background-color: #51A780;}
#window{
width:400px;
height:400px;
background-color: #EEEDEB;
margin:100px auto;
overflow: hidden;
border-radius:10px;
}
#door{
position: relative;
top: 100px;
width:400px;
height:400px;
background-color: white;
transition:all .25s ease-out;
}
#circle{
display: block;
cursor: pointer;
width:80px;
height: 50px;
background-color: white;
position: relative;
top: -20px;
margin: 0 auto;
border-radius:40px/25px;
}
#circle span{
display: block;
width:0;
height: 0;
border: 10px solid transparent;
border-top: 10px solid STEELBLUE;
margin: 0 auto;
position: relative;
top: 20px;
}
#circle:hover span{border-top: 10px solid DODGERBLUE;}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment