Overlay on a div with a certain cutout in the middle.
Actually this is on top of a video stream but for simplicity sake lets just say its over a div. I am trying to create a verification system where the user can verify themselves using facial verification.
For the design part I need to display a face cutout overlay on my video stream essentially telling the user to place their face in the cutout to verify themselves. What is the best possible approach to this?
I have provided an image of what I am trying to achieve but for web.
Any help will be greatly appreciated.
6 Replies
Mask is the first thing that comes to mind: https://codepen.io/kevinpowell/pen/BagLWrp/d703a55e92c690d4f9875d88b5b25e22
or instead of the mask just a bg-gradient for the overlay
no idea why I did a mask using the same gradient I could have just used a gradient for, lol.
i was thinking of it too, until i saw your pen and thought, wait a minute
As Mark has taught me, with both the mask of the bg-img you may want to use a calc to account for the fuzzy edges
it's a bit fiddly but you should also be able to do the thin white oval line as part of the gradient: