Skip to content

Instantly share code, notes, and snippets.

@WietseWind
Created September 30, 2018 17:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WietseWind/3554f85d2ebb42d134632c829afc2906 to your computer and use it in GitHub Desktop.
Save WietseWind/3554f85d2ebb42d134632c829afc2906 to your computer and use it in GitHub Desktop.
Start and stop Coil donation
<button id="stopDonation">Stop Donation</button>
<script src="https://polyfill.webmonetization.org/polyfill.js"></script>
<script src="https://cdn.coil.com/donate.js"></script>
<script>
var btn = document.getElementById('stopDonation')
btn.style.display = 'none'
var Coil = window.WebMonetizationScripts.donate({
paymentPointer: '$twitter.xrptipbot.com/WietseWind'
})
Coil.addEventListener('money', function (m) {
btn.style.display = 'block'
})
btn.onclick = function () {
Coil.close()
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment