<div class="container">
<div class="wrapper">
<input type="checkbox" name="mode" id="switcher">
<label for="switcher">Toggle filter</label>
<img src="http://web.archive.org/web/20170502125106im_/https://storage.googleapis.com/imgfave/image_cache/1315195549154431.jpg">
<div class="warning">
<p>Warning: Graphic content. Click the red button to reveal.</p>
</div>
</div>
</div>
body {
background-color: #F5F5F5;
color: #fff;
font-size: 1.1em;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
.container {
margin: 1em auto;
max-width: 700px;
}
.wrapper {
height: 395px;
width: 500px;
position: relative;
}
input {
display: none;
}
label {
position: absolute;
z-index: 1;
background-color: red;
padding: 1em;
cursor: pointer;
transition: background-color 0.3s ease;
}
label:hover {
background-color: firebrick;
}
img {
width: 100%;
height: 100%;
position: absolute;
left: 0;
}
.warning {
position: absolute;
text-align: center;
height: 100%;
width: 100%;
background-color: rgba(0, 0, 0, 0.75);
-webkit-backdrop-filter: contrast(4) blur(20px);
backdrop-filter: contrast(4) blur(20px);
display: flex;
align-items: center;
justify-content: center;
}
input:checked ~ .warning {
background-color: rgba(0, 0, 0, 0);
-webkit-backdrop-filter: blur(0);
backdrop-filter: blur(0);
}
input:checked ~ .warning p {
color: transparent;
}