The first time I came across the spotlight effect was in a Facebook game - I can't remember the game's name, but it was very much like Mystery Manor[1].
Kudos to the OP for coding up the feature in CSS. The effect is fairly easy to recreate in the canvas element, using a radialGradient in a rectangle for a simple spotlight or, for the replacement effect, playing with globalcompositeoperation when rendering the scene.
Here's my spotlight demo, which I did for a CodePen Challenge last year (warning: page will ask to use your device's camera): https://codepen.io/kaliedarik/pen/gORXpya
Kudos to the OP for coding up the feature in CSS. The effect is fairly easy to recreate in the canvas element, using a radialGradient in a rectangle for a simple spotlight or, for the replacement effect, playing with globalcompositeoperation when rendering the scene.
Here's my spotlight demo, which I did for a CodePen Challenge last year (warning: page will ask to use your device's camera): https://codepen.io/kaliedarik/pen/gORXpya
[1] - https://en.wikipedia.org/wiki/Mystery_Manor