1.0.0 • Published 7 years ago

framer-simpleparallax v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
7 years ago

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.

layer container with sublayers

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