How to Trigger Confetti at the End of an Article in Webflow
Learn how to trigger confetti when a visitor finishes reading your Webflow article with canvas-confetti.
In this tutorial, Sandro, cofounder of the Gemeos Webflow agency, shows you how to trigger confetti when a visitor reaches the end of your Webflow article.
Example
Test both trigger modes
End of article
Fireworks from both corners
Progressive milestones
Light confetti at 50%, full confetti at 100%
| Parameter | Value | Description |
|---|---|---|
| Trigger | scroll >= total - 100px | 100px before the end of the page |
| fired | Boolean | Prevents the confetti from repeating |
| Origin | x: 0 and x: 1 | Fireworks from both corners |
1. Load canvas-confetti in the head
// In Page Settings > Head :
// 2. Add an end message (optional)
Create a Div with the ID article-finished and set it to display none at the end of your article. It will show when the reader reaches the end. Put your end-of-article CTA in it.
3. Add the script in Footer code
(function() {
if (typeof confetti !== 'function') return;
var fired = false;
window.addEventListener('scroll', function() {
if (fired) return;
var scrolled = window.scrollY + window.innerHeight;
var total = document.documentElement.scrollHeight;
if (scrolled >= total - 100) {
fired = true;
// Fireworks from both corners
confetti({ particleCount: 80, angle: 60, spread: 55, origin: { x: 0, y: 0.8 } });
confetti({ particleCount: 80, angle: 120, spread: 55, origin: { x: 1, y: 0.8 } });
// Congratulations message
var el = document.getElementById('article-finished');
if (el) el.style.display = 'block';
}
}, { passive: true });
})();4. Variation: progressive stars
For a subtler effect at the 50% and 100% milestones:
var milestones = { 50: false, 100: false };
window.addEventListener('scroll', function() {
var pct = Math.round((window.scrollY + window.innerHeight) / document.documentElement.scrollHeight * 100);
if (pct >= 50 && !milestones[50]) {
milestones[50] = true;
confetti({ particleCount: 30, spread: 50, origin: { y: 0.6 } });
}
if (pct >= 100 && !milestones[100]) {
milestones[100] = true;
confetti({ particleCount: 120, spread: 80, origin: { y: 0.6 } });
}
}, { passive: true });Conclusion
End-of-article confetti creates a moment of celebration and memorability. Use cases:
- Long, dense articles that reward people for reading all the way through
- Tutorials with a completion reward
- Landing pages with scroll storytelling
Lorem ipsum
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.














