I'm trying to recreate the effect found at the bottom of this page where the words "REFORM CO" Zoom in to reveal a background image with a headline.
I attempted to recreate this effect myself using skrollr but I've hit a wall. ideally I'd like the SVG to be smaller and centered in the mask and for the video to stay fixed until the mask disappears just like the REFORM CO example.
Here's my HTML and the link to my attempt: https://jsfiddle.net/uex526qs/1/
<body>
<div class="knockout">
<svg x="50%" y="100%" class="knockout-text-container" height="100%" data-0="opacity:1;transform: scale(1);" data-50p="opacity:0;font-size: 10em;transform: scale(10);">
<rect class="knockout-text-bg" width="100%" height="100%" fill="#fff" x="0" y="0" fill-opacity="1" mask="url(#knockout-text)"/>
<mask id="knockout-text">
<rect width="100%" height="100%" fill="#fff" x="0" y="0" />
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 97.73 97.73"><defs><style>.cls-1{fill:#000;}</style></defs><title>shape2</title><g id="Layer_2" data-name="Layer 2"><g id="Content"><path class="cls-1" d="M48.86,97.73A7.72,7.72,0,0,1,41.15,90V7.72a7.72,7.72,0,1,1,15.43,0V90A7.72,7.72,0,0,1,48.86,97.73Z"/><path class="cls-1" d="M90,56.58H7.72a7.72,7.72,0,1,1,0-15.43H90a7.72,7.72,0,1,1,0,15.43Z"/></g></g></svg>
</mask>
</svg>
</div>
<video autoplay muted loop id="myVideo">
<source src="http://thenewcode.com/assets/videos/ocean-small.mp4" type="video/mp4">
</video>
</body>
Any help is appreciated
You can make an element stay fixed relative to the browser window using
position: fixed.To make your mask scale relative to the element it is aplied to, use:
then use coordinates in the range 0..1. That's the reason my
scale()values are so small. Your shape is roughly 100x100, so I needed to scale by an extra 0.01 to get them down into the 0..1 range.The rest of your example was more-or-less correct.