https://github.com/acrool/acrool-react-jackpot
React jackpot animation
https://github.com/acrool/acrool-react-jackpot
jackpot reactjs
Last synced: over 1 year ago
JSON representation
React jackpot animation
- Host: GitHub
- URL: https://github.com/acrool/acrool-react-jackpot
- Owner: acrool
- License: mit
- Created: 2023-05-11T00:22:30.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-11-25T10:23:04.000Z (over 1 year ago)
- Last Synced: 2024-12-07T00:49:14.914Z (over 1 year ago)
- Topics: jackpot, reactjs
- Language: TypeScript
- Homepage: https://acrool-react-jackpot.pages.dev
- Size: 3.1 MB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# Acrool React Jackpot
Fast custom jackpot for Reactjs
[](https://www.npmjs.com/package/@acrool/react-jackpot)
[](https://github.com/acrool/@acrool/react-jackpot/blob/main/LICENSE)
[](https://github.com/acrool/react-jackpot/blob/main/LICENSE)
[](https://www.npmjs.com/package/@acrool/react-jackpot)
[](https://www.npmjs.com/package/@acrool/react-jackpot)
## Features
- Support custom length
## Install
```bash
yarn add @acrool/react-jackpot
```
## Usage
add in your index.tsx
```tst
import "@acrool/react-jackpot/dist/index.css";
```
then in your page
```tsx
import {Flex, fr, Grid} from '@acrool/react-grid';
import styled from 'styled-components';
import {Jackpot} from '@acrool/react-jackpot';
import {generatorArray} from '@acrool/js-utils/array';
import {useRef} from "react";
const Example = () => {
const [amount, setAmount] = useState(32767);
const timeRef = useRef(null);
useEffect(() => {
timeRef = setInterval(() => {
onChange(getRandom(1000));
}, 3000);
return () => {
clearInterval(timeRef.current);
};
}, []);
return (
);
export default Example;
```
There is also a example that you can play with it:
[](https://acrool-react-jackpot.pages.dev)
## License
MIT © [Acrool](https://github.com/acrool) & [Imagine](https://github.com/imagine10255)