0.3.4 • Published 5 years ago

box-3d-animate v0.3.4

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

box-3d-animate

npm package

small contribution for those who work with react and styled-components

Box 3d animate is just a library for create 3d box with your images.

alt text

Installation

require react and styled-components via yarn, just follow these simple commands:

$ yarn add box-3d-animate

or via npm:

$ npm install box-3d-animate --save

Basic use

import in your file js

...
import CreateBox3D from "box-3d-animate";
// import your images
import frontSide from "./imageF.jpg";
import backSide from "./imageB.jpg"
import leftSide from "./imageL.jpg"
import rightSide from "./imageR.jpg"
import topSide from "./imageT.jpg"
...
render() {
  return (
    <CreateBox3D
      defaultWidth={200}
      frontSide={frontSide}
      backSide={backSide}
      leftSide={leftSide}
      rightSide={rightSide}
      topSide={topSide}
    />
  );
}

Properties

PropertyDefaultTypeValues
leftSidehttps://via.placeholder.com/200Stringurl or import image
rightSidehttps://via.placeholder.com/200Stringurl or import image
frontSidehttps://via.placeholder.com/200Stringurl or import image
backSidehttps://via.placeholder.com/200Stringurl or import image
topSidehttps://via.placeholder.com/200Stringurl or import image
bottomSidehttps://via.placeholder.com/200Stringurl or import image
perspective800pxString900px, 1200px, ...
perspectiveOrigin50% -150pxString30% 50em, ...
duration10sString1s, 300ms...
timingFunctionlinearStringease, ease-in, ease-out, ease-in-out, linear, step-start, step-end
iterationCountinfiniteString or Numberinfinite or 0, 1, 3, ...
transformOrigin50% 50% -2emStringcenter, 50%, top bottom, 10% 80% ...
directionnormalStringnormal, reverse, alternate, alternate-reverse
animationNameroundsYStringrounds, roundsY, roundsX
defaultWidth200Number300, 150, ...
maxWidth150pxString200px, ...
margin5em auto autoString1px, auto 0, 4px auto 5px, ...
shadowBottomtrueBooleantrue, false
loading<LoadingComponent />ReactNode<span>loading...</span> ...
SSRfalseBooleantrue, false

Nextjs example

...
import CreateBox3D from "box-3d-animate";
...
render() {
  return (
    <CreateBox3D
      SSR={true}
      ...
    />
  );
}

Some examples here

License

Box 3d animate is licensed under the MIT license. (http://opensource.org/licenses/MIT)

0.3.4

5 years ago

0.3.3

5 years ago

0.3.2

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.0

5 years ago

0.1.0

5 years ago