Skip to content

A CSS-only depth of field effect mixin, built using Compass

Notifications You must be signed in to change notification settings

sethbro/compass-depth_of_field

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Effect wherein hovering over a "foreground" element causes the "background" to blur, & vice versa.

Demo: http://sethbro.com/demo.html

Usage

Apply the mixin to a container class with two children elements. These will be the "fields."

+depth_of_field( $color: #000, $amt: 5px, $init_blur: background )

# $color ­ text color within the child elements
# $amt ­ pixel amount of the blur
# $init_blur ­ sets which "field" will be blurred initially. Defaults to background.

You'll most likely want to position the two elements relative to each other in a way that supports the illusion. Javascript to add a parallax scrolling effect is also helpful.

TODO

  • Support for 3+ field levels
  • Support for sub-elements (links within text, etc)

About

A CSS-only depth of field effect mixin, built using Compass

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published