About: I primarily write on my personal blog (https://kewbi.sh/blog) - please check out my writing there!
Location:
Vancouver, BC
Joined:
Apr 16, 2020
Revshare.js - a Revshare Web Component
Publish Date: May 31 '20
15 4
What I built
I went through a bunch of ideas - a Vue component library, implementing this in another site, or adding it to my existing sites.
Eventually, I settled on this idea, and for the entire month of May (minus an OS reinstall and plus tonnes of Google searching), I spent some time exploring Web Components and Javascript!
I've built Revshare.js, a small Javascript library to make revsharing with Web Monetization easier. It provides an interface for a <rev-share> element with a pointers attribute to make probabilistic revsharing easier.
Submission Category:
Foundational Technology (or perhaps Creative Catalyst, I'm not sure where it fits...)
Demo
Add a <script src="http://unpkg.com/@kewbish/revshare"/> tag to your head, and that's all you need to get started.
...
<rev-sharepointers='["$jackie.wallet": 60, "$charlie.wallet": 40]'><p>This is your revshared content!</p></rev-share>
...
If you'd also like to make your <rev-share> element exclusive, just add the exclusive attribute as well. (This will hide the element when Web Monetization is not enabled.)
...
<rev-sharepointers='["$jackie.wallet": 60, "$charlie.wallet": 40]'exclusive><p>This is your revshared, exclusive content!</p></rev-share>
...
Awesome!