1.0.1 • Published 3 years ago

surstromming v1.0.1

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

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()