I'm creating a maintenance page for myself when I need to work on something behind the scenes. Currently, I'm using a JavaScript Random math function to select a number from 1-5 which makes the background random from a list every time you refresh.
All I want to do is add a CSS blur filter to this image but I'm unsure on how to go about it.
My JavaScript:
<script type="text/javascript">
function backgr() {
var backimg = ["bg1.jpg","bg2.jpg","bg3.jpg","bg4.jpg","bg5.jpg"];
var randimg = Math.floor(Math.random()*5);
document.body.background = backimg[randimg];
}
</script>
HTML start, I have to add that the filter should not touch anything in the container class.
<body onload="backgr()">
<div class="container">
The CSS blur filter (w3):
#settopickedbackground {
-webkit-filter: blur(5px);
filter: blur(5px);
}
I've used the blur filter on individual backgrounds but I would like to use it after random math has competed.
Apologies if the code looks weird, posted on mobile.
Thanks!