Skip to content

Instantly share code, notes, and snippets.

@swarad07
Last active June 3, 2021 09:40
Show Gist options
  • Save swarad07/ae7b86cfe5d55522129c613336ced970 to your computer and use it in GitHub Desktop.
Save swarad07/ae7b86cfe5d55522129c613336ced970 to your computer and use it in GitHub Desktop.
Blur the images on the screen when working in public place.
/**
* Blur the images on the webpage
* blur-images.js From: Swarad Mokal (https://github.com/swarad07)
*/
// Steps
// 1. Open Console
// 2. Go to Sources > Snippets > New Snippet
// 3. Copy paste this file's content and save the snippet > CMD + S. (Optionally, rename the snippet)
// 4. Whenever needed just Run the snippet on the webpage.
// Fast way to run
// 1. Open Console
// 2. CMD + Shift + P > Show Snippets > Choose snippet > CMD + Enter
// -----------------------------------------------------------------------------------------------
// Change the selector as per needs.
// Complete blur.
// const images = document.getElementsByTagName('img');
// Selective blur.
const images = document.getElementsByClassName('b-lazy');
Array.from(images).forEach(function (element) {
element.style.filter='blur(20px)';
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment