I'm looking to create a unique effect where a background image only shows through knockout text and then have that text animate from the top of the page to the bottom, revealing different parts of the background image as it moves.
Although I know how to create knockout text:
#screen1 h1 {
display:block;
margin: auto;
font-family: 'proxima-nova', sans-serif;
background-image: url('../img/my-image.jpg');
background-clip: text;
-webkit-text-fill-color: transparent;
-webkit-background-clip: text;
font-size: 12rem;
font-weight: 800;
}
What I really want is to have a background image on #screen1 that only shows through the knockout text. When you animate the text, different parts of the background image should be revealed.
Here's the HTML code:
<div id="screen1" >
<div style="">
<h1>MY TEXT</h1>
</div>
</div>
And the accompanying CSS code:
#screen1 {
background: url(../img/my-image.jpg) no-repeat;
background-size: cover;
overflow: hidden;
}
#screen1 h1 {
display:block;
margin: auto;
font-family: 'proxima-nova', sans-serif;
background-clip: text;
-webkit-text-fill-color: transparent;
-webkit-background-clip: text;
font-size: 12rem;
font-weight: 800;
}
However, this code currently just displays the background image without the desired effect. But I can sense that I am getting close.