|
|
@ -1,3 +1,5 @@ |
|
|
|
const escape = require('escape-html'); |
|
|
|
|
|
|
|
const badgeLinkUrl = username => `https://tippin.me/@${username}`; |
|
|
|
const badgeImageUrl = username => `https://badgen.net/badge/%E2%9A%A1%EF%B8%8Ftippin.me/@${username}/F0918E`; |
|
|
|
|
|
|
@ -11,7 +13,7 @@ const username = document.querySelector('input[name="username"]'); |
|
|
|
const badgePreview = document.querySelector('.badge-preview'); |
|
|
|
|
|
|
|
const generateBadge = () => { |
|
|
|
badgePreview.innerHTML = badgeHtml(username.value); |
|
|
|
badgePreview.innerHTML = badgeHtml(escape(username.value)); |
|
|
|
}; |
|
|
|
|
|
|
|
username.addEventListener('input', generateBadge); |
|
|
|