-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
43 lines (41 loc) · 1.17 KB
/
script.js
File metadata and controls
43 lines (41 loc) · 1.17 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
document.querySelectorAll('a[href^="#"]').forEach(el => {
el.onclick = e => {
e.preventDefault();
document.querySelector(e.target.getAttribute('href')).scrollIntoView({
behavior: 'smooth'
});
};
});
document.querySelectorAll('.linkAccount').forEach(el => {
el.onclick = e => {
const w = open(location, '_blank', 'centerscreen,chrome,dialog');
w.close();
const account = e.target.innerHTML.replace('Link ', '');
switch (account) {
case 'PayPal':
case 'BitPay':
e.target.innerHTML = `${account} linked and $100 transfered!`
break;
case 'Patreon':
case 'Ko-fi':
case 'Liberapay':
case 'Subscribestar':
e.target.innerHTML = `${account} linked and subscribed to $100 tier!`
break;
default:
e.target.innerHTML = `${account} linked!`
break;
}
el.onclick = null;
};
});
document.querySelector('#submit').onclick = e => {
if(!e.target.parentElement.reportValidity()) {
e.preventDefault();
return;
}
const el = e.target.parentElement.parentElement;
e.target.parentElement.remove();
el.innerHTML = `Your surgeon will be with you within 48 hours.<br>
They will provide your account confirmation link after the procedure.`;
};