A Pen by Saminou yengue kizidi on CodePen.
Created
October 3, 2013 22:57
-
-
Save Saminou24/6818400 to your computer and use it in GitHub Desktop.
A Pen by Saminou yengue kizidi.
This file contains hidden or 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
<a href="#" id="launchModal">Tap Anywhere</a> | |
<section class="modal"> | |
<a href="#" class="close" id="closeModal">×</a> | |
<h1>Condimentum Etiam Sit</h1> | |
<p>Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Etiam porta sem malesuada magna mollis euismod.</p> | |
<button>Lorem</button> | |
</section> |
This file contains hidden or 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
document.getElementById('launchModal').onclick = addClass; | |
function addClass() { | |
document.body.classList.add('launch'); | |
} | |
document.getElementById('closeModal').onclick = removeClass; | |
function removeClass() { | |
document.body.classList.remove('launch'); | |
} |
This file contains hidden or 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
* { box-sizing: border-box; } | |
@import url(http://fonts.googleapis.com/css?family=Open+Sans:300italic,600italic,300,600); | |
html, | |
body { | |
height: 100%; | |
} | |
body { | |
background-color: #333; | |
backface-visibility: hidden; | |
display: table; | |
font-family: 'Open Sans', Sans-Serif; | |
font-weight: 300; | |
margin: 0; | |
padding: 0; | |
text-align: center; | |
width: 100%; | |
} | |
a { | |
color: white; | |
display: table-cell; | |
font-size: 0.8em; | |
letter-spacing: 0.6em; | |
text-decoration: none; | |
text-transform: uppercase; | |
vertical-align: middle; | |
} | |
.modal { | |
background-color: rgba(255,255,255,0.95); | |
border-radius: 2px; | |
box-shadow: 0 0 3.0em rgba(0,0,0,0.4); | |
height: 280px; | |
left: -9999px; | |
margin-left: -300px; | |
margin-top: -140px; | |
opacity: 0; | |
padding: 2.0em; | |
position: absolute; | |
text-align: left; | |
transform: scale(0.7,0.7); | |
width: 600px; | |
} | |
.launch .modal { | |
left: 50%; | |
opacity: 1; | |
top: 50%; | |
transform: scale(1,1); | |
transition: opacity 0.2s ease, transform 0.2s ease; | |
} | |
.modal { | |
transition: opacity 0.1s ease, transform 0.2s ease, left 0.0s 0.5s ease, top 0.0s 0.5s ease; | |
} | |
.modal button { | |
background-color: black; | |
border: 0; | |
border-radius: 3px; | |
color: white; | |
float: right; | |
padding: 1.5em; | |
} | |
.close { | |
color: black; | |
float: right; | |
font-size: 1.5em; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment