framer-simpleparallax
v1.0.0
Published
framer module for a simple parallax class
Downloads
3
Readme
Simple parallax class for Framer.js
Compile
From root:
$ cd <myProject>.framer
coffee --compile --output ./ src/
Setup
$ cd <myProject>.framer
$ npm install framer-simpleparallax
In npm.coffee:
exports.simpleparallax = require "framer-simpleparallax"
In app.coffee:
SimpleParallax = require("npm").simpleparallax
sp = new SimpleParallax
sp.init()
Usage
SimpleParallax expects a container layer with sublayers to animate. Subsequent layers are translated by a factor of the defined friction value.
Options
sp = new SimpleParallax
# name of the layer containing sublayers
# required
layerGroup: nameOfLayerGroup
# value for amount of friction in each layer 0-1
# lower means the layers move less
# default 0.1
friction: 0.1
# invert layer to mouse movement
# default false
invert: false
# debug mode that shows x and y coordinates of mouseover
# default false
debug: false