JSFiddle - React, Tailwind, and code Playground
by Dedi Wibisono
HTML
<input type="checkbox" id="modal" />
<p class="blurp">Do it. Click the Button. I dare you.</p>
<label for="modal" class="modal-btn">
<i class="fa fa-fire" aria-hidden="true"></i>
</label>
<!-- <div class="modal-bg"></div> -->
<label for="modal" class="modal-bg"></label>
<div class="modal-content">
<label for="modal" class="close">
<i class="fa fa-times" aria-hidden="true"></i>
</label>
<header>https://jsfiddle.net/dedi_wibisono17/Lnsgr8yr/15/#collaborate
<h2>So This is a Modal</h2>
</header>
<article class="content">
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet</p>
</article>
<footer>
<a href="#" target="_parent" class="button success">Accept</a>
<label for="modal" class="button danger">Decline</label>
</footer>
</div>
CSS
html {
box-sizing: border-box;
}
*, *::after, *::before {
box-sizing: inherit;
}
*, *:before, *:after {
box-sizing: border-box;
outline: none;
}
body {
position: relative;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 100%;
height: 100vh;
background-color: whitesmoke;
font-family: 'Source Sans Pro', sans-serif;
font-size: 16px;
font-smooth: auto;
font-weight: 300;
line-height: 1.5;
color: #444;
background-image: url("http://dakotarumors.com/assets/img/header-bg.jpg");
background-position: center center;
background-size: cover;
}
body:before {
position: absolute;
content: '';
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(255, 255, 255, 0.7);
z-index: -1;
}
p {
font-weight: 400;
}
a {
text-decoration: none;
}
label {
cursor: pointer;
}
.modal-btn {
position: relative;
display: table-cell;
width: 100px;
height: 100px;
background-color: #2c3e50;
box-shadow: 0 0 40px rgba(0, 0, 0, 0.3);
border-radius: 50%;
font-size: 36px;
color: white;
text-align: center;
line-height: 2.75;
transition: box-shadow 250ms ease;
}
.modal-btn:hover {
box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}
.modal-bg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
z-index: 10;
visibility: hidden;
transition: background-color 250ms linear;
}
.modal-content {
position: absolute;
width: 80%;
top:10%;
left:10%;
height: auto;
padding: 30px;
background-color: white;
border-radius: 4px;
box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
transform: scale(0);
transition: transform 250ms ease;
visibility: hidden;
z-index: 20;
}
.modal-content .close {
position: relative;
float: right;
font-size: 18px;
transition: transform 500ms ease;
z-index: 11;
}
.modal-content .close:hover {
color: #3498db;
transform: rotate(540deg);
}
.modal-content header {
position: relative;
...