1.9.0 • Published 5 years ago

react-turnplate v1.9.0

Weekly downloads
22
License
ISC
Repository
github
Last release
5 years ago

SnapShots

a configurable turnplate in React

npm.io

react-turnplate

$ npm install --save  react-turnplate

how to use

  import ReactTurnPlate from 'react-turnplate'
  onTryRotate(){
    /* do some check stuff,if can not rotate return*/
    this.setState({canStartRotate:true})
  }

const reward_list = [{icon:'imageurl',name:'prize1',id:1},{icon:'imageurl',name:'prize1',id:2}]
  <ReactTurnPlate
          prizeList={reward_list}
          award={award}
          image_spin={require("../src/img/btn_spin.png")}
          background_1={require("../src/img/circle1_img.jpg")}
          background_2={require("../src/img/circle2_img.jpg")}
          canStartRotate={canStartRotate}
          onTryRotate={this.onTryRotate.bind(this)}
          rotateFinish={this.rotateFinish.bind(this)}
        />

you can also fork the code and npm start to run the example.

props

paramstypedesc
image_spinstringspin button
background_1stringbackground_1
background_2stringbackground_2
prizeListarray{icon:'imageurl',name:'prize1',id:1},{icon:'imageurl',name:'prize1',id:2}
awardobjectaward should be null first,after request back return an object like prizelist0
canStartRotateboolcontrol the turnplate should startRotate
onTryRotatefunctrigger after click the rotate button,should do some check stuff and if it's ok,set canStartRotate to be true then the turnplate start rotating,meanwhile request for the award and after the request finish,set the award
rotateFinishfunc

more

you can fork and check the example code to see the fully complishment.

If you have any of ideas,don't forget to leave an issue! And also star haha

License

ISC

1.9.0

5 years ago

1.8.0

5 years ago

1.7.0

5 years ago

1.6.0

5 years ago

1.5.0

5 years ago

1.4.0

5 years ago

1.3.0

5 years ago

1.2.0

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago