WEBVTT
Kind: captions
Language: en

00:00:00.120 --> 00:00:05.040
when humans first opened their eyes in the&nbsp;
morning struggling to see something blurring was&nbsp;&nbsp;

00:00:05.040 --> 00:00:10.040
discovered but they didn't actually have any way&nbsp;
of saving that effect until cameras were invented&nbsp;&nbsp;

00:00:10.040 --> 00:00:15.680
and thanks to long exposure times weird old lenses&nbsp;
and manual focusing they managed to capture blurry&nbsp;&nbsp;

00:00:15.680 --> 00:00:20.480
images that sometimes showed motion and movement&nbsp;
and other times depth of field like how close or&nbsp;&nbsp;

00:00:20.480 --> 00:00:25.560
far objects were to the camera but nowadays thanks&nbsp;
to digital lenses and computers we have more types&nbsp;&nbsp;

00:00:25.560 --> 00:00:30.320
of blurs like Zoom blur draws attention to a&nbsp;
certain part of an image directional blur shows&nbsp;&nbsp;

00:00:30.320 --> 00:00:34.880
motion and movement in graphic design. tilt-shift&nbsp;
blur emphasizes on a part of an image and creates&nbsp;&nbsp;

00:00:34.880 --> 00:00:39.720
a shallow depth of field. smart blur and surface&nbsp;
blur get rid of noise and Imperfections in your&nbsp;&nbsp;

00:00:39.720 --> 00:00:44.600
selfies. lens blur simulates depth of field and&nbsp;
creates a cool bokeh effect that everyone used&nbsp;&nbsp;

00:00:44.600 --> 00:00:50.520
for Sensational quotes in 2013. box blur creates&nbsp;
a soft blur over an image. and finally, gaussian&nbsp;&nbsp;

00:00:50.520 --> 00:00:54.720
blur creates a smooth and natural blur which&nbsp;
is actually the most common type of blur you&nbsp;&nbsp;

00:00:54.720 --> 00:01:01.000
see on your favorite websites. but wait... box blur&nbsp;
and gaussian blur look kind of similar though. Yes&nbsp;&nbsp;

00:01:01.000 --> 00:01:06.240
except they don't when you look closer. no I mean&nbsp;
way closer like in the way they're coded. imagine&nbsp;&nbsp;

00:01:06.240 --> 00:01:09.960
you want to make this little blue square blurry.
your computer would imagine this square in the&nbsp;&nbsp;

00:01:09.960 --> 00:01:14.720
center of a checker board and start averaging out&nbsp;
the colors. so mix eight black cells and one blue&nbsp;&nbsp;

00:01:14.720 --> 00:01:19.960
cell and divide it by nine and you'll get a darker&nbsp;
shade of blue all across these nine cells. this is&nbsp;&nbsp;

00:01:19.960 --> 00:01:24.800
a box blur which is not smooth enough so this&nbsp;
time the computer distributes to Blue a little&nbsp;&nbsp;

00:01:24.800 --> 00:01:29.560
bit more on the central cell and its neighboring&nbsp;
cells and a little bit less on the farther ones&nbsp;&nbsp;

00:01:29.560 --> 00:01:35.480
now this is a gaussian blur, but where does this&nbsp;
smooth beautiful blur come from? gaussian blur is&nbsp;&nbsp;

00:01:35.480 --> 00:01:40.600
one of the use cases of the gaussian distribution&nbsp;
or normal distribution created by Carl Friedrich&nbsp;&nbsp;

00:01:40.600 --> 00:01:45.560
Gauss to explain real world phenomena where the&nbsp;
distribution of data shows a higher concentration&nbsp;&nbsp;

00:01:45.560 --> 00:01:50.600
in the center than the two far ends this formula&nbsp;
helped us so much and not just in math or data&nbsp;&nbsp;

00:01:50.600 --> 00:01:56.120
science but also in internet memes, getting rid of&nbsp;
noise in images, edge detection and of course, web&nbsp;&nbsp;

00:01:56.120 --> 00:02:01.720
design. for example you can apply a simple dimple&nbsp;
blur to any layer for any amount you want 5 pixels&nbsp;&nbsp;

00:02:01.720 --> 00:02:07.320
20 pixels 100 pixels or even more. you can make&nbsp;
a little blob in figma, Export it to SVG, animate&nbsp;&nbsp;

00:02:07.320 --> 00:02:11.960
the colors in the code, and give it a cool little&nbsp;
blur and put it on the corner of your website. awww&nbsp;&nbsp;

00:02:11.960 --> 00:02:17.000
isn't that pretty? but don't get too excited cuz&nbsp;
this is just blurring level one and you get nine&nbsp;&nbsp;

