-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
103 lines (88 loc) · 2.94 KB
/
index.html
File metadata and controls
103 lines (88 loc) · 2.94 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="moreReese" />
<title>moreReese</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/web3@latest/dist/web3.min.js"></script>
<link rel="stylesheet" href="styles.css" />
</head>
<body>
<div id="preamble">
<a href="https://github.com/more-reese"><h1 class="title">moreReese</h1></a>
<h2 class="subtitle">
<a href="https://discord.gg/MACu4mrPdr">discord</a>,
<a href="https://t.me/more_reese">telegram</a>,
<a href="mailto: embur@morereese.co">email</a>,
<a href="https://github.com/more-reese">github</a>,
<a href="https://twitter.com/more_reese">twitter</a>,
</h2>
<br />
</div>
<div>
<p>a jiraffe on the internet</p>
<div>
<iframe src="https://paragraph.xyz/@morereese/embed" width="480" height="480" style="border:1px solid #EEE; background:white;" frameborder="0" scrolling="no"></iframe>
</div>
<h2>Writing</h2>
<div>
<ul>
<li><a href="https://github.com/more-reese/published-writing"><code>Published articles</code></a>: List of Published Writing</li>
</ul>
</div>
</div>
</div>
<!-- Pay button
<div>
<input id="amount" type="text" value="0.1" />
<div id="status"></div>
</div>
<div>
<input id="paymentAddress" type="text" value="0x6cbddf616a1ad5ae13628b342cd667c6bc919ba8" />
<button class="pay-button">Pay</button>
<div id="status"></div>
</div>
<script type="text/javascript">
window.addEventListener('load', async () => {
if (window.ethereum) {
window.web3 = new Web3(ethereum);
try {
await ethereum.enable();
initPayButton()
} catch (err) {
$('#status').html('User denied account access', err)
}
} else if (window.web3) {
window.web3 = new Web3(web3.currentProvider)
initPayButton()
} else {
$('#status').html('No Metamask (or other Web3 Provider) installed')
}
})
const initPayButton = () => {
$('.pay-button').click(async () => {
// paymentAddress is where funds will be send to
const paymentAddress = $("#paymentAddress").val();
const amountEth = $("#amount").val();
const fromAddress = web3.currentProvider.selectedAddress;
web3.eth.sendTransaction({
to: paymentAddress,
value: web3.utils.toWei(amountEth, 'ether'),
from: fromAddress,
}, (err, transactionId) => {
if (err) {
console.log('Payment failed', err)
$('#status').html('Payment failed')
} else {
console.log('Payment successful', transactionId)
$('#status').html('Payment successful')
}
})
})
}
</script>
-->
</body>
</html>