<link href='https://fonts.googleapis.com/css?family=Montserrat' rel='stylesheet' type='text/css'>
<h2>FramerBox - White, Black & Canvas Wooden Framed Effect Modal/Lightbox in Pure CSS</h2>
<a class="lightbox" href="#boxbox">
<img src="https://ppcdn.500px.org/75171205/38579bcab7f4d5ab2569024a01b5e55bcd9bb4ba/5.jpg" />
</a>
<div class="lightbox-target" id="boxbox">
<div class="livingroom-wall">
<button class="black-frame">Black Frame</button>
<button class="canvas-frame">Canvas</button>
<img class="photo-print" src="https://ppcdn.500px.org/75171205/38579bcab7f4d5ab2569024a01b5e55bcd9bb4ba/5.jpg"/>
<div class="livingroom-sofa">
<img class="sofa" src="https://i.imgur.com/bC28OMy.png" alt="" title="" />
<div class="vase">
<div class="grassRight"></div>
<div class="grassRight gR1"></div>
<div class="grassRight gR2"></div>
<div class="grassRight gR3"></div>
<div class="grassRight gR4"></div>
<div class="grassRight gR5"></div>
<div class="grassLeft"></div>
<div class="grassLeft gL1"></div>
<div class="grassLeft gL2"></div>
<div class="grassLeft gL3"></div>
<div class="grassLeft gL4"></div>
<div class="grassLeft gL5"></div>
</div>
</div>
<a class="lightbox-close" href="#"></a>
body, html {
padding: 0;
margin: 0;
text-align: center;
font-family: 'Montserrat', sans-serif;
}
a.lightbox img {
height: 150px;
border: 3px solid white;
box-shadow: 0px 0px 8px rgba(0,0,0,.3);
margin: 20px;
}
.lightbox-target {
position: fixed;
top: -100%;
width: 100%;
background: rgba(0,0,0,.7);
width: 100%;
opacity: 0;
transition: opacity .5s ease-in-out;
transition: opacity .5s ease-in-out;
transition: opacity .5s ease-in-out;
transition: opacity .5s ease-in-out;
overflow: hidden;
}
.lightbox-target img.photo-print {
margin: auto;
position: absolute;
top: 25px;
left:0;
right:0;
max-height: 0%;
max-width: 0%;
/* This is the bit that changes for each frame */
padding: 20px 15px;
border: 15px solid #FFF;
box-shadow: 1px -1px 0px 0px #EEE, 0px 0px 0px 5px white,1px 2px 5px 5px #ccc, -10px 5px 5px 2px #ccc;
background:#FFF;
/* End of each bit that changes for each frame */
transition: .5s ease-in-out;
transition: .5s ease-in-out;
transition: .5s ease-in-out;
transition: .5s ease-in-out;
}
a.lightbox-close {
display: block;
width:50px;
height:50px;
box-sizing: border-box;
background: white;
color: black;
text-decoration: none;
position: absolute;
top: -80px;
right: 0;
transition: .5s ease-in-out;
transition: .5s ease-in-out;
transition: .5s ease-in-out;
transition: .5s ease-in-out;
}
a.lightbox-close:before {
content: "";
display: block;
height: 30px;
width: 1px;
background: black;
position: absolute;
left: 26px;
top:10px;
transform:rotate(45deg);
transform:rotate(45deg);
transform:rotate(45deg);
transform:rotate(45deg);
}
a.lightbox-close:after {
content: "";
display: block;
height: 30px;
width: 1px;
background: black;
position: absolute;
left: 26px;
top:10px;
transform:rotate(-45deg);
transform:rotate(-45deg);
transform:rotate(-45deg);
transform:rotate(-45deg);
}
button.black-frame {
position: absolute;
top: 50px;
right: 10px;
padding: 5px 10px;
background: lightgrey;
box-shadow: none;
border: none;
color: #999;
width: 130px;
}
button.black-frame:hover ~ img.photo-print {
box-shadow: 0px 0px 0px 5px #565656, -4px 4px 4px 6px #CCC;
}
button.canvas-frame {
position: absolute;
top: 80px;
right: 10px;
padding: 5px 10px;
background: lightgrey;
box-shadow: none;
border: none;
color: #999;
width: 130px;
}
button.canvas-frame:hover + img.photo-print {
box-shadow: 2px -1px 0px 0px #DADADA, -6px 6px 10px 1px #C1C1C1;
padding: 0;
background: none;
border: none;
}
.lightbox-target:target {
opacity: 1;
top: 0;
bottom: 0;
}
.lightbox-target:target img.photo-print {
max-height: 45%;
max-width: 45%;
}
.lightbox-target:target a.lightbox-close {
top: 0px;
}
.livingroom-wall {
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.3);
box-sizing: border-box;
transition: all 0.5s ease-in-out 0s;
margin: auto;
position: absolute;
max-height: 100%;
max-width: 60%;
background-image: linear-gradient(to right top, #EAEAEA, #FFF);
transition: .5s ease-in-out;
transition: .5s ease-in-out;
transition: .5s ease-in-out;
transition: .5s ease-in-out;
z-index: 10;
}
.livingroom-sofa {
bottom: 15px;
position: absolute;
left: 0;
right: 0;
transition: .5s ease-in-out;
transition: .5s ease-in-out;
transition: .5s ease-in-out;
transition: .5s ease-in-out;
}
.livingroom-sofa img {
width: 75%;
}
.vase {
position: absolute;
width: 50px;
border-width: 85px 18px 0;
border-style: solid;
border-color: #E1E1E1 transparent;
margin-top:200px;
right: 25px;
bottom: 0;
}
.grassRight{
position:absolute;
bottom:85px;
left:3%;
height:60px;
width:10px;
border-left:5px solid green;
border-right:0;
border-bottom:0;
border-top-left-radius:50px 200px;
border-top-right-radius:0px;
z-index:5;
}
.gR1{left:0px; height:116px;}
.gR2{left:18px; height:116px;}
.gR3{left:50px; height:122px;}
.gR4{left:38px; height:138px;}
.gR5{left:26px; height:126px;}
.grassLeft{
position:absolute;
bottom:85px;
left:3%;
height:80px;
width:10px;
border-right:4px solid #009900;
border-left:0;
border-bottom:0;
border-top-right-radius:50px 200px;
border-top-left-radius:0px;
z-index:5;
}
.gL1{left:-15px; height:86px;}
.gL2{left:17px; height:115px;}
.gL3{left:35px; height:122px;}
.gL4{left:10px; height:101px;}
.gL5{left:20px; height:146px;}
/* Pure css modal, with pure css framed photo and art effect by Martin Toole
Photo credit: www.mtoole.co.uk
Read more @ www.mtoole.co.uk/web/framerbox
https://github.com/martintoole/framerbox/
*/
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.