I currently have two images and an input:
<input type="range" min="0" max="50" value="25">
.image_1 {
filter: blur(5px);
opacity: .8;
}
.image_2 {
filter: blur(5px);
opacity: .8;
}
The goal is when slider moves right image_2 {filter: blur(0px); opacity: 1;
comes into focus and opacity full; meanwhile image_1 {opacity: 0}
goes away. Vice versa should happen when the slider is moved to the left.
Any ideas or suggestions are greatly appreciated.
Thank you so far for all your suggestions and answers. I have yet to fully answer my question with provided solutions but I have gotten closer. What I have done is I have added oninput=showVal(this.value)
to my input
element. I have then created a function:
function showVal(newVal) {
var img_1 = document.getElementById("img_1");
var img_2 = document.getElementById("img_2");
// code to change blur upon value of slider changing (img_1.style.etc)
// unsure how to do
console.log(newVal);
}
Due to all the great answers, I think I have found a solution. However, I am still having an issue with adjusting the opacity. Here is the current open question about it: Google Web Designer dynamically adjust opacity in source code