{"id":15070008,"url":"https://github.com/nuxy/react-slot-machine-gen","last_synced_at":"2025-07-23T21:38:55.576Z","repository":{"id":49333843,"uuid":"271217495","full_name":"nuxy/react-slot-machine-gen","owner":"nuxy","description":":file_folder: The / slot-machine-gen / plugin React component wrapper.","archived":false,"fork":false,"pushed_at":"2025-07-13T21:34:16.000Z","size":1182,"stargazers_count":12,"open_issues_count":1,"forks_count":13,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-13T21:47:11.910Z","etag":null,"topics":["3d-cylinder","components","games","reactjs","slots","wrapper-library"],"latest_commit_sha":null,"homepage":"https://slot-machine-gen.nuxy.dev","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nuxy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-06-10T08:08:05.000Z","updated_at":"2025-07-13T21:00:49.000Z","dependencies_parsed_at":"2024-03-25T03:23:08.781Z","dependency_job_id":"015b6b02-5bb0-43cb-8afd-8c40055f8040","html_url":"https://github.com/nuxy/react-slot-machine-gen","commit_stats":{"total_commits":42,"total_committers":1,"mean_commits":42.0,"dds":0.0,"last_synced_commit":"067e4f813dfe6a9ae9409b4b99ee981b71c678a1"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/nuxy/react-slot-machine-gen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuxy%2Freact-slot-machine-gen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuxy%2Freact-slot-machine-gen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuxy%2Freact-slot-machine-gen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuxy%2Freact-slot-machine-gen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nuxy","download_url":"https://codeload.github.com/nuxy/react-slot-machine-gen/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuxy%2Freact-slot-machine-gen/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265419658,"owners_count":23761850,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["3d-cylinder","components","games","reactjs","slots","wrapper-library"],"created_at":"2024-09-25T01:46:25.915Z","updated_at":"2025-07-23T21:38:55.544Z","avatar_url":"https://github.com/nuxy.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# React Slot Machine Generator\n\n[![npm version](https://badge.fury.io/js/react-slot-machine-gen.svg)](https://badge.fury.io/js/react-slot-machine-gen) [![](https://img.shields.io/npm/dm/react-slot-machine-gen)](https://www.npmjs.com/package/react-slot-machine-gen) [![Install size](https://packagephobia.com/badge?p=react-slot-machine-gen)](https://packagephobia.com/result?p=react-slot-machine-gen) [![](https://img.shields.io/github/v/release/nuxy/react-slot-machine-gen)](https://github.com/nuxy/react-slot-machine-gen/releases)\n\nCreate an extremely biased, web-based slot machine game.\n\n![Preview](https://raw.githubusercontent.com/nuxy/slot-machine-gen/master/package.gif)\n\n## Features\n\n- Faux-panoramic reel animations (**3D cylinder**, without `\u003ccanvas\u003e`)\n- Support for single/multi-line reels and pay-lines.\n- Pseudo-random selections by configured weight.\n- Configurable RNG (to make it less biased)\n- Configurable sound clips for reel animations.\n- Easy to set-up and customize.\n\nCheckout the [demo](https://nuxy.github.io/slot-machine-gen) for examples of use.\n\n## Dependencies\n\n- [Node.js](https://nodejs.org)\n\n## Installation\n\nAdd to an existing [React](https://reactjs.org) project using [YARN](https://yarnpkg.com).\n\n    $ yarn add react-slot-machine-gen\n\n## Usage\n\n```javascript\nimport React       from 'react';\nimport SlotMachine from 'react-slot-machine-gen'; // or '../dist/react-slot-machine';\n\nconst reels = [\n  {\n    imageSrc: 'path/to/image.png',\n    symbols: [\n      {\n        title: 'cherry',\n        position: 100,\n        weight: 2\n      },\n      {\n        title: 'plum',\n        position: 300,\n        weight: 6\n      },\n      {\n        title: 'orange',\n        position: 500,\n        weight: 5\n      },\n      {\n        title: 'bell',\n        position: 700,\n        weight: 1\n      },\n      {\n        title: 'cherry',\n        position: 900,\n        weight: 3\n      },\n      {\n        title: 'plum',\n        position: 1100,\n        weight: 5\n      }\n    }\n  },\n\n  // add more reels ...\n];\n\nexport default class Demo extends React.Component {\n  constructor() {\n    super();\n\n    this.state = {\n      play: false\n    };\n  }\n\n  playEvent() {\n    this.setState({\n      play: !this.state.play\n    });\n  }\n\n  render() {\n    return (\n      \u003cReact.Fragment\u003e\n        \u003cSlotMachine reels={reels} play={this.state.play} /\u003e\n\n        \u003cbutton id=\"play-button\" onClick={() =\u003e this.playEvent()}\u003ePlay\u003c/button\u003e\n      \u003c/React.Fragment\u003e\n    );\n  }\n};\n```\n\n## Component Props\n\n| Name     | Type     | Description               |\n|----------|----------|---------------------------|\n| reels    | Array    | Symbols configuration.    |\n| play     | Boolean  | Spins the reels if `true` |\n| callback | Function | Returns winning symbols.  |\n| options  | Object   | Override game [defaults](https://github.com/nuxy/slot-machine-gen#reels-configuration). |\n\n## Documentation\n\n- [Methods](https://github.com/nuxy/slot-machine-gen#methods)\n- [Reels configuration](https://github.com/nuxy/slot-machine-gen#reels-configuration)\n- [Game options](https://github.com/nuxy/slot-machine-gen#game-options)\n- [Callback](https://github.com/nuxy/slot-machine-gen#callback)\n- [Customizing symbols](https://github.com/nuxy/slot-machine-gen#customizing-symbols)\n\n## Developers\n\n### CLI options\n\nRun [ESLint](https://eslint.org) on project sources:\n\n    $ npm run lint\n\nTranspile ES6 sources (using [Babel](https://babeljs.io)) and minify to a distribution:\n\n    $ npm run build\n\nBundle [demo](https://github.com/nuxy/react-slot-machine-gen/tree/master/demo) sources (using [Webpack](https://webpack.js.org)):\n\n    $ npm run webpack\n\n## Contributions\n\nIf you fix a bug, or have a code you want to contribute, please send a pull-request with your changes. (Note: Before committing your code please ensure that you are following the [Node.js style guide](https://github.com/felixge/node-style-guide))\n\n## Versioning\n\nThis package is maintained under the [Semantic Versioning](https://semver.org) guidelines.\n\n## License and Warranty\n\nThis package is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose.\n\n_react-slot-machine-gen_ is provided under the terms of the [MIT license](http://www.opensource.org/licenses/mit-license.php)\n\n## Author\n\n[Marc S. Brooks](https://github.com/nuxy)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuxy%2Freact-slot-machine-gen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnuxy%2Freact-slot-machine-gen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuxy%2Freact-slot-machine-gen/lists"}