Last active
May 1, 2017 14:06
-
-
Save pjchender/79c7a02e2d25d9cc28365da1365955cd to your computer and use it in GitHub Desktop.
[Flycan][CSS] lightbox, mobile-menu by transition
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Document</title> | |
<style type="text/css"> | |
*{ | |
margin: 0; | |
padding: 0; | |
list-style:none; | |
} | |
.lightbox{ | |
width: 100%; | |
height: 100%; | |
background-color: rgba(0,0,0,.3); | |
position: fixed; | |
top: 0; | |
left: -100%; | |
z-index: 10000; | |
opacity: 0; | |
/*transition:opacity 1s;*/ | |
transition:opacity 1s 1s, | |
left 0s 2s; | |
} | |
#box:checked ~ .lightbox{ | |
left: 0; | |
opacity: 1; | |
transition:opacity 1s; | |
} | |
.white{ | |
position: absolute; | |
top: 0; | |
right: 0; | |
bottom: 0; | |
left: 0; | |
margin: auto; | |
width: 500px; | |
height: 400px; | |
background-color: #fff; | |
opacity: 0; | |
transition:opacity 1s; | |
} | |
#box:checked ~ .lightbox .white{ | |
opacity: 1; | |
transition:opacity 1s 1s; | |
} | |
.white label{ | |
display: block; | |
position: absolute; | |
width: 30px; | |
height: 30px; | |
background-color: #000; | |
color: #fff; | |
right: -15px; | |
top: -15px; | |
border-radius: 50%; | |
text-align: center; | |
line-height: 30px; | |
cursor: pointer; | |
} | |
</style> | |
</head> | |
<body> | |
<input type="checkbox" name="" id="box"> | |
<label for="box">open</label> | |
content................ | |
<div class="lightbox"> | |
<div class="white"> | |
<label for="box">X</label> | |
</div> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment