Interactive scratch-off coupon widgets: Gamified discount discovery with one-click copy
Gamified scratch-off coupon cards significantly lift conversion rates on ecommerce stores. In this studio, I'll show you how to build a responsive scratch coupon with realistic foil textures and automated win reveal events.
Three Steps to Gamified Coupon Reveals
Select Foil Surface
Pick from classic silver lottery coating, luxury gold shimmer, holographic rainbow luster, or sleek carbon matte.
Set Prize & Threshold
Enter your promotional discount headline and coupon code, and specify the auto-reveal threshold percentage.
Export Zero-Dependency Code
Copy production-ready HTML5 Canvas JavaScript and CSS variables ready to integrate into your e-commerce store.
Features & CSS Best Practices
Hardware-Accelerated Erasing
Uses native canvas destination-out composite mode for instant 60fps clearing without lag.
Auto-Reveal Threshold
Automatically fades out the remaining foil once the customer scratches past your percentage target.
1-Click Clipboard Copy
Customers can click the copy button directly on the revealed code for seamless checkout pasting.
Touch & Pointer Support
Pointer events enable effortless scratch interaction across mice, trackpads, and touchscreens.
Copy Elementor / WP Code
In the code studio above, switch to the Elementor / WP tab and click Copy to get the self-contained code with scoped styling, prize markup, and canvas wiping JS.
Insert an HTML Widget
In your WordPress dashboard, edit your promotional page or Elementor popup with Elementor (Free or Pro). Drag an HTML widget into your column.
Paste & Publish
Paste the snippet into the HTML Code box. The scratch card renders immediately with metallic foil coating, touch gesture support, and one-click code copying.
Sync with Elementor Global Colors
Easily match your site branding by changing --sc-accent in the <style> block to var(--e-global-color-primary) or your theme primary accent color.
Hardware-Accelerated 60fps Rubbing
Uses native destination-out canvas compositing for instantaneous erasing without DOM lag or heavy third-party gamification scripts.
Frequently Asked Questions
How does canvas destination-out erasing work?
Setting ctx.globalCompositeOperation = 'destination-out' instructs the HTML5 2D Canvas renderer to treat incoming drawing paths as an eraser. Wherever the circular brush moves, existing foil pixels are cleared to 0% opacity, revealing the DOM elements beneath.
How does the auto-reveal threshold trigger work?
As the user rubs the card, the engine estimates the cumulative area scratched. Once it exceeds your chosen threshold (e.g. 50%), the canvas opacity transitions smoothly to 0 with pointer-events: none, so users don't have to laboriously scratch every corner.
Does this scratch widget support mobile touchscreen gestures?
Yes. The event handlers bind to standard Pointer Events ('pointerdown', 'pointermove'), enabling seamless rubbing on smartphones and tablets without triggering unwanted screen scrolling.
How do I add an interactive scratch-off coupon to Elementor?
Switch to the Elementor / WP tab in the code studio above and click Copy. In WordPress, open your Elementor page or pop-up modal, drag an HTML widget into your container, and paste the code snippet. The scratch card renders immediately with HTML5 canvas wiping, touch gestures, and one-click code copying with zero external plugins.