Created
July 17, 2015 00:58
-
-
Save joeydsmith/c62a24adc8a13cd73d97 to your computer and use it in GitHub Desktop.
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
<!doctype html> | |
<html> | |
<head> | |
<title>FEWD RULEZ!</title> | |
<link rel="stylesheet" href="css/style.css" /> | |
<style type="text/css"> | |
.menu { | |
background: #000; | |
position: fixed; | |
top: 0; | |
left: 0; | |
right: 0; | |
bottom: 0; | |
} | |
#toggle-menu { | |
position: relative; | |
z-index: 2; | |
color: pink; | |
} | |
.offscreen-top { | |
transform: translate(0, -100%); | |
transition: transform 1s ease; | |
} | |
.offscreen-left { | |
transform: translate(-100%, 0); | |
transition: transform 1s ease; | |
} | |
.offscreen-right { | |
transform: translate(100%, 0); | |
transition: transform 1s ease; | |
} | |
.offscreen-bottom { | |
transform: translate(0, 100%); | |
transition: transform 1s ease; | |
} | |
.offscreen-leftdiag { | |
transform: translate(-100%, -100%); | |
transition: transform 1s ease; | |
} | |
.onscreen { | |
transform: translate(0, 0); | |
transition: transform 2s cubic-bezier(0,2,.25,.66); | |
} | |
</style> | |
</head> | |
<body> | |
<article class="hero"> | |
<a href="#" id="toggle-menu">menu</a> | |
<div class="menu offscreen-top"></div> | |
</article> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> | |
<script> | |
$('#toggle-menu').click(function(e){ | |
$('.menu').toggleClass('onscreen'); | |
e.preventDefault(); | |
}) | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment