JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q21121F
  • License ISC

A JavaScript module, which creates a responsive text shadow based on mouse position (desktop) or device orientation (mobile)

Package Exports

  • moving-shadow

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (moving-shadow) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

moving-shadow.js

npm version

A JavaScript module, which creates a responsive text shadow based on mouse position (desktop) or device orientation (mobile).

Examples

Quick Start

npm i moving-shadow
then
import movingShadow from 'moving-shadow';
or
<script src="https://unpkg.com/moving-shadow"></script>
then
movingShadow();

Configuration

Options with defaults

const settings = {
  shadowType:   "shadow",    // "shadow", "perspective","perspective-shadow", "dropShadow"
  selector:     "h1, h2",    // tag, class, or id to apply shadow to
  angle:        20,          // height of view source. Should be between 10 - 100
  relativeAngle:false,       // false. desktop only, allows for each element to move relative to the mouse
  diffusion:    0,           // blur-radius
  color:        "#333333CC", // shadow-color or perspective color
  altColor:     "#333333CC", // shadow-color (perspective-shadow only)
  shineColor:   "#fff3",     // reflected light (perspective-shadow only)
  fixedShadow:  null,        // "5px 5px #555" to include an optional fixed shadow
  xOffset:      0,           // X offset value, set to max fixedShadow x offset
  yOffset:      0            // Y offset value, set to max fixedShadow y offset
}

movingShadow(settings);