2.8.0 • Published 1 day ago
@winrlabs/games v2.8.0
@winrlabs/games
@winrlabs/games
includes a collection of games that can be integrated into your application. It is ready to use and can be customized to fit your needs. Test.
Installation
npm install @winrlabs/games
# or
yarn add @winrlabs/games
# or (recommended)
pnpm add @winrlabs/games
Usage
You need to wrap your react application via the GameProvider
component to use the games.
import { GameProvider } from "@winrlabs/games";
const App = () => {
return (
<GameProvider>
<div>{/* Your application */}</div>
</GameProvider>
);
};
Here is the basic usage of the DiceTemplate
component:
import { DiceTemplate } from "@winrlabs/games";
const Page = () => {
return (
<div>
<DiceTemplate
options={{
scene: {
backgroundImage: "url(/range.svg)",
},
}}
onSubmit={(data) => {
// send data to external
// get results
setResults([
{
payout: 0,
payoutInUsd: 0,
resultNumber: Math.floor(Math.random() * 100),
},
{
payout: 2,
payoutInUsd: 2,
resultNumber: Math.floor(Math.random() * 100),
},
{
payout: 0,
payoutInUsd: 0,
resultNumber: Math.floor(Math.random() * 100),
},
]);
}}
onAnimationComplete={() => setResults([])}
results={results}
/>
</div>
);
};
2.8.0
1 day ago
2.7.6
2 days ago
2.7.5
2 days ago
2.7.8
2 days ago
2.7.7
2 days ago
2.7.9
2 days ago
2.7.4
3 days ago
2.7.3
6 days ago
2.6.7
6 days ago
2.6.9
6 days ago
2.6.8
6 days ago
2.7.0
6 days ago
2.7.2
6 days ago
2.7.1
6 days ago
2.6.6
7 days ago
2.6.5
10 days ago
2.6.4
10 days ago
2.6.1
11 days ago
2.6.0
11 days ago
2.6.3
10 days ago
2.6.2
11 days ago
2.5.0
14 days ago
2.5.1
14 days ago
2.3.0
23 days ago
2.2.0
23 days ago
2.1.0
29 days ago
0.0.1
2 months ago
1.0.0
2 months ago