Skip to content
Tiny script to show a donation popup to common visitors to a website
JavaScript HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
.gitignore
DonationPopup.js
DonationPopup.min.js
DonationPopup.min.js.map
LICENSE
README.md
package-lock.json
package.json
renovate.json
test.html
webpack.config.js

README.md

DonationPopup

Tiny script to show a donation popup to common visitors to a website

Installation

<script>
    window.DOP_config = {
        links: { // Replace with your links
            paypal: "https://paypal.me/inventivetalent",
            patreon: "https://patreon.com/inventivetalent",
            donorbox: "https://donorbox.org/inventivetalent-general-donation",
            kofi: "https://ko-fi.com/inventivetalent"
        }
    }
</script>
<script src="https://unpkg.com/donationpopup@1.1.1/DonationPopup.min.js"></script>
npm install --save donationpopup

Configuration

{
    visits: 10,// Number of visits required for the popup to first show up
    timeout: 24,// Timeout for the 'remind later' option in hours
    text: "Hey there, sorry for the interruption!\nIt looks like you've visited this site a couple of times - if you like it and want to help keep it running, please consider throwing over a small donation :)",// Text of the popup
    postponeText: "Maybe Later",// Text on the 'remind me later' button
    dismissText: "Never!",// Text on the dismiss button
    color: "#9c9c9c",// Background color
    position: "bottom-right",// Position of the popup
    enableAnalytics: false,// Toggle Google Analytics - will send a custom event on clicks if enabled
    links: {
        paypal: "",// PayPal link
        patreon: "",// Patreon link
        donorbox: "",// Donorbox link
        kofi: "",// Ko-fi link
        custom: null // can be a function to add custom HTML
    }
}

Check the source for more advanced configuration options

You can’t perform that action at this time.