Skip to content

onurkerimov/inertia-3d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

inertia-3d

Drag DOM elements with simulated inertia, by 3D CSS transformations. Made using Zbam.js.

Example

Usage

import Inertia from "inertia-3d";

let cube = document.querySelector(".cube");
new Inertia(cube);

API

Used as

new Inertia(element);

or

new Inertia({
  element, // (HTMLElement) target element to be moved 
  handle, // (HTMLElement) target element to be used as the handle (Default: same as handle)
  positionDamping, // (Number) Damping for position (Default: 0.4)
  rotationDamping, // (Number) Damping for rotation (Default: 0.1)
  rotationMaxDegree, // (Number) Upper threshold for rotation (Unit: deg) (Default: 75)
  rotationMultiplier, // (Number) A factor for setting rotation amplitude when the element is moved (Default: 3)
});

About

Drag DOM elements with 3D transformations with mouse. Made using Zbam.js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •