I'm trying to implement an effect in a webpage. The webpage must be fully covered with a background with a transparent window (this window will basically highlight some page of the page to draw user's attention). The size of the window is unknown beforehand and the effect must be implemented in the frontend. So I'm free to use html, css and js.
I don't know a way this effect can be achieved with css only. And I cannot use something like a png image background, because the size and the dimensions of the transparent window will change dynamically. I'm thinking of generating canvas for and use it as a background image for the div element.
Is this possible to generate a canvas as per my example image and use it as a background? Can you, please, provide an example? Thanks.