<div class="alpha"></div>
<div class="luminance"></div>
body {
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

div {
  width: 50vw;
  height: 100vh;
  mask-repeat: no-repeat;
  mask-position: center;
  position: relative;
  
  &::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 2vw;
    font-weight: 900;
    text-shadow: 1px 1px 1px rgba(0,0,0,.5), -1px -1px 1px rgba(0,0,0,.5);
  }
  
  &.alpha {
    background: linear-gradient(45deg, #3023AE 0%, #FF0099 100%);
    mask-image: url('//www.w3cplus.com/sites/default/files/blogs/2019/1905/alpha-mask-1.png');
    
    &::before {
      content: 'Alpha遮罩模式';
    }
  }
  
  &.luminance {
    background: linear-gradient(135deg, #3023AE 0%, #FF0099 100%);
    mask-image: url('//www.w3cplus.com/sites/default/files/blogs/2019/1905/alpha-mask-2.png');
    
    &::before {
      content:'高亮遮罩模式';
    }
  }
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.