I’m trying to replicate an effect from the Apple TV+ Smart TV App on my personal website where there’s a gradient blur over the background down to a certain point of the webpage, but once you scroll down further, the blur moves up and covers the webpage’s entire background image.
Similar to how when you view a TV Show or movie on the Apple TV+ Smart TV App, the background has a sort of gradient blur over it going down to a specific point on the screen; but when you go further down (Say to view additional episodes of a TV Show or the Special features for a movie) the blur covers the entire background while the background image stays fixed.
I have a div set up on my site with a blur backdrop filter covering the entire background image:
<div class="blurred-mask-container"></div>
and have my CSS set up like so:
.blurred-mask-container {
top: 0;
bottom: 0;
position: absolute;
height: 100%;
width: 100%;
backdrop-filter: blur(100px);
z-index: -1;
}
And my goal is to have a gradient transparency going from transparent at the top of the div, then blurry at around 800px down specifically no long the webpage ends up being should I add/remove elements from the page.
Originally I tried setting up my div with two child divs inside: Both with the same Backdrop Filter, only the one on top was 800px tall and had a transparency mask, and the one on the bottom just had a backdrop filter with no mask. However, there was a VERY noticeable interruption in the blur effect where the bottom of the top div with the gradient mask met the top of the bottom div without one; so now I’m trying to do this effect in one div.
However every tutorial or set of instructions I’ve found so far online, including here, seems to only have steps for applying a gradient transparency to an image such as an image inside a div, or the background image on a website not on a div hovering over the background image that just has a backdrop filter in it. Any help in figuring this out would be greatly appreciated.
Update added for clarity: I made some mockups in photoshop to serve as an example of the effect I’m trying to pull off.
When you first load the webpage the background image should be mostly visible at the top with a blur effect over the bottom, and a gradient transparency effect go from the bottom to the top. As you scroll up the webpage, the blur should move up the screen with the scrollbar, And once you’ve scrolled to a certain point, the blur effect should cover the entire background image as you scroll to the bottom.
2
Answers
Is that the way you want it?
Looks like
backdrop-filter
does’not allow gradient blur.But you might make it like this: