Is it me or this kind of "Easter eggs" are completely unprofessional? If you have clients then should have basic contracts, agreements, etc. Isn't this what courts are for?
It'd be OK if you added it in the contract. "Deliverable will degrade in visual appearance through a 10% daily reduction in opacity if payment is not made on the schedule and according to the terms described in section X.Y below. Full payment including any applicable late fees or interest will restore the site to full functionality and visual appearance and will remove the opacity reduction code."
At the very least it'd spark an interesting discussion with the client that might allow you to reach another measure which would satisfy both parties.
With cars having increased connectivity, I wonder how much drama it would cause if the radio stopped working, fuel efficiency started going down, etc, when you were late on a car payment.
Repossession is one thing and is certainly a more professional, and legal, than this kind of ransom.
If a contract was in place for a piece of work, similar to a finance agreement on a vehicle, then legal recourse is the way to go. Be it repossession or a lawsuit.
The right answer is always have a legally binding contract :)
What you really need is some kind of Angular/Webpack plugin that add obfuscated code to call out to some 3rd-party escrow/broker service to check if a flag has been raised and if so refuse to load. If you only had access to the final bundled code it might be hard to find what part to rip out (think like the "Preview" or "Sample" slightly opaque text on images. Then you could deliver the final product sans "DRM" after payment.
I think this could be thwarted with a CSP policy? Not really sure.
Bonus points to load and inject all the HTML markup via ajax from a server you control, so even if they pay some kid to remove the opacity you can still time-bomb the site underneath them.
I did this once for a client that didn't pay (15 years ago when I was practically still a kid). It did not go well and I still did not get paid, but at least it was kind of fun.
Really easy to rip this out. Some of the greensock demo libraries were designed to break except on certain domains, I remember I thought those were pretty clever. Also if the code is server-side rendered and you withhold the source it makes it even harder.
everytime your client makes a payment, a certain portion of your code becomes local rather than served, from your infrastructure, when the payments are finished, all the code segments will be local and integral to the clients copy. if the client refuses to pay they no longer have server access.
in other words, they continue to recieve updates if they continue to pay.