<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
.box { | |
width: 200px; | |
height: 200px; | |
margin: 10px; | |
background-color: blue; | |
} | |
.composited { | |
-webkit-transform: translateZ(0); | |
} | |
.clipped { | |
-webkit-clip-path: inset(0 30px); | |
} | |
.masked { | |
-webkit-mask: linear-gradient(transparent, black); | |
} | |
</style> | |
</head> | |
<body> | |
<div id="gain-mask" class="masked clipped composited box"></div> | |
<div id="lose-mask" class="clipped composited box"></div> | |
</body> | |
</html> |