I wanted to know if there was a way I could use the white shape in my code called #mask
like a mask, to show a hole in the black retangle.
Actually, I would like to be able to use it as an index when you scroll, so it dynamically reajusts.
I wouldn't like to use a .png
image to achieve that because I would like to be able to dynamically change the shape after.
I know there is the mask filter in css but I couldn't think of a way to adjust it dynamically with my content (that could be different images or even texts)
Thanks for the help.
#black{
z-index:100;
position: fixed;
width:50vw;
height: 45vh;
background-color: black;
top: 25vh;
left: 45vw;
}
#mask{
border-radius: 100px;
z-index:101;
position: relative;
top: 2vh;
left: 5vw;
width: 30vw;
height: 30vh;
background-color: white;
}
img{
z-index:0;
width:100vw;
height: auto;
}
<body>
<div id="black">
<div id="mask">
</div>
</div>
<img src="https://i.imgur.com/ONJQpdL.jpg">
<img src="https://i.imgur.com/eVo569U.jpg">
</body>