A moving spotlight can reveal a different landscape without moving either image. Stack two matching views, apply a radial mask to the upper one, and update its position with JavaScript.
In our experiment, a grey wireframe terrain sits underneath a green landscape. The reveal is a change in visibility, rather than a 3D lighting simulation.
Try the complete React demo .
1. Start with two matching layers
Use images with the same framing. Their crop and background position need to match, otherwise the terrain shifts at the edge of the spotlight. The example below uses two images generated for this demo.
<div class= "scene" aria-hidden= "true" > <div class= "terrain base" ></div> <div class= "terrain reveal" ></div> </div>
Enter fullscreen mode
Exit fullscreen mode
The scene is decorative.…