Skip to content

Instantly share code, notes, and snippets.

@stevereich
stevereich / 0_reuse_code.js
Created May 22, 2016 00:35
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@stevereich
stevereich / EventMonitor.js
Created April 8, 2016 21:28 — forked from livingston/EventMonitor.js
Element event monitor, similar to Web Inspector's `monitorEvents`
(function (global) {
if ( !global.Event && !('keys' in Object) && !('bind' in Function) ) { return }
var eventProto = Event.prototype,
EVENTS = {
'mouse': [ 'click', 'dblclick', 'contextmenu', 'mousedown', 'mouseup', 'mouseover', 'mousemove', 'mouseout', 'drag', 'dragend', 'dragenter', 'dragleave', 'dragover', 'drop'],
'key': [ 'keydown', 'keypress', 'keyup', 'input'],
'res': [ 'load', 'unload', 'beforeunload', 'abort', 'error', 'resize', 'scroll', 'readystatechange' ],
'form': [ 'select', 'change', 'submit', 'reset', 'focus', 'blur' ],
'ui': [ 'DOMFocusIn', 'DOMFocusOut', 'DOMActivate', 'DOMCharacterDataModified', 'DOMNodeInserted', 'DOMNodeRemoved', 'DOMSubtreeModified' ],

Fixed Background Illusion

This bit of CSS demonstrates how two fixed backgrounds (in this case, one black and white, the other color) can be layered so that the view port div of the top layer, appears to change the state of the bottom layer. This effect works well with a blurred/clear image as well. Your imagination is the limit! Enjoy!

A Pen by Steve Reich on CodePen.

License.