All Projects → lijinke666 → react-turntable

lijinke666 / react-turntable

Licence: MIT license
🎯 A HTML5 raffle turntable component for react

Programming Languages

javascript
184084 projects - #8 most used programming language
Less
1899 projects
CSS
56736 projects
HTML
75241 projects

Projects that are alternatives of or similar to react-turntable

ETurntable
ETurntable
Stars: ✭ 17 (-22.73%)
Mutual labels:  rotate, turntable
Flutter image editor
Flutter plugin, support android/ios.Support crop, flip, rotate, color martix, mix image, add text. merge multi images.
Stars: ✭ 181 (+722.73%)
Mutual labels:  rotate
Wavideobox
秒级! 三行代码实现iOS视频压缩、变速、混音、合并、GIF水印、旋转、换音、裁剪 ! 支持不同分辩率,支持你能想到的各种混合操作! 扩展性强...更多功能不断增加中... iOS 8.0 + 有需要的功能或错误欢迎issue,笔者会及时更新
Stars: ✭ 707 (+3113.64%)
Mutual labels:  rotate
Pierotateview
android自定义View,带旋转动画的饼状图,区块点击事件,滑动到某一区块事件,可惯性旋转
Stars: ✭ 113 (+413.64%)
Mutual labels:  rotate
Rverify.js
✅❎ A lightweight image rotation verification plugin.
Stars: ✭ 33 (+50%)
Mutual labels:  rotate
Zoom
Javascript library to do pinch zoom that preserves scale and rotation correctly.
Stars: ✭ 130 (+490.91%)
Mutual labels:  rotate
Any Touch
👋 手势库, 按需2kb~5kb, 兼容PC / 移动端
Stars: ✭ 567 (+2477.27%)
Mutual labels:  rotate
SSImagePicker
Easy to use and configurable library to Pick an image from the Gallery or Capture an image using a Camera... 📸
Stars: ✭ 227 (+931.82%)
Mutual labels:  rotate
Rollingwriter
Rolling writer is an IO util for auto rolling write in go.
Stars: ✭ 169 (+668.18%)
Mutual labels:  rotate
Pdfsam
PDFsam, a desktop application to extract pages, split, merge, mix and rotate PDF files
Stars: ✭ 1,829 (+8213.64%)
Mutual labels:  rotate
Parrot
A package to rotate text and party with parrots at the same time
Stars: ✭ 99 (+350%)
Mutual labels:  rotate
Extended image
A powerful official extension library of image, which support placeholder(loading)/ failed state, cache network, zoom pan image, photo view, slide out page, editor(crop,rotate,flip), paint custom etc.
Stars: ✭ 1,021 (+4540.91%)
Mutual labels:  rotate
Jqueryrotate
jQueryRotate - plugin to rotate images by any angle cross-browse with animation support
Stars: ✭ 157 (+613.64%)
Mutual labels:  rotate
Egjs
Javascript components group that brings easiest and fastest way to build a web application in your way.
Stars: ✭ 871 (+3859.09%)
Mutual labels:  rotate
Pixelsdk
The modern photo and video editor for your iPhone / iPad app. A fully customizable image & video editing iOS Swift framework.
Stars: ✭ 192 (+772.73%)
Mutual labels:  rotate
T Scroll
A modern reveal-on-scroll library with useful options and animations. (Animate Elements On Reveal)
Stars: ✭ 642 (+2818.18%)
Mutual labels:  rotate
Pleaserotate.js
🔄 Politely ask your users to view your mobile website in portrait or landscape mode
Stars: ✭ 121 (+450%)
Mutual labels:  rotate
Photo view
📸 Easy to use yet very customizable zoomable image widget for Flutter, Photo View provides a gesture sensitive zoomable widget. Photo View is largely used to show interacive images and other stuff such as SVG.
Stars: ✭ 1,280 (+5718.18%)
Mutual labels:  rotate
Alyn
Detect and fix skew in images containing text
Stars: ✭ 202 (+818.18%)
Mutual labels:  rotate
Gol
gol is a high performance async log kit for golang
Stars: ✭ 166 (+654.55%)
Mutual labels:  rotate

react-turntable

npm npm

A HTML5 Turntable component for React

Screenshots

example

Installation

npm install react-turntable --save

Example

Live Demo

Development

git clone https://github.com/lijinke666/react-turnatable
yarn or npm install
npm start

Usage

import React from "react"
import ReactDOM from "react-dom"
import ReactTurntable from "react-turntable"
import "react-turntable/assets/index.css"

const styles = {
    justifyContent:"center",
    alignContent:"center",
    display:"flex"
}
const prizes = [
    'Durex', 'MI', 'Meizu',
    'iphone 6s', 'iphone 6s plus', 'Chafingdish',
    'WeiLong','masturbation cup'
]

const options = {
    prizes,
    width: 500,
    height: 500,
    primaryColor: "#83AF9B",
    secondaryColor: "#C8C8A9",
    fontStyle:{
        color:"#fff",
        size:"14px",
        fontVertical:true,
        fontWeight:"bold",
        fontFamily:"Microsoft YaHei"
    },
    speed : 1000,
    duration:5000,
    clickText:"Click",
    onStart(){
      //If you want before the rotate do some...
      console.log('start...');
      //If you want stop rotate you can return false
      return true
    },
    onComplete(prize){
      console.log('prize:',prize)
    }
}
const Demo = () => (
    <div style={styles}>
        <ReactTurntable {...options}/>
    </div>
)
ReactDOM.render(
    <Demo />,
    document.getElementById('root')
)

Options

  • options.prizes

    • Desc : prizes of the turntable prizes length >=2
    • Type : array
    • Default : -
  • options.width

    • Desc : width of the turntable
    • Type : number
    • Default : 500
  • options.height

    • Desc : height of the turntable
    • Type : number
    • Default : 500
  • options.primaryColor

    • Desc : primary color of the turntable
    • Type : string
    • Default : #83AF9B
  • options.secondaryColor

    • Desc : secondaryColor color of the turntable
    • Type : string
    • Default : #C8C8A9
  • options.speed

    • Desc : rotate speed of the turntable
    • Type : number
    • Default : 1000 (ms)
  • options.duration

    • Desc : rotate total time of the turntable
    • Type : number
    • Default : 5000 (ms)
  • options.clickText

    • Desc : click text of the turntable start game btn ( Supports custom buttons )
    • Type : string || reactNode
    • Default : Start
  • options.fontStyle

    • Desc : prize text style of the turntable
    • Type : Object
      • fontStyle.color

        • Desc : text color
        • Type : string
        • Default : #fff
      • fontStyle.size

        • Desc : text font size
        • Type : number
        • Default : 14
      • fontStyle.fontVertical

        • Desc : The text is arranged vertically of the turntable (If the text is very long, you can set the options 'true')
        • Type : boolean
        • Default : false
      • fontStyle.fontWeight

        • Desc : text font weight
        • Type : string
        • Default : bold
      • fontStyle.fontFamily

        • Desc : prize text font
        • Type : string
        • Default : Microsoft YaHei
  • options.onComplete

    • Desc : game complete callback of the turntable (return current seleted prize)
    • Type : Function
    • Default : -
  • options.hiddenButton

    • Desc : hidden action button
    • Type : boolean
    • Default : false
  • options.getTurntable

    • Desc : getTurntable={turntable => turntable.start() turntable.stop()}
    • Type : Function
    • Default : -
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].