0.6.1 • Published 2 years ago

react-3d-cube-interaction v0.6.1

Weekly downloads
10
License
MIT
Repository
-
Last release
2 years ago

Orbit Interaction component

A component to listen to and visualize rotation and zoom interaction. You can mount click/touch listeners on any custom element.

Component positioning must be solved in user-land. Just wrap the component and position it yourself accordingly.

For an example how to use the component, have a look at react-apps/app/src/index.tsx

Customizing

The component accepts a classnames object, where every aspect of the styling can be overriden and extended.

Imperative API

You can access the imperative API by saving a reference of the component's API using the ref prop.

interface CubeControlApi {
  rotateTo: (
    newRotation: (ControlElementRotation | ControlElementRotationInverted) & {
      /**
       * If true, animation is applied
       * to cube
       */
      smooth?: boolean;
    },
  ) => any;
}

Notes

Make sure that your container element has the following CSS property:

body {
  overscroll-behavior: contain;
}

This disables the default browser drag interactions (like drag to reload etc)

0.6.1

2 years ago

0.6.0

3 years ago

0.5.4

3 years ago

0.5.3

3 years ago

0.5.2

3 years ago

0.5.1

3 years ago

0.5.0

3 years ago

0.4.0

3 years ago

0.3.1

3 years ago

0.3.0

3 years ago

0.2.1

3 years ago

0.1.0

3 years ago

0.2.0

3 years ago

0.1.1

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago