Making Apple Progressive Blur on the Web
devslovecoffee.com
devslovecoffee.com
Fun fact: Apple doesn't let us use CAFilter in SwiftUI. It's a "them" privilege, and if we want it we need to do it ourselves*, just like you
* or obfuscate the code and continue in the great game of cat and mouse: https://github.com/aheze/VariableBlurView/blob/main/Sources/...
This gives the illusion that there’s a fisheye or barrel distortion at the edge. You can see this most strongly when the images get to the top edge. The edges of the image curve outwards.
Apples blur doesn’t do that. It seems to expand the content outwards and then blur it uniformly from there. This means that the lines of the image do become fuzzier (as a blur would) but they effectively seem to be axis aligned, as you get the background blurring inwards as well reducing the effect of expansion.
There also seems to be some pre-emptive blurring that adds to that. If I bring an image near the top edge but not under the blur section, the top edge will be a blurred copy of the image, then fall into the background and then to the crisp image.
So I always thought it was weird when people complained that Safari was the buggy one holding the web back, since I was always running into Chrome bugs/performance pits instead. (typically Firefox worked great)
This just reinforces my notion that these people complaining developed within their known Chrome constraints (Chrome developers known intuitively what you can't do), and then ran into Safari bugs, whereas if they developed within Safari constraints and then moved to Chrome, they'd run into just as many bugs.
Google also built superior dev tools into Chrome in many respects. Lastly, many developers don’t or won’t ever read W3C/WhatWG/TC39/IETF specs or peruse browser bug trackers beyond solving the immediate problem they’re faced with, so blame can often be very arbitrary.
To the loss of everyone. This is the same company that introduced disappearing scrollbars, just one of many dumb design decisions.
What modern design seems to forget, is that at the end of the day, people actually want to USE the interface, not just look at it.
I get why: design trends from mobile have moved upwards to desktops. But man, I find myself missing Leopard-era macOS design a lot lately.
[1] And yes, because I use it, I obviously agree that the design is one of those classic “form over function” things that shouldn’t have happened in the first place.
Running this on the RP4 was less than 1fps. Turned off the blur it works great, even the animation is great.
Tested blur on a static element, the entire page crawls. These effects looks great, but are performance hogs.
I personally would rephrase this as "Apple consistently markets their design as great". Apple is probably the best example of how far marketing and PR can get you with fairly run of the mill design.
Apple designs are certainly gorgeous and well marketed, but there are multiple instances where their design seems to stand in the way of utility and practicality.
This runs at 165 fps in Shadertoy for me (warning all constants are wild guesses, use "pebbles" for iChannel1):
void mainImage( out vec4 fragColor, in vec2 fragCoord )
{
// Normalized pixel coordinates (from 0 to 1)
vec2 uv = fragCoord/iResolution.xy;
float blurRadius = clamp(1.5 * (texture(iChannel1, uv/2.0 + vec2(iTime, iTime / 2.0)/6.0).x - 0.5) + 0.5, 0.0, 1.0);
float mipmapLevel = fwidth(uv).x;
float biasedMip = mipmapLevel + blurRadius * 4.0;
vec3 final = (3.0/8.0) * textureLod(iChannel0, uv, biasedMip).xyz;
for (float i = 0.0; i < 6.28; i += 6.28/5.0) {
final += (1.0/8.0) * textureLod(iChannel0, uv + 0.02 * blurRadius * vec2(sin(i), cos(i)), biasedMip).xyz;
}
// Output to screen
fragColor = vec4(final.xyz,1.0);
}Strange that Firefox works fine for you on a slightly older version of the same platform.
for the average non-gamer your iphone is probably the most powerful computer they own
I played around with the idea using the simple single backdrop-filter and had some success with inheriting the border-radius from the parent element onto the caption element. Would that possibly work in your multi-backdrop-filter approach?
Bit of a shame because the static effect is quite nice.
"402: PAYMENT_REQUIRED Code: DEPLOYMENT_DISABLED
This Deployment has been disabled.
Your connection is working correctly.
Vercel is working correctly."
Guess it’s now time for me to learn my lesson and optimize the images
So where the kernel gradient mask is 1, you multiply this by the desired max radius blur, down to 0, which represents a radius blur of 0.
Edit: Why downvote this? It’s literally how you implement it.