00:02:17.000 --> 00:02:22.080
more to go. level two, background blur. background&nbsp;
or backdrop blurs are kind of similar to layer&nbsp;&nbsp;

00:02:22.080 --> 00:02:26.840
blurs but instead of blurring this block you put a&nbsp;
weird frosted glass in front of it. this works the&nbsp;&nbsp;

00:02:26.840 --> 00:02:31.680
same way as a layer blur. it receives a number and&nbsp;
makes whatever that comes behind it blurrier and&nbsp;&nbsp;

00:02:31.680 --> 00:02:36.520
blurrier. you can see this everywhere nowadays&nbsp;
on your phone your computer. it's literally the&nbsp;&nbsp;

00:02:36.520 --> 00:02:41.040
age of glassmorphism. there are many ways to use&nbsp;
this effect like putting shiny objects behind it&nbsp;&nbsp;

00:02:41.040 --> 00:02:46.240
but I think where it really shines is using it as&nbsp;
a background instead of a solid color. level three&nbsp;&nbsp;

00:02:46.240 --> 00:02:50.960
gradient blurs. a header with a background blur&nbsp;
like this is cool and all but this cut right here&nbsp;&nbsp;

00:02:50.960 --> 00:02:55.640
is pretty uninspiring. a header with a background&nbsp;
blur that Fades away toward the content will fix&nbsp;&nbsp;

00:02:55.640 --> 00:03:00.480
that. this is basically a linear gradient that goes&nbsp;
from blur to no blur but great gradients are for&nbsp;&nbsp;

00:03:00.480 --> 00:03:06.200
colors so we need a simple gradient that goes from&nbsp;
very low to zero opacity. but this transparent area&nbsp;&nbsp;

00:03:06.200 --> 00:03:11.360
is still blurry so to make sure it's actually&nbsp;
transparent, we'll turn this gradient into a mask&nbsp;&nbsp;

00:03:11.360 --> 00:03:15.520
that mixes with the background. but this is not&nbsp;
just for headers. you could also try making things&nbsp;&nbsp;

00:03:15.520 --> 00:03:21.360
fade behind newer content as you scroll down on&nbsp;
a website. level four Shadows think of a shadow&nbsp;&nbsp;

00:03:21.360 --> 00:03:26.480
as a blurry object right behind the main object&nbsp;
sometimes this blurry object is the exact same&nbsp;&nbsp;

00:03:26.480 --> 00:03:32.080
as the main one sometimes bigger or smaller maybe&nbsp;
it's even a different color or maybe it's inside&nbsp;&nbsp;

00:03:32.080 --> 00:03:38.680
your object Shadows are used in web design mostly&nbsp;
as well Shadows but sometimes they glow in these&nbsp;&nbsp;

00:03:38.680 --> 00:03:44.440
cases you can bring in an actual blurry object&nbsp;
and position it absolutely on one side and make&nbsp;&nbsp;

00:03:44.440 --> 00:03:49.680
this cool glowy glassy effect or they might add&nbsp;
some depth and realism to your design for example&nbsp;&nbsp;

00:03:49.680 --> 00:03:54.760
two opposite inner Shadows can make a button&nbsp;
feel 3D with shadows you either go realistic or&nbsp;&nbsp;

00:03:54.760 --> 00:04:00.680
chaotic level five clip path the most insane thing&nbsp;
about blurring is that it's it's like a phandom no&nbsp;&nbsp;

00:04:00.680 --> 00:04:05.120
one really sees it but it's there an effect like&nbsp;
this is either a border gradient or a background&nbsp;&nbsp;

00:04:05.120 --> 00:04:10.000
gradient that's clipped near the border right but&nbsp;
how about now we talked about how similar gausssum&nbsp;&nbsp;

00:04:10.000 --> 00:04:14.640
blur is to gradients so this could actually be a&nbsp;
super blurry rectangle and we could cut off the&nbsp;&nbsp;

00:04:14.640 --> 00:04:19.560
interior so let's grab a pizza cutter and make a&nbsp;
path on the rectangle that starts at position 0&nbsp;&nbsp;

00:04:19.560 --> 00:04:26.760
0 this means Zero from left and zero from Top then&nbsp;
we'll go to 100% from left Zero from Top then 100%&nbsp;&nbsp;

00:04:26.760 --> 00:04:33.720
left 100% top then 0% left and 100% from top and&nbsp;
finally we'll go back to 0 0 again so what did&nbsp;&nbsp;

00:04:33.720 --> 00:04:38.680
we just do well basically nothing except we made&nbsp;
a polygon that happens to look exactly like our&nbsp;&nbsp;

