In this website, I masked circular shaped space at the top and bottom of the screen by using mask and mask-composite.
But in Safari 14, it doesn't work properly(maybe because mask-composite is not supported in this version?) Is there any way to make this shape function also in Safari 14?
.hundred_top {
pointer-events: none;
position: relative;
top: 0;
right: 0;
width: 100%;
height: 100.6%;
background-color: black;
-webkit-mask:
radial-gradient(circle at 25% bottom, transparent 31.6%, black 31.6%),
radial-gradient(circle at 75% bottom, transparent 31.6%, black 31.6%),
radial-gradient(black, black);
mask:
radial-gradient(circle at 25% bottom, transparent 31.6%, black 31.6%),
radial-gradient(circle at 75% bottom, transparent 31.6%, black 31.6%),
radial-gradient(black, black);
mask-composite: exclude;
}
.hundred_bottom {
pointer-events: none;
position: relative;
bottom: 0;
right: 0;
width: 100%;
height: 100.6%;
background-color: black;
-webkit-mask:
radial-gradient(circle at 25% top, transparent 31.6%, black 31.6%),
radial-gradient(circle at 75% top, transparent 31.6%, black 31.6%),
radial-gradient(black, black);
mask:
radial-gradient(circle at 25% top, transparent 31.6%, black 31.6%),
radial-gradient(circle at 75% top, transparent 31.6%, black 31.6%),
radial-gradient(black, black);
mask-composite: exclude;
}
@supports (-webkit-mask-composite: destination-in) and (not (mask-composite: exclude)) {
.hundred_top,
.hundred_bottom {
-webkit-mask-composite: destination-in;
}
}
I added @supports code for previous version of Safari and Chrome. It worked in Safari 15, but not in 14 versions.