ui和功能分离的九宫格
The grid-roll lottery system offers a sophisticated yet user-friendly approach to conducting prize draws. By separating UI and logic within the component, it allows developers to focus solely on the visual aspect and prize assignment, while the underlying functionality manages the complex mechanics. With two distinct lottery modes, grid-roll provides flexibility depending on the specific needs of the draw, making it an ideal choice for various applications.
This system is not only aesthetically pleasing but also highly functional, catering to both index-based and PID-based prize selections. The configuration options afford considerable control over the lottery experience, ensuring it can adapt to different scenarios effortlessly.
Two Lottery Modes: Choose between index and PID modes for flexible prize selection based on your specific requirements.
Customizable Grid Layout: Supports various configurations for grid size, allowing you to set the layout that best fits your application.
Dynamic Rolling Control: Speed and direction can be adjusted for a personalized experience, whether in clockwise or counterclockwise motion.
Event Callbacks: Stay informed with callbacks that notify you when the lottery is underway or when a selection has been made, enhancing interactivity.
Versatile Prize Configuration: Easily mark prizes as disabled or use PIDs for customized prize allocation according to your needs.
Reliable Initialization: Automatically initializes the lottery grid upon setup and offers the ability to re-initialize in case of unexpected layout changes.
Promise-Based Functions: The core methods such as startRoll and stopRoll return promises, ensuring smooth and manageable execution of the lottery process.
Adaptive Lighting: The optional lamplight feature enhances the excitement by adding visual effects to signify winning moments.