Skip to content

a roulette to manage elements to display or hidden in the page.

License

Notifications You must be signed in to change notification settings

bbb169/roulette-display-manager

Repository files navigation

Demo

XIBQ@XLO3D$4`J3O1SKIXH5 M_K~~R~0QW(C M94{EW)0(8

Start

npm start # or yarn start

This builds to /dist and runs the project in watch mode so any edits you save inside src causes a rebuild to /dist.

Then run the example inside another:

cd example
npm i # or yarn to install dependencies
npm start # or yarn start

To do a one-off build, use npm run build or yarn build.

To run tests, use npm test or yarn test.

🔨 Usage

import React from 'react';
import { Roulette } from '../.'

interface WidgetInfo {
  icon?: any
  id: string
  label: string
}

const App = () => {
  return (
    <div>
      <Roulette allwidget={[{ icon: 'https://www.baidu.com/img/PCtm_d9c8750bed0b3c7d089fa7d55720d6cf.png', id: '1', label: 'first', position: 0 }]} radius={500} onShow={() => {
        console.log('wheel showed')
      }} onHide={() => {
        console.log('wheel hided')
      }} onSelect={(position: Number, widget: WidgetInfo, toHide: boolean) => {
        console.log('selected', position, widget, toHide)
      }} onMouseEnter={(position: Number, widget: WidgetInfo | undefined, hided: boolean | undefined) => {
        console.log('entered', position, widget, hided)
      }} onMouseLeave={(position: Number, widget: WidgetInfo | undefined, hided: boolean | undefined) => {
        console.log('left', position, widget, hided)
      }}/>
    </div>
  )
}

About

a roulette to manage elements to display or hidden in the page.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published