Toggle navigation
Bootsnipp
Bootstrap
For
CSS Frameworks
Bootstrap
Foundation
Semantic UI
Materialize
Pure
Bulma
References
CSS Reference
Tools
Community
Page Builder
Form Builder
Button Builder
Icon Search
Dan's Tools
Diff / Merge
Color Picker
Keyword Tool
Web Fonts
.htaccess Generator
Favicon Generator
Site Speed Test
Snippets
Featured
Tags
By Bootstrap Version
4.1.1
4.0.0
3.3.0
3.2.0
3.1.0
3.0.3
3.0.1
3.0.0
2.3.2
Register
Login
"Curtain Opening Effect"
Bootstrap 4.1.1 Snippet by
sumi9xm
4.1.1
Preview
HTML
CSS
View Full Screen
Fork
Fork this
4.8K
 
3 Fav
Post to Facebook
Tweet this
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="curtain"> <div class="curtain__wrapper"> <input type="checkbox" checked> <div class="curtain__panel curtain__panel--left"> </div> <div class="curtain__prize"> <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/9632/trophy.svg"> </div> <div class="curtain__panel curtain__panel--right"> </div> </div> </div>
/*////////////////////Opening Effect////////////////////*/ .curtain { width: 100%; height: 100vh; overflow: hidden; } .curtain__wrapper { width: 100%; height: 100%; } .curtain__panel { background: orange; width: 50%; height: 100vh; float: left; position: relative; z-index: 2; transition: all 1s ease-out; } .curtain__panel--left { transform: translateX(-100%); } .curtain__panel--right { transform: translateX(100%); } .curtain__prize { background: #333; position: absolute; z-index: 1; width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; } .curtain input[type=checkbox] { position: absolute; cursor: pointer; width: 100%; height: 100%; z-index: 100; opacity: 0; } .curtain input[type=checkbox]:checked ~ div.curtain__panel--left { transform: translateX(0); } .curtain input[type=checkbox]:checked ~ div.curtain__panel--right { transform: translateX(0); } .curtain img { width: 55vw; height: 55vh; }
Questions / Comments:
Post
Posting Guidelines
Formatting
- Now
×
Close
Donate
BTC: 12JxYMYi6Vt3mx3hcmP3B2oyFiCSF3FhYT
ETH: 0xCD715b2E3549c54A40e6ecAaFeB82138148a6c76