Add a spinning prize wheel to a marketing campaign page where winning odds are determined by your backend server, not exposed in the browser.
Build a scratch-card giveaway component in a Vue app with each prize configured as a mix of images, text, and background colors.
Create a consistent slot machine animation across a WeChat Mini Program and a web app using the same plugin and prize configuration.
Documentation is primarily in Chinese, English docs are listed as a work in progress.
Lucky-canvas is a JavaScript plugin for adding lottery and prize-drawing animations to a website or app. It provides three visual styles: a spinning prize wheel, a nine-grid scratch-card style picker, and a slot machine. All three are drawn with the Canvas API, which means they render sharply on screens of any pixel density, including high-resolution mobile displays. The README is written in Chinese, this summary is based on the description, topics, and visible structure of the project. The plugin is designed to work across many different JavaScript environments without rewriting your code. There are separate npm packages for plain JavaScript, Vue, React, UniApp, Taro (a cross-platform mini-app framework), and WeChat Mini Programs. Each package wraps the same core drawing engine, so the behavior is consistent regardless of which framework you use. You configure what appears in each segment of the wheel or grid by passing in a list of prizes. Each prize can be text, an image, a background color, or a button, and you can mix these freely. The plugin supports both modes of determining a winner: the result can be decided locally in the browser before the animation starts, or you can call your own backend during the spin and wait for a server response before landing on a prize. This lets you control the actual odds from a server rather than exposing probability logic to the browser. The project is actively maintained and has English documentation listed as a work in progress. The Chinese documentation and demo site live at 100px.net. It is released under an open-source license.
← buuing on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.