Skip to content

heyxmirko/leave-to-discord

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Leave-to-discord Integration Guide

A simple way to engage your website visitors by inviting them to join your Discord server. This overlay displays a popup when users attempt to leave the site, prompting them to join your Discord community.

Quick Start

To add the Discord overlay to your website, follow these simple steps:

  1. Include the Overlay Script
    Add the following script tag to your HTML file, just before the closing </body> tag:

    <script src="https://leave-to-discord.vercel.app/discord-overlay.js"></script>
  2. Initialize the Overlay
    Initialize the overlay with your Discord invite link by adding the following script:

    <script>
        initDiscordOverlay('https://discord.gg/your-invite-link');
    </script>

Live Demo

Want to see it in action? Move your cursor out of the browser window (towards the top) to trigger the overlay and experience the invite modal.

Try the Demo Overlay

Customization

You can customize the appearance of the overlay modal by overwriting the CSS of the discord-overlay.js file to better fit the design of your website.

Note: The overlay will only appear once. To reset it for testing purposes, clear your browser's local storage or use an incognito window.

Contributing

We welcome contributions! If you'd like to improve this project, please fork the repository and submit a pull request with your enhancements.

License

This project is licensed under the MIT License. See the LICENSE file for more information.

About

A simple JavaScript overlay that shows a Discord invite modal when users try to leave your website.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published