1.4.0 • Published 4 years ago

draginertia v1.4.0

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

Draginertia

Hello! Welcome to the DragInertia Library. I created this library to be able to drag objects and apply inertia to them when they're dropped. I hope you enjoy it!

NPM JavaScript Style Guide

Install

npm install --save draginertia

Usage

import React from 'react'

import DragInertia from 'draginertia'

class Example extends React.Component {
 render() {
  return (
   <>
    <DragInertia inertiaPower={4}><div className="redSquare"></div></DragInertia>
    <DragInertia inertiaPower={2}><div className="tomatoCircle"></div></DragInertia>
   </>
  )
 }
}

DEMO

npm.io

Details

-You can use DragInertia by inserting your draggable object inside the tags as shown above.

-You can set the inertiaPower;

  • inertiaPower={1}, 1 being the lowest possible inertia applied to the object .
  • inertiaPower={5}, 5 being the highest possible inertia applied to the object.
  • If no entries, by default inertiaPower will be taken as 1.

-DragInertia is set to position:absolute by default to be able to use left and top positioning.

I hope you enjoy it! :)

License

MIT © https://github.com/empipower6

1.4.0

4 years ago

1.3.4

4 years ago

1.3.3

4 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.2

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.2

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago