BlurJS Usage Examples
Simple usage examples for getting started with BlurJS.
1. Create a Basic HTML File
Firstly we're going to create a basic HTML file, with just a parent div and a child div.
2. Add BlurJS
Now, let's add BlurJS to the project. For faster loading, we're going to use the minified
version of BlurJS. Add this script tag at the bottom, just before the ending </body>
tag.
3. Make Magic
After you've done that, let's finally make some magic
!
Add this next to
<div class="blur"
, remember to put a space between them.
You can experiment with adding other values as the height or width, like 100%
or even 6em
.
You can also experiment with adding other properties, like for instance, moving the blur around using
blur-left
orblur-top
.You can change the blur size, color, blur amount, and even the z-index, allowing you to position your blur above or below other elements.
4. The End
Now that you've made some pretty cool blurs, why not let your creativity flow? Build brand new modern sites using BlurJS, or, who knows, even spice up some of your old sites with some carefully placed colored gradient blurs.
We'd love to see what you've created, be sure to tag us on X/Twitter @InfinitodeLTD when you share your BlurJS implementation using #
BlurJS.
Last updated