donationpopup

1.2.1 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i donationpopup

Weekly Downloads

1

Version

1.2.1

License

MIT

Unpacked Size

37.4 kB

Total Files

10

Last publish

Collaborators

  • inventivetalent