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
A JavaScript module, which creates a responsive text shadow based on mouse position (desktop) or device orientation (mobile).
Examples
- Shadow - (source)
- Raised text with shadow - (source)
- Raised text with shadow #2 - (source)
- Drop shadow - (source)
Install
Local
<script src="https://unpkg.com/moving-shadow"></script>
or
Download movingShadow.js
Usage
Options with defaults
const settings = {
shadowType: "shadow", // "shadow", "dropShadow"
selector: "h1, h2", // tag, class, or id to apply shadow to
angle: 20, // height of view source. Should be between 10 - 100
diffusion: 0, // blur-radius
color: "rgba(51, 51, 51, 0.4)", // shadow-color
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);