|
@@ -1,65 +1,11 @@
|
1
|
|
-document.addEventListener('DOMContentLoaded', () => {
|
|
1
|
+document.addEventListener('DOMContentLoaded', function() {
|
2
|
2
|
|
3
|
3
|
//
|
4
|
4
|
// Open links in a new window
|
5
|
5
|
//
|
6
|
6
|
|
7
|
|
- document.querySelectorAll('a._blank').forEach(link => {
|
8
|
|
- link.target = '_blank';
|
|
7
|
+ document.querySelectorAll('a._blank').forEach(function(a) {
|
|
8
|
+ a.target = '_blank';
|
9
|
9
|
});
|
10
|
10
|
|
11
|
|
- //
|
12
|
|
- // Support button
|
13
|
|
- //
|
14
|
|
-
|
15
|
|
- if(document.getElementById('splash'))
|
16
|
|
- return;
|
17
|
|
-
|
18
|
|
- const support = document.createElement('a');
|
19
|
|
- const heart = document.createElement('img');
|
20
|
|
- const text = document.createTextNode('Support');
|
21
|
|
-
|
22
|
|
- heart.src = 'https://github.githubassets.com/images/icons/emoji/unicode/2764.png';
|
23
|
|
- heart.style.width = '24px';
|
24
|
|
- //heart.style.paddingRight = '8px';
|
25
|
|
- heart.classList.add('gemoji', 'heart');
|
26
|
|
-
|
27
|
|
- support.href = 'https://alemart.github.io/encantar-js/support-my-work';
|
28
|
|
- support.target = '_blank';
|
29
|
|
- support.role = 'button';
|
30
|
|
- support.style.display = 'flex';
|
31
|
|
- support.style.alignItems = 'center';
|
32
|
|
- support.style.position = 'fixed';
|
33
|
|
- support.style.right = '16px';
|
34
|
|
- support.style.bottom = '16px';
|
35
|
|
- support.style.padding = '12px';// '0 20px';
|
36
|
|
- //support.style.height = '48px';
|
37
|
|
- support.style.color = 'var(--md-primary-fg-color)';
|
38
|
|
- support.style.backgroundColor = 'var(--md-primary-bg-color)';
|
39
|
|
- support.style.fontWeight = 'bold';
|
40
|
|
- support.style.fontSize = '16px';
|
41
|
|
- support.style.fontFamily = 'var(--md-text-font) sans-serif';
|
42
|
|
- support.style.cursor = 'pointer';
|
43
|
|
- support.style.borderWidth = '2px';
|
44
|
|
- support.style.borderStyle = 'solid';
|
45
|
|
- support.style.borderColor = 'var(--md-primary-fg-color)';
|
46
|
|
- support.style.borderRadius = '100px';
|
47
|
|
- support.style.transition = 'color 125ms,background-color 125ms,border-color 125ms';
|
48
|
|
-
|
49
|
|
- support.addEventListener('pointerenter', () => {
|
50
|
|
- support.style.backgroundColor = 'var(--md-accent-fg-color)';
|
51
|
|
- support.style.borderColor = 'var(--md-accent-fg-color)';
|
52
|
|
- support.style.color = 'var(--md-accent-bg-color)';
|
53
|
|
- });
|
54
|
|
-
|
55
|
|
- support.addEventListener('pointerleave', () => {
|
56
|
|
- support.style.backgroundColor = 'var(--md-primary-bg-color)';
|
57
|
|
- support.style.borderColor = 'var(--md-primary-fg-color)';
|
58
|
|
- support.style.color = 'var(--md-primary-fg-color)';
|
59
|
|
- });
|
60
|
|
-
|
61
|
|
- support.appendChild(heart);
|
62
|
|
- //support.appendChild(text);
|
63
|
|
- document.body.appendChild(support);
|
64
|
|
-
|
65
|
11
|
});
|