Code

Discussion on Prize Wheel Pro

Discussion on Prize Wheel Pro

Cart 29 sales

binaryprovid3r supports this item

Supported

This author's response time can be up to 2 business days.

7 comments found.

This is great if you want to have a random wheel spinning. It’s very hard if you want to decide exactly what item is the winner

can you update to support setting the winning item by ID instead of angle?

or at least provide an official example of how to return the angle based on a certain item that we want to be selected?

Hello.

I purchased the plugin. However, there are a couple things that’s not in the documentation:

1) What is getRandomAngle()? How is it used to determine custom spin logic? Let’s say the backend decided that the winning id should be #1, then how do I make sure it’s showing #1 after the spin?

Thanks.

Hi and thanks for the purchase!

That method is intended for the option to call an api of your choice to provide a random angle instead of relying on the libraries built in logic. It is not intended to provide a deterministic angle. I hope it answers your question.

So is there a way to get the wheel to land at a pre-determined result?

Is it possible to turn this into android apk ?

No, unfortunately not.

another question, on the top right configuration panel, how to save the configuration to live site? because when refresh page will return to default configuration.

Ah yeah, the configuration panel is just for demo purpose on the admin page. What it does is essentially constructing the configuration object that is provided to the library.

So you need to provide the same information but in code, as properties to the PrizeWheel object:

new PrizeWheelPro({ // Set your properties here })

The available properties are fully documented in the documentation here: /documentation/index.html#configuration

Just let me know if you have more questions!

how to not display the configuration panel in frontend?

The config panel is only added to the demo page. If you create the prizewheel following the documentation it will not show up.

no sound while spinning?

Hi there, not at the moment but it’s something I can consider adding. Thanks for the suggestion!

What you can do meanwhile is to listen to the onSpinStart event and play a sound that way.

can u give code to play sound onSpinStart? so i can implement at my end. Thank you.

Sure!

A basic implementation could look something like this:

const wheelAudio = new Audio(‘wheel_sound.mp3’) // Update to your sound file

const wheel = new PrizeWheelPro({ targetElementSelector: ’#wheel-container’, sections: [ { id: ‘1’, type: ‘text’, text: ‘Prize 1’ }, { id: ‘2’, type: ‘text’, text: ‘Prize 2’ }, { id: ‘3’, type: ‘text’, text: ‘Prize 3’ } ], spinDuration: 3, // Set this to match the length of your audio onSpinStart: () => { wheelAudio.play() // Play sound when spin starts }, });

Does it have admin panel where we can control

Hi, you configure the wheel in code. The demo page shows an admin panel to visualize how customizable the component is. I hope this answers your question..

by
by
by
by
by
by

Tell us what you think!

We'd like to ask you a few questions to help improve CodeCanyon.

Sure, take me to the survey