<div class="bg bg1" id="img">
<h1 id="label">HEAT</h1>
</div>
<svg>
<defs>
<filter id="heat">
<feTurbulence type="fractalNoise" baseFrequency="0.005" numOctaves="3" result="warp">
</feTurbulence>
<feDisplacementMap xChannelSelector="R" yChannelSelector="B" scale="40" in="SourceGraphic" in2="warp">
<animate attributeName="scale" dur="5s" values="0 ; 10 ; 30 ; 10 ; 0"
keyTimes="0 ; 0.25 ; 0.5 ; 0.75 ; 1" repeatCount="indefinite"/>
</feDisplacementMap>
</filter>
<filter id="parallax">
<feDisplacementMap xChannelSelector="R" yChannelSelector="B" scale="20" in="SourceGraphic">
<animate attributeName="scale" dur="2s" values="0 ; 20 ; 0"
keyTimes="0 ; 0.5 ; 1" repeatCount="indefinite"/>
</feDisplacementMap>
</filter>
</defs>
<filter id="blur">
<feGaussianBlur in="SourceGraphic" result="blur" stdDeviation="15,0">
<animate attributeName="stdDeviation" dur="4s" values="0,0 ; 10,0 ; 0,1"
keyTimes="0 ;0.5; 1" repeatCount="indefinite"/>
</feGaussianBlur>
</filter>
</defs>
</svg>
.bg {
position: absolute;
margin: auto;
cursor: pointer;
top:0; bottom:0;
left:0; right:0;
width: 600px;
height: 500px;
background: url(https://40.media.tumblr.com/12a17b85e1a6fb6eeb67a7f405fbd670/tumblr_ndyzpl2iHD1s1od22o1_1280.jpg) no-repeat center;
background-size: contain;
}
.bg1 { filter: url('#heat'); }
.bg2 { filter: url('#parallax'); }
.bg3 { filter: url('#blur'); }
#label {
position: absolute;
margin: auto;
top:0; bottom:0;
left:0; right:0;
width: 600px;
height: 100px;
text-align: center;
font-size: 100px;
font-family: sans-serif;
color: white;
opacity: 0.3;
}
var filters = ['bg1', 'bg2', 'bg3'];
var labels = ['HEAT', 'PARALLAX', 'BLUR'];
var img = document.getElementById("img");
var lbl = document.getElementById("label");
var sel = 1;
img.onclick = function() {
img.className = 'bg ' + filters[sel];
lbl.innerHTML = labels[sel++];
if (sel == 3) {
sel = 0;
}
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.