JSFiddle - React, Tailwind, and code Playground
by Alexandru Gatea
HTML
<div class="box">
<div class="content">
<div class="title">
<h1 class="offset">abcdabcdabcd</h1>
<h1>Then the one below</h1>
</div>
<div class="image"></div>
</div>
<div class="content duplicate">
<div class="title">
<h1 class="offset">abcdabcdabcdabcd</h1>
<h1>Then the one below</h1>
</div>
<div class="image"></div>
</div>
<div class="overlay"> </div>
</div>
SCSS
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
.box {
position: relative;
padding: 50px;
background: #fff;
.content {
display: flex;
align-items: center;
justify-content: flex-end;
}
.content.duplicate {
width: 100%;
height: 100%;
position: absolute;
top:0;
left:0;
z-index: 100;
padding: 50px;
mix-blend-mode: overlay;
.image, h1:not(.offset) {
opacity: 0;
}
}
.image {
width: 350px;
height: 400px;
flex-shrink: 0;
background: #000;
position: relative;
z-index: 0;
}
h1 {
font-family: 'Futura';
font-weight: bold;
text-transform: uppercase;
margin-right: -30px;
font-size: 70px;
text-align: right;
color: #000;
position: relative;
z-index: 0;
white-space: nowrap;
&.offset {
margin-right: -200px;
}
}
}
.overlay {
background: url('https://wallpaperplay.com/walls/full/2/5/0/200799.jpg');
background-size: cover;
background-position: right center;
background-repeat: no-repeat;
display: block;
width: 100%;
height: 100%;
position: absolute;
top:0;
left:0;
mix-blend-mode: screen;
z-index: 1;
pointer-events: none;
}