Sidejar

Demos

Each example is live. Its content is encrypted in this page's source and unlocks when its jar is paid.

The jars take real payments: 2¢ in USDC on Base, sent straight to Sidejar's wallet. Every penny goes toward Sidejar's development, so thank you! Each wallet can pay each demo once. To try one without paying, press Simulate payment.

New to this? See how to pay. A new collection wallet may show a "high-risk" warning. This should go away in time as trust builds; here's what to check.

Simulating is exactly what a determined cheater could do from the browser console. Sidejar's content protection is honor-level: it stops casual readers, View Source and search engines. See the docs.

1. Blurred, then into focus

The preview is scrambled first, then blurred, so the real words are never in it. Paying brings the real text into focus.

<sidejar-pay id="d1" to="0x…" price="0.02" item="essay-1"></sidejar-pay>

<sidejar-content for="d1" onlocked="Sidejar.blur" onpaid="Sidejar.decrypt">
  <template>sj1.…</template>
</sidejar-content>

2. Fade-out teaser

The first 40 words, fading out. This one is not encrypted: a teaser can only show real words if they're in the page. To keep the rest private, show the opening as normal text and encrypt only the rest (demos 6 and 7).

<!-- Not encrypted: a teaser can only show real words if they're in the page. -->
<sidejar-content for="d2" onlocked="Sidejar.teaser">
  <template>
    <p>Most of what we read online is paid for twice…</p>
    …
  </template>
</sidejar-content>

3. Placeholder lines

Grey skeleton lines about as long as the content. Nothing readable at all.

<sidejar-content for="d3" onlocked="Sidejar.placeholder" onpaid="Sidejar.decrypt">
  <template>sj1.…</template>
</sidejar-content>

4. Scrambled

The shape of real text (paragraphs, word lengths, punctuation) with every letter randomized.

<sidejar-content for="d4" onlocked="Sidejar.scramble" onpaid="Sidejar.decrypt">
  <template>sj1.…</template>
</sidejar-content>

5. Your own key

Encrypt with any key (in the Generator or on your server) and put it in data-key.

<sidejar-content for="d5" onlocked="Sidejar.blur"
                 onpaid="Sidejar.decrypt" data-key="my-demo-key">
  <template>sj1.…</template>
</sidejar-content>

6. Your own preview function

A readable opening, then the encrypted rest previewed by your own function: the built-in blur plus a note.

Most of what we read online is paid for twice: once by our attention, and again by our data. The writer, meanwhile, sees almost none of it.

<script>
  // Your own preview: the blur, plus a note of your own.
  function blurWithNote(content) {
    return Sidejar.blur(content) +
      '<p class="note">2 more paragraphs for supporters</p>';
  }
</script>

<p>Most of what we read online is paid for twice…</p>  <!-- readable opening -->

<sidejar-content for="d6" onlocked="blurWithNote" onpaid="Sidejar.decrypt">
  <template>sj1.…</template>  <!-- the rest, encrypted -->
</sidejar-content>

7. A paywall, styled with state classes

<sidejar-content> carries sidejar-locked, sidejar-unlocking,sidejar-unlocked or sidejar-failed (and the same in data-state). The overlay below is plain CSS on those classes.

Most of what we read online is paid for twice: once by our attention, and again by our data. The writer, meanwhile, sees almost none of it.

<style>
  .paywall { position: relative; }
  .paywall.sidejar-locked::after {
    content: "Unlock the full essay for 2¢";
    position: absolute; inset: auto 0 0 0; padding: 48px 0 14px;
    text-align: center; font-weight: 600;
    background: linear-gradient(transparent, var(--bg) 60%);
  }
  .paywall.sidejar-unlocking { opacity: 0.5; }
  .paywall [data-sidejar-view] { transition: opacity 400ms; }
</style>

<p>Most of what we read online is paid for twice…</p>  <!-- readable opening -->

<sidejar-content class="paywall" for="d7"
                 onlocked="Sidejar.blur" onpaid="Sidejar.decrypt">
  <template>sj1.…</template>  <!-- the rest, encrypted -->
</sidejar-content>

8. JSON data

Unlock data, not just text: quiz answers, coupon codes, chart data. Your function decides how to show it.

<sidejar-content for="d8" onlocked="Sidejar.placeholder" onpaid="showAnswers">
  <script type="application/json">
    { "answers": ["B", "D", "A", "C"] }
  </script>
</sidejar-content>

<script>
  function showAnswers(content) {
    const { answers } = Sidejar.json(content);
    return "<ol>" + answers.map((a) => "<li>" + a + "</li>").join("") + "</ol>";
  }
</script>

9. Chained jars

A three-chapter story. Each chapter's jar lives inside the chapter before it, so it only appears once that one is paid, and each chapter previews differently: placeholder lines, then a blur that comes into focus, then scrambled text. All three are encrypted, one inside the next.

<sidejar-pay id="ch1" to="0x…" price="0.02" item="story-ch1"></sidejar-pay>
<sidejar-content for="ch1" onlocked="Sidejar.placeholder" onpaid="Sidejar.decrypt">
  <template>sj1.…</template>
</sidejar-content>

<!-- Inside chapter 1, once decrypted: -->
<sidejar-pay id="ch2" to="0x…" price="0.02" item="story-ch2"></sidejar-pay>
<sidejar-content for="ch2" onlocked="Sidejar.blur" onpaid="Sidejar.decrypt">
  <template>sj1.…</template>
</sidejar-content>

<!-- Inside chapter 2, once decrypted: -->
<sidejar-pay id="ch3" to="0x…" price="0.02" item="story-ch3"></sidejar-pay>
<sidejar-content for="ch3" onlocked="Sidejar.scramble" onpaid="Sidejar.decrypt">
  <template>sj1.…</template>
</sidejar-content>

10. No encryption at all

The simplest case: a thank-you note shown after a tip. It's readable in View Source, which is fine for a thank-you.

<sidejar-content for="d10">
  <template><p>Thanks for the tip!</p></template>
</sidejar-content>

11. Your own button label

Use label with {price} filled in, or put anything inside the tag. Write<sidejar-pay …></sidejar-pay>, never />: HTML has no self-closing custom tags.

☕ Buy me a coffee
<!-- Text with the price filled in -->
<sidejar-pay to="0x…" price="0.02" item="tip-1"
             label="Tip the author {price}"></sidejar-pay>

<!-- Anything inside the tag (shown as-is) -->
<sidejar-pay to="0x…" price="0.02" item="tip-2">☕ Buy me a coffee</sidejar-pay>