Originally published on bryanhamilton.info - full code at github.com/bryanhamiltondev/holiday-lightbox
Every affiliate link on the internet comes pre-packaged with the same lie: "I only recommend products I love." Meanwhile the link is a paycheck. Readers know it. You know it. I know it.
So for this year's Christmas promo on my site I tried the only version of that sentence that's actually true: I recommend these headphones, I do get a commission, and I hand every dollar of it back to whoever buys. Buy through my link, forward your order receipt, and my entire commission goes back to you as cash. I keep zero. The referral money becomes a discount that doesn't need the merchant's permission.
The feature itself is a promo lightbox, and I open-sourced the production code because the implementation turned out to be more interesting than the marketing angle:
- Zero dependencies. One HTML block pasted before . No framework, no fetch, no cookies, no build step.
- It sells by date, not by nag. A date window gates the whole thing: it opens itself in November, shows through December 24, then never opens again. No cron, no takedown deploy. (I still wrote a takedown worker, because deleting things is fun.)
- It waits its turn. Opens 1.4 seconds after load, not on first paint. My homepage LCP is around 2.3s and I'm not letting a popup fight it for the metric.
- Three exits: close button, backdrop click, Escape key.
- It respects prefers-reduced-motion. Every animation - card entry, light glow, bulb blink - dies for users who ask for it. It's a sales popup, not a seizure test.
- A JSON-LD Product block rides along, so the offer is machine-readable from day one: price, currency, stock, offer URL.
The one design detail I'm weirdly proud of: the string of Christmas lights hanging from the inside top edge of the card. Bulb positions sit on a sine curve so the wire sags believably, drop heights vary, colors rotate through a five-color palette, and the whole strand rebuilds itself on resize. About 30 lines of vanilla JS, because I refuse to pull in a dependency for decorative blinking.
Honest notes, since honesty is the whole theme here:
- It reopens on every page load during the window. Deliberate, for a four-week campaign. If yours runs longer, add a sessionStorage guard.
- The cashback promise is operational debt. Someone has to answer those receipt emails and actually send money back. If you copy this pattern, budget for it - a broken cashback promise is worse than no offer at all.
- The FTC disclosure lives inside the cashback line itself. "I'll send my entire commission to you" IS the disclosure. I deleted the boilerplate sentence and let the honest sentence do that job.
The code is at github.com/bryanhamiltondev/holiday-lightbox - src/lightbox.html is the verbatim production block, docs/index.html is a standalone demo you can open locally and watch it pop.
Question for the comments: does the cashback hook make you more likely to click a referral link, or does it read as a gimmick? I honestly can't tell if this is clever or if I've invented a slower discount code.