00:04:38.680 --> 00:04:43.240
rectangle and now we can continue to cut off the&nbsp;
interior from this polygon let's say we want to&nbsp;&nbsp;

00:04:43.240 --> 00:04:48.360
border this thick around our rectangle so we grab&nbsp;
the pizza cutter again and we'll go to Five pixels&nbsp;&nbsp;

00:04:48.360 --> 00:04:54.280
from left and five from Top then we'll need to&nbsp;
go here which is five pixels from top and how far&nbsp;&nbsp;

00:04:54.280 --> 00:05:00.640
from the left 95% 95 pixels well we wouldn't know&nbsp;
unless this is a rectangle that has a specific&nbsp;&nbsp;

00:05:00.640 --> 00:05:06.600
width like 100 pixels but we want it to be dynamic&nbsp;
so we'll need to calculate 5 pixels less than 100%&nbsp;&nbsp;

00:05:06.600 --> 00:05:11.160
of this rectangle's width based on this logic&nbsp;
we can cut off five pixels inside the top right&nbsp;&nbsp;

00:05:11.160 --> 00:05:16.040
corner bottom right corner and just continue this&nbsp;
until the central part is completely detached from&nbsp;&nbsp;

00:05:16.040 --> 00:05:20.440
the polygon now if you put any elements inside&nbsp;
this card the Border glows dynamically this is&nbsp;&nbsp;

00:05:20.440 --> 00:05:25.000
just one of the ways you can make cool visual&nbsp;
effects with clip path and blurring level six&nbsp;&nbsp;

00:05:25.000 --> 00:05:29.680
svgs CSS sure can get a lot done but if you&nbsp;
want a little more control over the effect to&nbsp;&nbsp;

00:05:29.680 --> 00:05:34.840
make crazier things you can make SPG filter with&nbsp;
good old HTML there are a lot of filter elements&nbsp;&nbsp;

00:05:34.840 --> 00:05:40.480
that can apply cool effects like graininess but&nbsp;
fian blur is the one we need for blurring just&nbsp;&nbsp;

00:05:40.480 --> 00:05:45.000
like before we need a number for the blur amount&nbsp;
remember this checker board when you increase the&nbsp;&nbsp;

00:05:45.000 --> 00:05:50.400
blur amount you're basically expanding the blur&nbsp;
radius AKA standard deviation good news is this&nbsp;&nbsp;

00:05:50.400 --> 00:05:56.040
is absolutely reusable thanks to this filter ID&nbsp;
so now we can apply to anything like this image&nbsp;&nbsp;

00:05:56.040 --> 00:06:00.960
and this makes us pretty powerful and you know&nbsp;
what comes with power you guess it creativity&nbsp;&nbsp;

00:06:00.960 --> 00:06:05.920
for example right now absolutely nothing stops&nbsp;
us from creating a cool revealing effect for a&nbsp;&nbsp;

00:06:05.920 --> 00:06:10.400
hero section on a website like this you make&nbsp;
two images blur one of them and put a mask on&nbsp;&nbsp;

00:06:10.400 --> 00:06:15.040
the other one the mask is a simple circle with a&nbsp;
fixed radius that cuts out the rest of the image&nbsp;&nbsp;

00:06:15.040 --> 00:06:19.400
but those edges are way too sharp so let's ease&nbsp;
it down with the blur filter now you can use a&nbsp;&nbsp;

00:06:19.400 --> 00:06:24.400
little JavaScript and an animation Library called&nbsp;
Gap to constantly calculate where the mouse is&nbsp;&nbsp;

00:06:24.400 --> 00:06:29.120
horizontally and vertically from the left and top&nbsp;
edges of the browser window and you just move the&nbsp;&nbsp;

00:06:29.120 --> 00:06:33.720
circle to that position and if you want it to be a&nbsp;
little more dramatic you can add a duration to it&nbsp;&nbsp;

00:06:33.720 --> 00:06:39.720
now you can get creative with this like ooh click&nbsp;
to reveal the next level level seven shaders deep&nbsp;&nbsp;

00:06:39.720 --> 00:06:44.600
down the rabbit hole of HTML tags there is a&nbsp;
canvas tag that opens the door to web Graphics&nbsp;&nbsp;

00:06:44.600 --> 00:06:49.680
Library the realm of treppy distorted art that&nbsp;
mixes with web design the Shader code goes right&nbsp;&nbsp;

00:06:49.680 --> 00:06:54.200
into your JavaScript where you tell the vertices&nbsp;
and fragments of your canvas how to behave if the&nbsp;&nbsp;

00:06:54.200 --> 00:06:59.720
canvas has an image then the vertices are pretty&nbsp;
obvious but now imagine this image is fill f with&nbsp;&nbsp;

