-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuttonwidget.js
31 lines (25 loc) · 1012 Bytes
/
buttonwidget.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
let widgetScript = document.querySelector('script[data-name="crypto-coffee-button"]');
var s = document.getElementsByTagName('script')[0];
const buttonEventScript = document.createElement('script');
buttonEventScript.defer = true;
buttonEventScript.src='https://static.cloudflareinsights.com/beacon.min.js';
buttonEventScript.dataset.cfBeacon = '{"token": "31fafc582c564dca9461cd9a1e3b6f4f"}'
s.parentNode.insertBefore(buttonEventScript, s);
window.cryptoCoffeeWidget = window.cryptoCoffeeWidget || function(
// text,
address,
color,
emoji,
font,
font_color,
outline_color,
coffee_color
) {
const widget = '<div class="crypto-coffee-btn-container"><a class="crypto-coffee-btn" ' + `target="_blank" href="http://buymeacryptocoffee.xyz/${address}">` + "<img src='https://www.buymeacryptocoffee.xyz/embedbadge.svg'/>" + "</a></div>"
return widget;
}
widgetScript && document.writeln(
cryptoCoffeeWidget(
widgetScript.attributes['data-address'].value
)
)