Skip to content

πŸ‡πŸ»πŸ’¨ Apply motion blur to any HTML element as it moves

Notifications You must be signed in to change notification settings

nicolasmn/motion-blur

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ‡πŸ»πŸ’¨ MotionBlur

Using the feGaussianBlur SVG filter we can create a motion blur effect on any element. This works by referencing the SVG filter with CSS through filter: url(#<filter-id>) and changing the values of the SVG filter according to the movement of the element.

This is really just a proof of concept and by no means intended for production usage. Works best in Chrome for now.

Example usage:

import MotionBlur from 'motion-blur'

const elem = document.querySelector('.moving-element')
const opts = {
  selfUpdate: true,
  multiplier: 1/6
}

new MotionBlur(elem, opts)

About

πŸ‡πŸ»πŸ’¨ Apply motion blur to any HTML element as it moves

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published