00:06:59.720 --> 00:07:04.560
these small checkerboards AKA kernels if you want&nbsp;
to blur the image you need to figure out which&nbsp;&nbsp;

00:07:04.560 --> 00:07:08.720
pixels on this kernel are more important than&nbsp;
the others which is basically what the gaussian&nbsp;&nbsp;

00:07:08.720 --> 00:07:13.920
formula does we can turn this formula into code&nbsp;
and write a bunch more code to calculate the blur&nbsp;&nbsp;

00:07:13.920 --> 00:07:18.200
but of course I don't expect you to write all that&nbsp;
because that would be a whole other video Plus in&nbsp;&nbsp;

00:07:18.200 --> 00:07:22.440
this day and age we have the luxury of copying&nbsp;
and pasting well-written optimized code that's&nbsp;&nbsp;

00:07:22.440 --> 00:07:27.680
been working for years there are even tools and&nbsp;
libraries that do it for you besides doing all of&nbsp;&nbsp;

00:07:27.680 --> 00:07:33.440
this for a simple blur bit of an Overkill isn't it&nbsp;
well of course but only until level eight Shader&nbsp;&nbsp;

00:07:33.440 --> 00:07:38.200
effects the coolest thing about shaders is that&nbsp;
now you have control over every pixel of your&nbsp;&nbsp;

00:07:38.200 --> 00:07:43.320
canvas so the limit of what you can do is your&nbsp;
imagination remember the selective focus effect&nbsp;&nbsp;

00:07:43.320 --> 00:07:48.680
we made with SVG you can turn that into a smoother&nbsp;
version thanks to shaders this effect is pretty&nbsp;&nbsp;

00:07:48.680 --> 00:07:53.520
common especially on award-winning websites but&nbsp;
this is not to tell you that you necessarily need&nbsp;&nbsp;

00:07:53.520 --> 00:07:59.320
shaders for a stunning blurry website let's go to&nbsp;
level 9 animation the real art is using blurs to&nbsp;&nbsp;

00:07:59.320 --> 00:08:04.040
convey meaning or create a lovely experience for&nbsp;
your visitors bluring has a few simple concepts&nbsp;&nbsp;

00:08:04.040 --> 00:08:09.120
for being playful with your website like hiding&nbsp;
and revealing content or focusing only on one part&nbsp;&nbsp;

00:08:09.120 --> 00:08:13.840
of the content or transitioning between sections&nbsp;
for example if I have a bunch of text like this&nbsp;&nbsp;

00:08:13.840 --> 00:08:17.960
instead of putting it in front of your face and&nbsp;
knowing fool well you're not going to read it I'm&nbsp;&nbsp;

00:08:17.960 --> 00:08:22.240
going to blur out the words and as soon as the top&nbsp;
of the words container hits the top of the page&nbsp;&nbsp;

00:08:22.240 --> 00:08:27.800
they start unblurring one by one as you scroll&nbsp;
now you can read it better even though this is&nbsp;&nbsp;

00:08:27.800 --> 00:08:32.760
nowhere near the beginning level 10 is not about&nbsp;
some Quantum technology the real challenge here&nbsp;&nbsp;

00:08:32.760 --> 00:08:37.760
is mixing it all together in a harmonical way&nbsp;
or adding other effects to it like adding noise&nbsp;&nbsp;

00:08:37.760 --> 00:08:43.240
to your blurry blob or using it alongside other&nbsp;
CSS properties like adding contrast to a blurry&nbsp;&nbsp;

00:08:43.240 --> 00:08:48.320
text to make it look gooey or using blurring as&nbsp;
an image loading animation like on this website&nbsp;&nbsp;

00:08:48.320 --> 00:08:53.240
the possibilities are infinite but be careful&nbsp;
even though blurring is simple not all browsers&nbsp;&nbsp;

00:08:53.240 --> 00:08:57.680
feel the same way about it especially not the&nbsp;
older ones so for CSS it wouldn't hurt adding&nbsp;&nbsp;

00:08:57.680 --> 00:09:02.520
a webkit perix for webkit browsers like Safari&nbsp;
plus if you're planning to use shaders you're&nbsp;&nbsp;

00:09:02.520 --> 00:09:07.560
going to have to optimize the out of it because&nbsp;
it directly uses your visitor's GPU to render and&nbsp;&nbsp;

00:09:07.560 --> 00:09:12.360
you never know what GPU they have I mean not&nbsp;
everyone has a monster like mine well that's&nbsp;&nbsp;

00:09:12.360 --> 00:09:16.720
all for this video if you liked it make sure you&nbsp;
do your magic down there and see you on the next

00:09:16.720 --> 00:09:22.000
one

