-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdiscordwidget.min.js
1 lines (1 loc) · 1.2 KB
/
discordwidget.min.js
1
let fileref=document.createElement("link");fileref.setAttribute("rel","stylesheet"),fileref.setAttribute("type","text/css"),fileref.setAttribute("href","https://pro.fontawesome.com/releases/v5.10.0/css/all.css"),document.getElementsByTagName("head")[0].appendChild(fileref);var discordWidget={link:"https://discord.gg/c7UQ2ca",color:"#5965f2",fontColor:"white",draw:function(){document.body.appendChild(createElementFromHTML(`<a id="codineer-dc-widget" style="position: fixed;\n bottom: 0px;\n right: 0px; \n padding: 20px;" href="${discordWidget.link}" target="_blank">\n <div style="height: 60px;\n line-height: 65px; \n width: 60px; \n font-size: 2em;\n font-weight: bold;\n border-radius: 50%;\n background-color: ${discordWidget.color};\n color: ${discordWidget.fontColor};\n text-align: center;\n cursor: pointer;"><i class="fab fa-discord" style=""></i></div>\n </a>\n `))},remove:function(){document.getElementById("codineer-dc-widget").remove()},update:function(){this.remove(),this.draw()}};function createElementFromHTML(e){var t=document.createElement("div");return t.innerHTML=e.trim(),t.firstChild}