0.5.5 • Published 5 years ago

react-rolling-item v0.5.5

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

react-rolling-item

example

<>
  <RollingItem
    on={this.state.start}
    column={3}
    backgroundImage={imageFile}
    backgroundSize="600px 564px"
    introItemInfo={{ x: -39, y: -28 }}
    itemInfo={
      [
        { x: -39, y: -217, id: 'item_1', probability: 0 },
        { x: -39, y: -406, id: 'item_2', probability: 0 },
        { x: -241, y: -28, id: 'item_3', probability: 0 },
        { x: -241, y: -217, id: 'item_4', probability: 0 },
        { x: -241, y: -406, id: 'item_5', probability: 0 },
        { x: -437, y: -28, id: 'item_6', probability: 0 },
        { x: -437, y: -217, id: 'item_7', probability: 0 },
        { x: -437, y: -406, id: 'item_8', probability: 0 },
      ]
    }
    width={177}
    height={181}
    startDelay={1000}
    fixedIds={[3, 4, 7]}
    reset={this.state.reset}
    completionAnimation={true}
    onProgress={(isProgress, result) => { console.log(result); }}
  />
  <button className="start_btn" onClick={this.onClick}>{!this.state.start ? 'START' : 'STOP'}</button>
  <button className="reset_btn" onClick={this.onClickReset}>RESET</button>
</>

Props

propstypedescripton
onbooleanroll start status
columnnumbernumber of columns to roll
backgroundImagestring
backgroundSizestring
itemInfo{id?: any, x: number, y: number, probability?: number}
introItemInfo{x: number, y: number}intro screen before rolling
widthnumberwidth of one item
heightnumberheight of one item
fixedIdsnumber[] or string[]You can define the id that will be won in advance
startDelaynumberpost-start delay
resetbooleanrandom initialization of all items
completionAnimationbooleanwhether you want to do an animation when the item stops (IE9 is not supported)
rootClassNamestringYou can set className to set a custom style on the root node
onProgress(progress: boolean, result?: any[]) => voidA callback function of the rolling animation process

supported browsers

  • IE9+, Chrome, Safari, Firefox, Whale, Mobile Safari, Mobile Chrome...

Features

  • Create a roller by the number you set.
  • Setting items using sprite image.
  • Return items as a result of matching.
  • Probability can be set.
  • Added delay option before rolling start.
  • Intro screen can be set.
  • reset option.
0.5.5

5 years ago

0.5.4

5 years ago

0.5.3

5 years ago

0.5.2

5 years ago

0.5.1

5 years ago

0.5.0

5 years ago

0.4.9

5 years ago

0.4.8

5 years ago

0.4.7

5 years ago

0.4.6

5 years ago

0.4.5

5 years ago

0.4.4

5 years ago

0.4.32

5 years ago

0.4.31

5 years ago

0.4.3

5 years ago

0.4.2

5 years ago

0.4.1

5 years ago

0.4.0

5 years ago

0.3.29

5 years ago

0.3.28

5 years ago

0.3.27

5 years ago

0.3.26

5 years ago

0.3.25

5 years ago

0.3.24

5 years ago

0.3.23

5 years ago

0.3.22

5 years ago

0.3.21

5 years ago

0.3.20

5 years ago

0.3.19

5 years ago

0.3.18

5 years ago

0.3.17

5 years ago

0.3.16

5 years ago

0.3.15

5 years ago

0.3.14

5 years ago

0.3.13

5 years ago

0.3.12

5 years ago

0.3.11

5 years ago

0.3.10

5 years ago

0.3.9-beta

5 years ago

0.3.9

5 years ago

0.3.8

5 years ago

0.3.8-beta

5 years ago

0.3.7

5 years ago

0.3.7-beta

5 years ago

0.3.6

5 years ago

0.3.6-beta

5 years ago

0.3.5

5 years ago

0.3.5-beta

5 years ago

0.3.4

6 years ago

0.3.4-beta

6 years ago

0.3.3

6 years ago

0.3.3-beta

6 years ago

0.3.2

6 years ago

0.3.2-beta

6 years ago

0.3.1

6 years ago

0.3.1-beta

6 years ago

0.3.0

6 years ago

0.3.0-beta

6 years ago

0.2.9

6 years ago

0.2.9-beta

6 years ago

0.2.8-beta

6 years ago

0.2.8

6 years ago

0.2.7-beta

6 years ago

0.2.7

6 years ago

0.2.6-beta

6 years ago

0.2.6

6 years ago

0.2.5-beta

6 years ago

0.2.5

6 years ago

0.2.4

6 years ago

0.2.4-beta

6 years ago

0.2.3

6 years ago

0.2.3-beta

6 years ago

0.2.2

6 years ago

0.2.2-beta

6 years ago

0.2.1

6 years ago

0.2.1-beta

6 years ago

0.2.0

6 years ago

0.2.0-beta

6 years ago

0.1.9-beta

6 years ago

0.1.9

6 years ago

0.1.8

6 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago