Skip to content

Embed DonorBox form on /littlehelpers page #5

@anthonybailey

Description

@anthonybailey

Parent: #2

Goal

Build /littlehelpers as an embedded donation page with DonorBox form. This replaces the current 302 redirect to the DonorBox hosted page.

Phase 1: Standard DonorBox Embed (This Issue)

Get DonorBox form embedded on /littlehelpers page - standard embed, no matching manipulation yet.

Files to Create/Modify

  1. src/lib/redirects.ts - Remove /littlehelpers from TEMPORARY_REDIRECTS

  2. src/routes/littlehelpers/+page.svelte - New page with DonorBox embed

  3. src/routes/littlehelpers/meta.ts - Page metadata

  4. src/lib/components/DonorBoxEmbed.svelte - Reusable DonorBox embed component

    • Follow TallyEmbed.svelte pattern for reference
    • Props: campaignId, height
    • Script injection via onMount

DonorBox Embed Structure

<script src="https://donorbox.org/widget.js" paypalExpress="true"></script>
<iframe
  src="https://donorbox.org/embed/pauseai-s-little-helpers"
  height="685px"
  width="100%"
  style="max-width:500px; min-width:310px;"
  seamless="seamless"
  name="donorbox"
  frameborder="0"
  scrolling="no"
  allowpaymentrequest
></iframe>

Page Content

  • Title: "Little Helpers Campaign" (or similar)
  • Campaign messaging (pull from DonorBox campaign description)
  • DonorBox form embed
  • Note for large donors: "For donations of €1000+, contact us to minimize fees"

Phase 2: Matching-Aware Progress Display (Future Issue)

Approach: Client-side JS manipulation of DonorBox widget numbers

Matching Logic

  • Challenge matchers double donations up to €11K donated (€22K matched total)
  • Display: displayed = Math.min(actual * 2, 22000)
  • After €11K donated, further donations no longer doubled

Implementation

  • Wait for DonorBox iframe to load
  • Access progress meter elements via DOM/postMessage
  • Parse the displayed "raised" amount
  • Apply matching formula and update displayed text
  • Add matching badge/note

Reference Files

  • src/lib/components/TallyEmbed.svelte - Similar embed pattern
  • src/lib/redirects.ts - Current redirect config
  • src/routes/pdoom/+page.svelte - Simple page example

Documentation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions