0.2.5 • Published 7 years ago

lightbulb v0.2.5

Weekly downloads
8
License
MIT
Repository
github
Last release
7 years ago

Lightbulb

Software License npm

Project shadows under elements based on the position of a light source.

Installation

yarn add lightbulb

Usage

Using a fixed light source

import Lightbulb from 'lightbulb';

Lightbulb.illuminate({
    container: '.lightbulb-container',
    item: '.lightbulb-item',
    spread: 20,
    color: 'rgba(0, 0, 0, .2)',
    inset: false,
    lightbulb: {
        x: 0,
        y: 0,
        distance: 20
    }
});

Using the mouse as a floating light source

import Lightbulb from 'lightbulb';

Lightbulb.float({
    container: '.lightbulb-container',
    item: '.lightbulb-item',
    spread: 20,
    color: 'rgba(0, 0, 0, .2)',
    inset: false,
    lightbulb: {
        distance: 20
    }
});

Example

Build and run the example:

yarn
yarn run build:example
open ./example/index.html

Credits

License

The MIT License (MIT). Please check the LICENSE for more information.

0.2.5

7 years ago

0.2.4

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.0

7 years ago