GithubHelp home page GithubHelp logo

discord-invite-js-html-css's Introduction

Discord Invite in JS, HTML and CSS

A very-close-to-native Discord Invite script for websites.

Example:
Example of Discord Invite

miniMode Example:
Example of Discord Invite in miniMode

Why

Discord has this very minimlistic and practical invite box that tells users how many members a Discord server has, as well as how many users are online while giving the ability for that user to click a simple 'Join' button to, well, join the server.

As a huge fan of minimalist design and a fan of the Invite box, I thought it would be a good idea to make it possible to embed this on websites instead of the widget provided by Discord or the other solutions in the wild.

How to use

  1. Download the files. (discordInvite.js, discordInvite.css)
  2. Upload the files to your web server.
  3. You will need an Invite Code that never expires from Discord.
  4. Include the CSS file in the head of the page:
    <head>
    ...
    <link rel="stylesheet" href="/path/to/discordInvite.css"/>
    </head>
  5. Include the JS file and initialise on the page:
    <body>
    ...
    <script src="/path/to/discordInvite.js"></script>
    <script>
      discordInvite.init({
      inviteCode: 'DQtcGRy',
      title: 'Aegis7 Gaming',
    });
    discordInvite.render();
    </script>
    </body>
  6. Place this specific <div> wherever you want your invite to appear:
    <div id="discordInviteBox"></div>

Optional Values, default values are in (brackets)

title ('String')
You can provide a default server name. The name will be replaced by whatever the invite code returns but it is good to have something there until the data is returned from Discord. Setting it to your current server name is a good idea.

miniMode (false)
A cut down version of the invite box.

width ('385px')
You can specify width as either 'auto', % or number (px). Alternatively, it can accept any CSS value as a string such as 'inherit' or '100w'.

joinText ('Join') and joinedText ('Joined')
You can change the button text of the Join action to something else, as well as when the person clicks it.

introText ('YOU'VE BEEN INVITED TO A SERVER')
You can change the introText to something else.

hideIntro (false)
You can hide the intro text

Aegis7 Gaming


A gaming community with thousands of Discord users from all across the globe.
[Join us on Discord: https://ag7.gg]

No Support, 'as is'.

Please do not contact us for any support. We will do our best to provide updates when necessary and willing to accept pull requests but you should not expect us to fix issues for you, walk you through how to deploy this or anything of that nature.

Discord

We are not affiliated in any way with Discord. We're just really big fans and we enjoy the platform! If at any time Discord and/or their staff tell us this isn't OK, we will take the script down. We're querying Discord servers and they can very well put this behind an Authentication layer, if this happens or the data is hidden or changed, this script will stop working; Please keep this in mind.

discord-invite-js-html-css's People

Contributors

aegis7gaming avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

discord-invite-js-html-css's Issues

Request: Un-minified source

Thanks for publishing this repo, but I think it would be even better if you also included the source files before minification.

Multiple instances of the Invite w/different options

Need to work on making it possible to have multiple instances of this with different config options. For instance, one as full-width invite for the main content and another as a miniMode version (good for sidebars).

As it stands, it can only have multiple versions of the same configuration values.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.