-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmessage.html
377 lines (348 loc) · 13.4 KB
/
message.html
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>CORNHUB INTL INC.</title>
<meta content="text/html; charset=unicode" http-equiv="Content-Type">
<meta name="GENERATOR" content="MSHTML 8.00.6001.18828">
<link rel="icon" type="image/png" href="images/favicon-32x32 2.png" sizes="32x32">
<link rel="icon" type="image/png" href="images/favicon-16x16 2.png" sizes="16x16">
<style>
table {
width: 100%;
max-width: 1200px;
margin: 0 auto;
}
td {
width: 50%;
padding: 10px;
vertical-align: top;
}
body {
max-width: 1200px;
margin: 0 auto;
padding: 20px;
}
img {
max-width: 100%;
height: auto;
}
a {
text-decoration: none;
color: #000080;
}
a:visited {
color: #000080;
}
.wallet-connect {
position: absolute;
top: 20px;
right: 20px;
}
.connect-button {
background-color: #000080;
border: none;
color: white;
padding: 12px 24px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
border-radius: 4px;
transition: all 0.3s ease;
}
.connect-button:hover {
background-color: #0000a0;
transform: translateY(-2px);
box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.connect-button.connected {
background-color: #4040ff;
color: white;
}
.connect-button.enabled {
background-color: #4040ff;
}
.balance-table {
margin: 20px auto;
border-collapse: collapse;
width: 90%;
max-width: 800px;
table-layout: fixed;
}
.balance-table th, .balance-table td {
border: 1px solid #ddd;
padding: 8px;
text-align: center;
font-size: clamp(10px, 1.5vw, 14px);
}
.balance-table th {
background-color: #000080;
color: white;
}
.balance-table td:last-child {
font-family: monospace;
padding: 0;
height: 40px;
position: relative;
overflow: hidden;
}
.balance-table td:last-child a {
position: absolute;
width: 100%;
animation: marquee 15s linear infinite;
white-space: nowrap;
}
.balance-table td:last-child a:nth-child(2) {
animation-delay: 5s;
}
.balance-table td:last-child a:nth-child(3) {
animation-delay: 10s;
}
@keyframes marquee {
0% { transform: translateY(100%); }
5% { transform: translateY(0); }
28% { transform: translateY(0); }
33% { transform: translateY(-100%); }
100% { transform: translateY(-100%); }
}
</style>
<script src="https://cdn.jsdelivr.net/npm/web3@latest/dist/web3.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ethers/5.7.2/ethers.umd.min.js"></script>
<script src="script.js"></script>
<script>
window.addEventListener('load', async () => {
if (typeof window.ethereum !== 'undefined') {
// Check if already connected to Polygon network
const polygonChainId = '0x89'; // Chain ID for Polygon Mainnet
const currentChainId = await window.ethereum.request({ method: 'eth_chainId' });
if (currentChainId !== polygonChainId) {
try {
// Request network switch to Polygon
await window.ethereum.request({
method: 'wallet_switchEthereumChain',
params: [{ chainId: polygonChainId }],
});
} catch (switchError) {
// If network not added, add it
if (switchError.code === 4902) {
try {
await window.ethereum.request({
method: 'wallet_addEthereumChain',
params: [{
chainId: polygonChainId,
chainName: 'Polygon Mainnet',
nativeCurrency: {
name: 'MATIC',
symbol: 'MATIC',
decimals: 18
},
rpcUrls: ['https://polygon-rpc.com/'],
blockExplorerUrls: ['https://polygonscan.com/']
}]
});
} catch (addError) {
console.error('Failed to add Polygon network:', addError);
}
}
}
}
// Connect wallet
try {
await window.ethereum.request({ method: 'eth_requestAccounts' });
const button = document.getElementById('connect-button');
button.textContent = 'Connected';
button.classList.add('connected');
document.getElementById('button-grid').style.display = 'grid';
document.getElementById('wallet-status').style.display = 'none';
document.getElementById('balance-info').style.display = 'block';
updateBalances();
} catch (error) {
console.error('User denied account access');
}
} else {
alert('Please install MetaMask!');
}
});
async function connectWallet() {
if (typeof window.ethereum !== 'undefined') {
try {
await window.ethereum.request({ method: 'eth_requestAccounts' });
const button = document.getElementById('connect-button');
button.textContent = 'Connected';
button.classList.add('connected');
document.getElementById('button-grid').style.display = 'grid';
document.getElementById('wallet-status').style.display = 'none';
document.getElementById('balance-info').style.display = 'block';
updateBalances();
} catch (error) {
console.error('User denied account access');
}
} else {
alert('Please install MetaMask!');
}
}
async function updateBalances() {
const provider = new ethers.providers.Web3Provider(window.ethereum);
const signer = provider.getSigner();
const address = await signer.getAddress();
// Update Corn Token balance
const cornTokenAddress = '0xa0c45509036c422ea7c4d4fcac26a9925531d8c3';
const cornTokenAbi = ['function balanceOf(address) view returns (uint256)'];
const cornTokenContract = new ethers.Contract(cornTokenAddress, cornTokenAbi, provider);
const cornBalance = await cornTokenContract.balanceOf(address);
const cornBalanceFormatted = parseFloat(ethers.utils.formatUnits(cornBalance, 18)).toFixed(3);
document.getElementById('balance').innerText = cornBalanceFormatted;
document.getElementById('balance-display').innerText = cornBalanceFormatted;
// Update PopCorn Token balance
const popCornTokenAddress = '0x6531547b44784dDD8A934fB9fEB92ba582dfeD15';
const popCornTokenContract = new ethers.Contract(popCornTokenAddress, cornTokenAbi, provider);
const popCornBalance = await popCornTokenContract.balanceOf(address);
const popCornBalanceFormatted = parseFloat(ethers.utils.formatUnits(popCornBalance, 18)).toFixed(3);
document.getElementById('balance2').innerText = popCornBalanceFormatted;
document.getElementById('balance2-display').innerText = popCornBalanceFormatted;
// Update Butter Token balance
const butterTokenAddress = '0x409e02e728418501720d7b1e5d7328ac461ecaae';
const butterTokenContract = new ethers.Contract(butterTokenAddress, cornTokenAbi, provider);
const butterBalance = await butterTokenContract.balanceOf(address);
const butterBalanceFormatted = parseFloat(ethers.utils.formatUnits(butterBalance, 18)).toFixed(3);
document.getElementById('balance3').innerText = butterBalanceFormatted;
document.getElementById('balance3-display').innerText = butterBalanceFormatted;
// Enable/disable burn buttons based on CORN balance
const cornBalanceNum = parseFloat(cornBalanceFormatted);
document.getElementById('burn-1-corn').classList.toggle('enabled', cornBalanceNum >= 1);
document.getElementById('burn-3-corn').classList.toggle('enabled', cornBalanceNum >= 3);
document.getElementById('burn-5-corn').classList.toggle('enabled', cornBalanceNum >= 5);
// Enable/disable mint buttons based on POPCORN balance
const popcornBalanceNum = parseFloat(popCornBalanceFormatted);
document.getElementById('mint-bronze').classList.toggle('enabled', popcornBalanceNum >= 1);
document.getElementById('mint-silver').classList.toggle('enabled', popcornBalanceNum >= 3);
document.getElementById('mint-gold').classList.toggle('enabled', popcornBalanceNum >= 5);
}
</script>
</head>
<body bgcolor="#ffffff" text="#000080">
<div class="wallet-connect">
<button id="connect-button" class="connect-button" onclick="connectWallet()">Connect Wallet</button>
</div>
<b>
<font size="12"><p align="center">C</font><font size="8">ORN </font>
<font size="12">H</font><font size="8">UB </font>
<font size="4">INC.<br>CornHub.eth</font><br>Official Home Page</b>
<font size="2"> </p></font>
<center>
"God is just. Work is rewarded with blessing if not money. <br>
Luck is the most important thing, but really it's God."<br>
</center>
<div style="overflow: hidden; margin: 20px auto; width: 90%; max-width: 800px;">
<label for="toggle-marquee">Stop Ticker:</label>
<input type="checkbox" id="toggle-marquee" onclick="toggleMarquee()">
<div id="marquee-container">
<div style="white-space: nowrap; animation: scroll1 20s linear infinite;" class="marquee">
Corn Token - Balance: <span id="balance"></span> - <a href="https://quickswap.exchange/#/swap?exactField=input&outputCurrency=0xa0c45509036c422ea7c4d4fcac26a9925531d8c3&swapIndex=0¤cy0=ETH" target="_blank">Trade Corn</a> - Contract: <a href="https://polygonscan.com/address/0xa0c45509036c422ea7c4d4fcac26a9925531d8c3" target="_blank">0xa0c45509036c422ea7c4d4fcac26a9925531d8c3</a>
</div>
<div style="white-space: nowrap; animation: scroll2 30s linear infinite;" class="marquee">
PopCorn Token - Balance: <span id="balance2"></span> - <a href="https://quickswap.exchange/#/swap?exactField=input&outputCurrency=0x6531547b44784dDD8A934fB9fEB92ba582dfeD15&swapIndex=0¤cy0=ETH" target="_blank">Trade PopCorn</a> - Contract: <a href="https://polygonscan.com/address/0x6531547b44784dDD8A934fB9fEB92ba582dfeD15" target="_blank">0x6531547b44784dDD8A934fB9fEB92ba582dfeD15</a>
</div>
<div style="white-space: nowrap; animation: scroll3 25s linear infinite;" class="marquee">
Butter Token - Balance: <span id="balance3"></span> - <a href="https://quickswap.exchange/#/swap?exactField=input&outputCurrency=0x409e02e728418501720d7b1e5d7328ac461ecaae&swapIndex=0¤cy0=ETH" target="_blank">Trade Butter</a> - Contract: <a href="https://polygonscan.com/address/0x409e02e728418501720d7b1e5d7328ac461ecaae" target="_blank">0x409e02e728418501720d7b1e5d7328ac461ecaae</a>
</div>
</div>
</div>
<br>
<script>
function toggleMarquee() {
const isChecked = document.getElementById('toggle-marquee').checked;
const marquees = document.querySelectorAll('.marquee');
if (isChecked) {
marquees.forEach(m => {
m.style.animation = 'none';
m.style.display = 'inline'; // Center the text
});
} else {
marquees.forEach((m, index) => {
m.style.animation = `scroll${index + 1} ${20 + index * 5}s linear infinite`;
m.style.display = 'block'; // Reset to block for scrolling
});
}
}
</script>
<script src="https://widgets.coingecko.com/gecko-coin-price-static-headline-widget.js"></script>
<gecko-coin-price-static-headline-widget locale="en" transparent-background="true" coin-ids="bitcoin,ethereum,chainlink,milady-cult-coin,curve-dao-token,aavegotchi,heheh" initial-currency="usd"></gecko-coin-price-static-headline-widget>
<style>
@keyframes scroll1 {
from { transform: translateX(100%); }
to { transform: translateX(-100%); }
}
@keyframes scroll2 {
from { transform: translateX(100%); }
to { transform: translateX(-100%); }
}
@keyframes scroll3 {
from { transform: translateX(100%); }
to { transform: translateX(-100%); }
}
</style>
</a>
<font size="2" style="font-size: 150%"><br><center>
Thank you for coming to my website. Please full port Corn Kernels at your earliest convenience.<br>
If you really want to support, consider burning corn kernels for popcorn.<br>
You can also trade popcorn for NFTs if you want to.
<br>
</font>
</center>
</p>
<hr>
<font size="4">
<p>If you have any comments about our WEB page, you can write us at the address shown above.
However, due to the limited number of personnel in our corporate office, we are unable to
provide a direct response.</p>
</font>
<hr>
<dl>
<p align="left"><font size="4"><a href="index.html">Main Page</a></p> <img src="images/tyler.png" alt="Oh...I see" style="width:150px;height:150px;"><br>
<a class="twitter-follow-button"
href="https://twitter.com/itsTylerIRL">
Follow @itsTylerIRL</a>
<br>
<p align="left">Copyright © 2025 <b>CornHub Intl Inc.</b></font></p>
</dl>
<br>
<div class="affiliated-projects"></div>
<div class="project-grid">
<div class="project-item">
<a href="https://misctyler.github.io/CornHub/oracle"><img src="images/moeda.png" alt="CornHub" style="width:50px;height:50px;"></a>
</div>
<div class="project-item">
<a href="https://cult.inc"><img src="images/cult.png" alt="Milady Cult Coin" style="width:50px;height:50px;"></a>
</div>
<div class="project-item">
<a href="https://radbro.xyz"><img src="images/radbro.png" alt="Radbro Webring" style="width:50px;height:50px;"></a>
</div>
<div class="project-item">
<a href="https://heheh.finance"><img src="images/heheh.gif" alt="Heheh Finance" style="width:50px;height:50px;"></a>
</div>
<div class="project-item">
<a href="https://dapp.aavegotchi.com"><img src="images/gotchi.png" alt="Aavegotchi" style="width:50px;height:50px;"></a>
</div>
</div>
</div>
<style>
.affiliated-projects {
text-align: center;
margin: 20px 0;
}
.project-grid {
display: flex;
justify-content: center;
gap: 20px;
margin: 10px 0;
}
.project-item {
display: flex;
flex-direction: column;
align-items: center;
gap: 5px;
}
</style><br>
</body>
</html>