surstromming

1.0.1 • Public • Published

surstromming

Demo

import { surstromming } from 'surstromming'

const instance = surstromming('.element', {
  // at what breakpoint is changes mode
  modeChangeBreakpoint = 768,

  // selector of the items inside the container
  itemSelector = ".item",

  // how fast the mouse moves the items
  speed = 0.05,

  // runs in init
  onInit = ({ element, list, items }) => {},

  // runs each frame in 'mouse' mode
  onFrame = () => {},

  // what a new item becomes active
  onChange = (oldActive, newActive) => {},

  // on window resize between big/small
  onModeChange = (bigMode) => {},
});

// destroy/remove event listeners
instance.destroy()

Readme

Keywords

none

Package Sidebar

Install

npm i surstromming

Weekly Downloads

1

Version

1.0.1

License

ISC

Unpacked Size

4.4 kB

Total Files

3

Last publish

Collaborators

  • erikthalen