<div class="gradient"></div>
body, html {
height: 100%;
padding 0;
margin: 0;
}
body {
background-image: url('https://images.unsplash.com/photo-1488521787991-ed7bbaae773c?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=b73302ddf5fabf9285df2da9c462efbb&auto=format&fit=crop&w=1350&q=80');
background-repeat: no-repeat;
background-size: cover;
}
.gradient {
width: 100%;
height: 100%;
background-image: radial-gradient(at 300px 300px, rgba(159,0,191,.9) 0, #4D4FA7 70%);
}
const gradient = document.querySelector(".gradient");
function onMouseMove(event) {
gradient.style.backgroundImage = 'radial-gradient(at ' + event.clientX + 'px ' + event.clientY + 'px, rgba(159,0,191,.9) 0, #4D4FA7 70%)';
}
document.addEventListener("mousemove", onMouseMove);
View Compiled
This Pen doesn't use any external CSS resources.