Paywalls allow you to reveal portions of content upon making a payment.

Slide the Money Button to learn how this paywall works.

Welcome to the secret club.

You're free to use the source code in this page.

Here's how to get started:

Load the source code from this page into your favorite text editor. Open your web browser and navigate to the moneybutton.com Config page. You can make your own button there to ensure that you have the correct Bitcoin address and Button ID. Copy the button code and switch back to your text editor app and replace the <div class="money-button"> . Make sure you don't include the <script> since it is already in the page at the end of the <body> . Add back in the attributes, data-on-payment and data-on-error :

data-on-payment="handleSuccessfulPayment" data-on-error="handleFailedPayment"

Here's how this works:

When the Money Button receives a successful payment, it calls handleSuccessfulPayment(payment) . That function in turn calls unlockContent() . unlockContent() adds a CSS class called, unlocked , to the unlockable DIV. The unlocked class is defined in CSS to use an animation to transition its opacity.

Note: The CSS uses both opacity and visibility properties becasue the opacity is necessary for the animation and the visibility is necessary for screen readers to skip the locked content.

Drop me a message on Twitter if you use the code so I can applaud your work.