Spaces:
Running
Running
Add 1 files
Browse files- index.html +224 -50
index.html
CHANGED
@@ -142,6 +142,25 @@
|
|
142 |
position: absolute;
|
143 |
top: -3px;
|
144 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
145 |
</style>
|
146 |
</head>
|
147 |
<body class="bg-gray-900 text-white min-h-screen">
|
@@ -314,7 +333,7 @@
|
|
314 |
</div>
|
315 |
<div class="flex justify-between text-xs text-gray-400 mt-1">
|
316 |
<span>84% complete</span>
|
317 |
-
<span>≈ 12 min remaining</span>
|
318 |
</div>
|
319 |
</div>
|
320 |
</div>
|
@@ -369,21 +388,6 @@
|
|
369 |
<div class="bg-gray-700 rounded-lg p-6 h-full">
|
370 |
<h3 class="text-lg font-medium mb-4">Quick Start</h3>
|
371 |
<div class="space-y-4">
|
372 |
-
<div class="bg-gray-800 p-4 rounded-lg">
|
373 |
-
<div class="flex items-start">
|
374 |
-
<div class="flex-shrink-0 bg-bch-primary bg-opacity-20 p-2 rounded-full">
|
375 |
-
<i class="fas fa-download text-bch-primary"></i>
|
376 |
-
</div>
|
377 |
-
<div class="ml-3">
|
378 |
-
<h4 class="text-sm font-medium">Download Miner</h4>
|
379 |
-
<p class="text-xs text-gray-400 mt-1">Get the latest version of our optimized miner</p>
|
380 |
-
</div>
|
381 |
-
</div>
|
382 |
-
<button class="mt-3 gradient-bg text-white text-sm px-3 py-1.5 rounded-md font-medium w-full">
|
383 |
-
Download Now
|
384 |
-
</button>
|
385 |
-
</div>
|
386 |
-
|
387 |
<div class="bg-gray-800 p-4 rounded-lg">
|
388 |
<div class="flex items-start">
|
389 |
<div class="flex-shrink-0 bg-purple-500 bg-opacity-20 p-2 rounded-full">
|
@@ -403,6 +407,14 @@
|
|
403 |
<input id="secondaryMinerPayout" type="checkbox" class="h-4 w-4 text-bch-primary focus:ring-bch-primary border-gray-600 rounded" checked>
|
404 |
<label for="secondaryMinerPayout" class="ml-2 block text-xs text-gray-300">Include Secondary Miner</label>
|
405 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
406 |
</div>
|
407 |
</div>
|
408 |
|
@@ -420,11 +432,36 @@
|
|
420 |
<input type="text" id="secondaryMinerUrl" class="bg-gray-700 p-2 rounded-md text-xs w-full" placeholder="Pool URL (e.g., stratum+tcp://pool.example.com:3333)">
|
421 |
<input type="text" id="secondaryMinerUser" class="bg-gray-700 p-2 rounded-md text-xs w-full" placeholder="Username">
|
422 |
<input type="password" id="secondaryMinerPass" class="bg-gray-700 p-2 rounded-md text-xs w-full" placeholder="Password">
|
|
|
|
|
|
|
|
|
423 |
</div>
|
424 |
<button id="connectSecondaryMiner" class="mt-2 gradient-bg text-white text-sm px-3 py-1.5 rounded-md font-medium w-full">
|
425 |
Connect Miner
|
426 |
</button>
|
427 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
428 |
</div>
|
429 |
</div>
|
430 |
</div>
|
@@ -449,10 +486,11 @@
|
|
449 |
<i class="fas fa-wallet text-bch-primary"></i>
|
450 |
</div>
|
451 |
<div class="ml-3 flex-grow">
|
452 |
-
<input type="text" value="bitcoincash:qz27vk58s8dgs9q0wpegn0pz4v7khe5g5w5w5w5w5w" class="bg-gray-700 p-2 rounded-md text-xs font-mono w-full mb-2">
|
|
|
453 |
<div class="flex items-center">
|
454 |
<span class="text-xs text-gray-400 mr-2">Payout %:</span>
|
455 |
-
<input type="number" min="0" max="100" value="
|
456 |
<span class="text-xs text-gray-400 ml-1">%</span>
|
457 |
<button class="ml-auto text-red-400 hover:text-red-300 text-xs">
|
458 |
<i class="fas fa-trash-alt"></i> Remove
|
@@ -469,10 +507,11 @@
|
|
469 |
<i class="fas fa-wallet text-purple-400"></i>
|
470 |
</div>
|
471 |
<div class="ml-3 flex-grow">
|
472 |
-
<input type="text" value="bitcoincash:qp4k8fjt6u8f9d5z2x3c4v5b6n7m8k9l0" class="bg-gray-700 p-2 rounded-md text-xs font-mono w-full mb-2">
|
|
|
473 |
<div class="flex items-center">
|
474 |
<span class="text-xs text-gray-400 mr-2">Payout %:</span>
|
475 |
-
<input type="number" min="0" max="100" value="
|
476 |
<span class="text-xs text-gray-400 ml-1">%</span>
|
477 |
<button class="ml-auto text-red-400 hover:text-red-300 text-xs">
|
478 |
<i class="fas fa-trash-alt"></i> Remove
|
@@ -489,10 +528,11 @@
|
|
489 |
<i class="fas fa-wallet text-blue-400"></i>
|
490 |
</div>
|
491 |
<div class="ml-3 flex-grow">
|
492 |
-
<input type="text" value="bitcoincash:qr9v8w7x6y5z4u3v2w1x0y9z8u7v6w5x4" class="bg-gray-700 p-2 rounded-md text-xs font-mono w-full mb-2">
|
|
|
493 |
<div class="flex items-center">
|
494 |
<span class="text-xs text-gray-400 mr-2">Payout %:</span>
|
495 |
-
<input type="number" min="0" max="100" value="
|
496 |
<span class="text-xs text-gray-400 ml-1">%</span>
|
497 |
<button class="ml-auto text-red-400 hover:text-red-300 text-xs">
|
498 |
<i class="fas fa-trash-alt"></i> Remove
|
@@ -599,18 +639,95 @@
|
|
599 |
</div>
|
600 |
</div>
|
601 |
|
602 |
-
<!-- Earnings
|
603 |
-
<div class="
|
604 |
-
|
605 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
606 |
</div>
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
614 |
</div>
|
615 |
</div>
|
616 |
</div>
|
@@ -768,7 +885,49 @@
|
|
768 |
// Simulate hashrate fluctuations and difficulty adjustments
|
769 |
let currentDifficulty = 0.5; // 0-1 scale
|
770 |
let nextBlockDifficulty = 0.6;
|
771 |
-
let blockCompletion =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
772 |
|
773 |
setInterval(() => {
|
774 |
if (isMining) {
|
@@ -778,6 +937,11 @@
|
|
778 |
const newHashrate = (currentHashrate + (Math.random() * 0.2 - 0.1)).toFixed(2);
|
779 |
stats[0].textContent = `${Math.max(0.8, newHashrate)} TH/s`;
|
780 |
|
|
|
|
|
|
|
|
|
|
|
781 |
const currentEfficiency = parseFloat(stats[2].textContent);
|
782 |
const newEfficiency = (currentEfficiency + (Math.random() * 1 - 0.5)).toFixed(1);
|
783 |
stats[2].textContent = `${Math.max(95, newEfficiency)}%`;
|
@@ -792,18 +956,6 @@
|
|
792 |
}
|
793 |
});
|
794 |
|
795 |
-
// Update block progress
|
796 |
-
blockCompletion += Math.random() * 2;
|
797 |
-
if (blockCompletion > 100) {
|
798 |
-
blockCompletion = 0;
|
799 |
-
// Switch to next block's difficulty
|
800 |
-
currentDifficulty = nextBlockDifficulty;
|
801 |
-
// Calculate new difficulty for next block
|
802 |
-
nextBlockDifficulty = Math.min(1, Math.max(0, currentDifficulty + (Math.random() * 0.2 - 0.1)));
|
803 |
-
}
|
804 |
-
|
805 |
-
document.querySelector('.mining-animation .gradient-bg').style.width = `${blockCompletion}%`;
|
806 |
-
|
807 |
// Update difficulty indicators
|
808 |
const difficultyMarkers = document.querySelectorAll('.difficulty-marker');
|
809 |
difficultyMarkers.forEach(marker => {
|
@@ -820,6 +972,17 @@
|
|
820 |
difficultyText.textContent = 'Current difficulty: High';
|
821 |
}
|
822 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
823 |
}
|
824 |
}, 3000);
|
825 |
|
@@ -829,6 +992,12 @@
|
|
829 |
const saveWalletAddresses = document.getElementById('saveWalletAddresses');
|
830 |
|
831 |
addWalletAddress.addEventListener('click', function() {
|
|
|
|
|
|
|
|
|
|
|
|
|
832 |
const newAddress = document.createElement('div');
|
833 |
newAddress.className = 'address-row px-6 py-4';
|
834 |
newAddress.innerHTML = `
|
@@ -837,7 +1006,8 @@
|
|
837 |
<i class="fas fa-wallet text-yellow-400"></i>
|
838 |
</div>
|
839 |
<div class="ml-3 flex-grow">
|
840 |
-
<input type="text" placeholder="
|
|
|
841 |
<div class="flex items-center">
|
842 |
<span class="text-xs text-gray-400 mr-2">Payout %:</span>
|
843 |
<input type="number" min="0" max="100" value="0" class="bg-gray-700 p-1 rounded-md text-xs w-16 text-center">
|
@@ -872,10 +1042,11 @@
|
|
872 |
|
873 |
document.querySelectorAll('.address-row').forEach(row => {
|
874 |
const address = row.querySelector('input[type="text"]').value;
|
|
|
875 |
const percentage = parseInt(row.querySelector('input[type="number"]').value);
|
876 |
|
877 |
if (address) {
|
878 |
-
addresses.push({ address, percentage });
|
879 |
totalPercentage += percentage;
|
880 |
}
|
881 |
});
|
@@ -890,7 +1061,8 @@
|
|
890 |
return;
|
891 |
}
|
892 |
|
893 |
-
alert('Wallet addresses and payout percentages saved successfully
|
|
|
894 |
// In a real app, you would send this to your backend
|
895 |
});
|
896 |
|
@@ -900,9 +1072,11 @@
|
|
900 |
connectSecondaryMiner.addEventListener('click', function() {
|
901 |
const poolUrl = document.getElementById('secondaryMinerUrl').value;
|
902 |
const username = document.getElementById('secondaryMinerUser').value;
|
|
|
903 |
|
904 |
if (poolUrl && username) {
|
905 |
-
|
|
|
906 |
// In a real app, you would initiate the connection here
|
907 |
} else {
|
908 |
alert('Please enter both Pool URL and Username');
|
|
|
142 |
position: absolute;
|
143 |
top: -3px;
|
144 |
}
|
145 |
+
|
146 |
+
.countdown-timer {
|
147 |
+
font-family: monospace;
|
148 |
+
font-size: 1.1rem;
|
149 |
+
}
|
150 |
+
|
151 |
+
.storage-capacity {
|
152 |
+
height: 8px;
|
153 |
+
background-color: #1F2937;
|
154 |
+
border-radius: 4px;
|
155 |
+
overflow: hidden;
|
156 |
+
}
|
157 |
+
|
158 |
+
.storage-used {
|
159 |
+
height: 100%;
|
160 |
+
background-color: #3B82F6;
|
161 |
+
border-radius: 4px;
|
162 |
+
transition: width 0.5s ease;
|
163 |
+
}
|
164 |
</style>
|
165 |
</head>
|
166 |
<body class="bg-gray-900 text-white min-h-screen">
|
|
|
333 |
</div>
|
334 |
<div class="flex justify-between text-xs text-gray-400 mt-1">
|
335 |
<span>84% complete</span>
|
336 |
+
<span class="countdown-timer">≈ 12:45 min remaining</span>
|
337 |
</div>
|
338 |
</div>
|
339 |
</div>
|
|
|
388 |
<div class="bg-gray-700 rounded-lg p-6 h-full">
|
389 |
<h3 class="text-lg font-medium mb-4">Quick Start</h3>
|
390 |
<div class="space-y-4">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
391 |
<div class="bg-gray-800 p-4 rounded-lg">
|
392 |
<div class="flex items-start">
|
393 |
<div class="flex-shrink-0 bg-purple-500 bg-opacity-20 p-2 rounded-full">
|
|
|
407 |
<input id="secondaryMinerPayout" type="checkbox" class="h-4 w-4 text-bch-primary focus:ring-bch-primary border-gray-600 rounded" checked>
|
408 |
<label for="secondaryMinerPayout" class="ml-2 block text-xs text-gray-300">Include Secondary Miner</label>
|
409 |
</div>
|
410 |
+
<div class="mt-2">
|
411 |
+
<label class="block text-xs font-medium text-gray-400 mb-1">Payout Mode</label>
|
412 |
+
<select class="bg-gray-700 border border-gray-600 text-white text-xs rounded-md focus:ring-bch-primary focus:border-bch-primary block w-full p-2">
|
413 |
+
<option selected>Every Block (Solo Mining)</option>
|
414 |
+
<option>Pool Recommended Interval</option>
|
415 |
+
<option>Custom Interval</option>
|
416 |
+
</select>
|
417 |
+
</div>
|
418 |
</div>
|
419 |
</div>
|
420 |
|
|
|
432 |
<input type="text" id="secondaryMinerUrl" class="bg-gray-700 p-2 rounded-md text-xs w-full" placeholder="Pool URL (e.g., stratum+tcp://pool.example.com:3333)">
|
433 |
<input type="text" id="secondaryMinerUser" class="bg-gray-700 p-2 rounded-md text-xs w-full" placeholder="Username">
|
434 |
<input type="password" id="secondaryMinerPass" class="bg-gray-700 p-2 rounded-md text-xs w-full" placeholder="Password">
|
435 |
+
<div class="flex items-center mt-1">
|
436 |
+
<input id="soloMiningToggle" type="checkbox" class="h-4 w-4 text-bch-primary focus:ring-bch-primary border-gray-600 rounded">
|
437 |
+
<label for="soloMiningToggle" class="ml-2 block text-xs text-gray-300">Solo Mining Mode</label>
|
438 |
+
</div>
|
439 |
</div>
|
440 |
<button id="connectSecondaryMiner" class="mt-2 gradient-bg text-white text-sm px-3 py-1.5 rounded-md font-medium w-full">
|
441 |
Connect Miner
|
442 |
</button>
|
443 |
</div>
|
444 |
+
|
445 |
+
<div class="bg-gray-800 p-4 rounded-lg">
|
446 |
+
<div class="flex items-start">
|
447 |
+
<div class="flex-shrink-0 bg-yellow-500 bg-opacity-20 p-2 rounded-full">
|
448 |
+
<i class="fas fa-sd-card text-yellow-400"></i>
|
449 |
+
</div>
|
450 |
+
<div class="ml-3">
|
451 |
+
<h4 class="text-sm font-medium">Storage Capacity</h4>
|
452 |
+
<p class="text-xs text-gray-400 mt-1">SD Card mining storage</p>
|
453 |
+
</div>
|
454 |
+
</div>
|
455 |
+
<div class="mt-3">
|
456 |
+
<div class="storage-capacity">
|
457 |
+
<div class="storage-used" style="width: 65%"></div>
|
458 |
+
</div>
|
459 |
+
<div class="flex justify-between text-xs text-gray-400 mt-1">
|
460 |
+
<span>32.5 GB used</span>
|
461 |
+
<span>50 GB total</span>
|
462 |
+
</div>
|
463 |
+
</div>
|
464 |
+
</div>
|
465 |
</div>
|
466 |
</div>
|
467 |
</div>
|
|
|
486 |
<i class="fas fa-wallet text-bch-primary"></i>
|
487 |
</div>
|
488 |
<div class="ml-3 flex-grow">
|
489 |
+
<input type="text" value="bitcoincash:qz27vk58s8dgs9q0wpegn0pz4v7khe5g5w5w5w5w5w" class="bg-gray-700 p-2 rounded-md text-xs font-mono w-full mb-2" placeholder="BCH Address">
|
490 |
+
<input type="text" value="miner_user1" class="bg-gray-700 p-2 rounded-md text-xs w-full mb-2" placeholder="Pool Username">
|
491 |
<div class="flex items-center">
|
492 |
<span class="text-xs text-gray-400 mr-2">Payout %:</span>
|
493 |
+
<input type="number" min="0" max="100" value="60" class="bg-gray-700 p-1 rounded-md text-xs w-16 text-center">
|
494 |
<span class="text-xs text-gray-400 ml-1">%</span>
|
495 |
<button class="ml-auto text-red-400 hover:text-red-300 text-xs">
|
496 |
<i class="fas fa-trash-alt"></i> Remove
|
|
|
507 |
<i class="fas fa-wallet text-purple-400"></i>
|
508 |
</div>
|
509 |
<div class="ml-3 flex-grow">
|
510 |
+
<input type="text" value="bitcoincash:qp4k8fjt6u8f9d5z2x3c4v5b6n7m8k9l0" class="bg-gray-700 p-2 rounded-md text-xs font-mono w-full mb-2" placeholder="BCH Address">
|
511 |
+
<input type="text" value="miner_user2" class="bg-gray-700 p-2 rounded-md text-xs w-full mb-2" placeholder="Pool Username">
|
512 |
<div class="flex items-center">
|
513 |
<span class="text-xs text-gray-400 mr-2">Payout %:</span>
|
514 |
+
<input type="number" min="0" max="100" value="30" class="bg-gray-700 p-1 rounded-md text-xs w-16 text-center">
|
515 |
<span class="text-xs text-gray-400 ml-1">%</span>
|
516 |
<button class="ml-auto text-red-400 hover:text-red-300 text-xs">
|
517 |
<i class="fas fa-trash-alt"></i> Remove
|
|
|
528 |
<i class="fas fa-wallet text-blue-400"></i>
|
529 |
</div>
|
530 |
<div class="ml-3 flex-grow">
|
531 |
+
<input type="text" value="bitcoincash:qr9v8w7x6y5z4u3v2w1x0y9z8u7v6w5x4" class="bg-gray-700 p-2 rounded-md text-xs font-mono w-full mb-2" placeholder="BCH Address">
|
532 |
+
<input type="text" value="miner_user3" class="bg-gray-700 p-2 rounded-md text-xs w-full mb-2" placeholder="Pool Username">
|
533 |
<div class="flex items-center">
|
534 |
<span class="text-xs text-gray-400 mr-2">Payout %:</span>
|
535 |
+
<input type="number" min="0" max="100" value="10" class="bg-gray-700 p-1 rounded-md text-xs w-16 text-center">
|
536 |
<span class="text-xs text-gray-400 ml-1">%</span>
|
537 |
<button class="ml-auto text-red-400 hover:text-red-300 text-xs">
|
538 |
<i class="fas fa-trash-alt"></i> Remove
|
|
|
639 |
</div>
|
640 |
</div>
|
641 |
|
642 |
+
<!-- Block Tracking & Earnings -->
|
643 |
+
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6 mb-8">
|
644 |
+
<!-- Current Block Tracking -->
|
645 |
+
<div class="bg-gray-800 rounded-lg shadow overflow-hidden">
|
646 |
+
<div class="px-6 py-4 border-b border-gray-700">
|
647 |
+
<h2 class="text-lg font-semibold">Current Block Tracking</h2>
|
648 |
+
</div>
|
649 |
+
<div class="p-6">
|
650 |
+
<div class="grid grid-cols-3 gap-4 mb-4">
|
651 |
+
<div class="bg-gray-700 p-3 rounded-lg">
|
652 |
+
<p class="text-gray-400 text-sm">Block Height</p>
|
653 |
+
<p class="text-xl font-mono">792,451</p>
|
654 |
+
</div>
|
655 |
+
<div class="bg-gray-700 p-3 rounded-lg">
|
656 |
+
<p class="text-gray-400 text-sm">Shares Found</p>
|
657 |
+
<p class="text-xl font-mono">1,284</p>
|
658 |
+
</div>
|
659 |
+
<div class="bg-gray-700 p-3 rounded-lg">
|
660 |
+
<p class="text-gray-400 text-sm">Efficiency</p>
|
661 |
+
<p class="text-xl font-mono">98.7%</p>
|
662 |
+
</div>
|
663 |
+
</div>
|
664 |
+
|
665 |
+
<div class="mb-4">
|
666 |
+
<div class="flex justify-between text-sm text-gray-400 mb-1">
|
667 |
+
<span>Block Progress</span>
|
668 |
+
<span>84% complete</span>
|
669 |
+
</div>
|
670 |
+
<div class="w-full bg-gray-600 rounded-full h-2.5">
|
671 |
+
<div class="gradient-bg h-2.5 rounded-full" style="width: 84%"></div>
|
672 |
+
</div>
|
673 |
+
<div class="flex justify-between text-xs text-gray-400 mt-1">
|
674 |
+
<span>Estimated completion</span>
|
675 |
+
<span class="countdown-timer">12:45 min remaining</span>
|
676 |
+
</div>
|
677 |
+
</div>
|
678 |
+
|
679 |
+
<div>
|
680 |
+
<div class="flex justify-between text-sm text-gray-400 mb-1">
|
681 |
+
<span>Next Block Difficulty</span>
|
682 |
+
<span>+8.5% increase</span>
|
683 |
+
</div>
|
684 |
+
<div class="w-full bg-gray-600 rounded-full h-2.5">
|
685 |
+
<div class="gradient-bg h-2.5 rounded-full" style="width: 65%"></div>
|
686 |
+
</div>
|
687 |
+
<div class="flex justify-between text-xs text-gray-400 mt-1">
|
688 |
+
<span>Based on 3 miners</span>
|
689 |
+
<span>Avg block time: 15.2 min</span>
|
690 |
+
</div>
|
691 |
+
</div>
|
692 |
+
</div>
|
693 |
</div>
|
694 |
+
|
695 |
+
<!-- Earnings Chart -->
|
696 |
+
<div class="bg-gray-800 rounded-lg shadow overflow-hidden">
|
697 |
+
<div class="px-6 py-4 border-b border-gray-700">
|
698 |
+
<h2 class="text-lg font-semibold">Earnings Overview</h2>
|
699 |
+
</div>
|
700 |
+
<div class="p-6">
|
701 |
+
<div class="h-64 mb-4">
|
702 |
+
<!-- Chart placeholder - in a real app you would use Chart.js or similar -->
|
703 |
+
<div class="bg-gray-700 rounded-lg flex items-center justify-center h-full">
|
704 |
+
<div class="text-center">
|
705 |
+
<i class="fas fa-chart-line text-4xl text-gray-500 mb-2"></i>
|
706 |
+
<p class="text-gray-400">Earnings chart will be displayed here</p>
|
707 |
+
</div>
|
708 |
+
</div>
|
709 |
+
</div>
|
710 |
+
|
711 |
+
<div class="grid grid-cols-2 gap-4">
|
712 |
+
<div class="bg-gray-700 p-3 rounded-lg">
|
713 |
+
<p class="text-gray-400 text-sm">Estimated Payout</p>
|
714 |
+
<p class="text-xl font-mono">0.0128 BCH</p>
|
715 |
+
<p class="text-xs text-gray-400 mt-1">≈ $3.78 USD</p>
|
716 |
+
</div>
|
717 |
+
<div class="bg-gray-700 p-3 rounded-lg">
|
718 |
+
<p class="text-gray-400 text-sm">Next Payout In</p>
|
719 |
+
<p class="text-xl font-mono countdown-timer">12:45 min</p>
|
720 |
+
<p class="text-xs text-gray-400 mt-1">Block 792,451</p>
|
721 |
+
</div>
|
722 |
+
</div>
|
723 |
+
|
724 |
+
<div class="mt-4">
|
725 |
+
<div class="flex justify-between text-sm text-gray-400 mb-1">
|
726 |
+
<span>Storage Usage</span>
|
727 |
+
<span>32.5/50 GB (65%)</span>
|
728 |
+
</div>
|
729 |
+
<div class="storage-capacity">
|
730 |
+
<div class="storage-used" style="width: 65%"></div>
|
731 |
</div>
|
732 |
</div>
|
733 |
</div>
|
|
|
885 |
// Simulate hashrate fluctuations and difficulty adjustments
|
886 |
let currentDifficulty = 0.5; // 0-1 scale
|
887 |
let nextBlockDifficulty = 0.6;
|
888 |
+
let blockCompletion = 84;
|
889 |
+
let remainingTime = 12 * 60 + 45; // 12 minutes 45 seconds in seconds
|
890 |
+
|
891 |
+
// Countdown timer function
|
892 |
+
function updateCountdown() {
|
893 |
+
if (isMining && blockCompletion < 100) {
|
894 |
+
remainingTime--;
|
895 |
+
|
896 |
+
if (remainingTime <= 0) {
|
897 |
+
// Block completed, reset for next block
|
898 |
+
blockCompletion = 0;
|
899 |
+
remainingTime = Math.floor(15 * 60 * (1 + Math.random() * 0.2 - 0.1)); // Random block time around 15 minutes
|
900 |
+
|
901 |
+
// Switch to next block's difficulty
|
902 |
+
currentDifficulty = nextBlockDifficulty;
|
903 |
+
// Calculate new difficulty for next block based on miners and block time
|
904 |
+
const minerCount = 3; // From active workers
|
905 |
+
const avgBlockTime = 15.2; // In minutes
|
906 |
+
const difficultyAdjustment = (minerCount / 3) * (15 / avgBlockTime);
|
907 |
+
nextBlockDifficulty = Math.min(1, Math.max(0, currentDifficulty * difficultyAdjustment * (1 + Math.random() * 0.1 - 0.05)));
|
908 |
+
}
|
909 |
+
|
910 |
+
// Update block completion
|
911 |
+
blockCompletion = 100 - (remainingTime / (15 * 60)) * 100;
|
912 |
+
document.querySelector('.mining-animation .gradient-bg').style.width = `${blockCompletion}%`;
|
913 |
+
document.querySelector('.mining-animation .countdown-timer').textContent = `≈ ${Math.floor(remainingTime / 60)}:${(remainingTime % 60).toString().padStart(2, '0')} min remaining`;
|
914 |
+
|
915 |
+
// Update block tracking section
|
916 |
+
document.querySelectorAll('.countdown-timer').forEach(el => {
|
917 |
+
el.textContent = `${Math.floor(remainingTime / 60)}:${(remainingTime % 60).toString().padStart(2, '0')} min remaining`;
|
918 |
+
});
|
919 |
+
|
920 |
+
// Update next block difficulty indicator
|
921 |
+
const nextDifficultyPos = Math.floor(nextBlockDifficulty * 100);
|
922 |
+
document.querySelectorAll('.gradient-bg').forEach(el => {
|
923 |
+
if (el.parentElement.classList.contains('bg-gray-600') && !el.parentElement.classList.contains('storage-capacity')) {
|
924 |
+
el.style.width = `${nextDifficultyPos}%`;
|
925 |
+
}
|
926 |
+
});
|
927 |
+
}
|
928 |
+
}
|
929 |
+
|
930 |
+
setInterval(updateCountdown, 1000);
|
931 |
|
932 |
setInterval(() => {
|
933 |
if (isMining) {
|
|
|
937 |
const newHashrate = (currentHashrate + (Math.random() * 0.2 - 0.1)).toFixed(2);
|
938 |
stats[0].textContent = `${Math.max(0.8, newHashrate)} TH/s`;
|
939 |
|
940 |
+
// Update shares found (more active when closer to block completion)
|
941 |
+
const currentShares = parseInt(stats[1].textContent.replace(/,/g, ''));
|
942 |
+
const shareIncrease = Math.floor(5 + (blockCompletion / 100) * 20 * Math.random());
|
943 |
+
stats[1].textContent = (currentShares + shareIncrease).toLocaleString();
|
944 |
+
|
945 |
const currentEfficiency = parseFloat(stats[2].textContent);
|
946 |
const newEfficiency = (currentEfficiency + (Math.random() * 1 - 0.5)).toFixed(1);
|
947 |
stats[2].textContent = `${Math.max(95, newEfficiency)}%`;
|
|
|
956 |
}
|
957 |
});
|
958 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
959 |
// Update difficulty indicators
|
960 |
const difficultyMarkers = document.querySelectorAll('.difficulty-marker');
|
961 |
difficultyMarkers.forEach(marker => {
|
|
|
972 |
difficultyText.textContent = 'Current difficulty: High';
|
973 |
}
|
974 |
});
|
975 |
+
|
976 |
+
// Update estimated payout based on hashrate and shares
|
977 |
+
const estimatedPayout = (0.0001 * currentHashrate * (1 + blockCompletion / 100)).toFixed(4);
|
978 |
+
document.querySelectorAll('.text-xl.font-mono').forEach(el => {
|
979 |
+
if (el.textContent.includes('BCH') && !el.textContent.includes('792,451')) {
|
980 |
+
el.textContent = `${estimatedPayout} BCH`;
|
981 |
+
// Update USD equivalent
|
982 |
+
const usdEquivalent = (parseFloat(estimatedPayout) * 295).toFixed(2); // Assuming $295/BCH
|
983 |
+
el.nextElementSibling.textContent = `≈ $${usdEquivalent} USD`;
|
984 |
+
}
|
985 |
+
});
|
986 |
}
|
987 |
}, 3000);
|
988 |
|
|
|
992 |
const saveWalletAddresses = document.getElementById('saveWalletAddresses');
|
993 |
|
994 |
addWalletAddress.addEventListener('click', function() {
|
995 |
+
// Check if we already have 3 addresses
|
996 |
+
if (document.querySelectorAll('.address-row').length >= 3) {
|
997 |
+
alert('Maximum of 3 wallet addresses allowed');
|
998 |
+
return;
|
999 |
+
}
|
1000 |
+
|
1001 |
const newAddress = document.createElement('div');
|
1002 |
newAddress.className = 'address-row px-6 py-4';
|
1003 |
newAddress.innerHTML = `
|
|
|
1006 |
<i class="fas fa-wallet text-yellow-400"></i>
|
1007 |
</div>
|
1008 |
<div class="ml-3 flex-grow">
|
1009 |
+
<input type="text" placeholder="BCH Address" class="bg-gray-700 p-2 rounded-md text-xs font-mono w-full mb-2">
|
1010 |
+
<input type="text" placeholder="Pool Username" class="bg-gray-700 p-2 rounded-md text-xs w-full mb-2">
|
1011 |
<div class="flex items-center">
|
1012 |
<span class="text-xs text-gray-400 mr-2">Payout %:</span>
|
1013 |
<input type="number" min="0" max="100" value="0" class="bg-gray-700 p-1 rounded-md text-xs w-16 text-center">
|
|
|
1042 |
|
1043 |
document.querySelectorAll('.address-row').forEach(row => {
|
1044 |
const address = row.querySelector('input[type="text"]').value;
|
1045 |
+
const username = row.querySelectorAll('input[type="text"]')[1].value;
|
1046 |
const percentage = parseInt(row.querySelector('input[type="number"]').value);
|
1047 |
|
1048 |
if (address) {
|
1049 |
+
addresses.push({ address, username, percentage });
|
1050 |
totalPercentage += percentage;
|
1051 |
}
|
1052 |
});
|
|
|
1061 |
return;
|
1062 |
}
|
1063 |
|
1064 |
+
alert('Wallet addresses and payout percentages saved successfully!\n\nPayout distribution:\n' +
|
1065 |
+
addresses.map(a => `${a.address} (${a.username}): ${a.percentage}%`).join('\n'));
|
1066 |
// In a real app, you would send this to your backend
|
1067 |
});
|
1068 |
|
|
|
1072 |
connectSecondaryMiner.addEventListener('click', function() {
|
1073 |
const poolUrl = document.getElementById('secondaryMinerUrl').value;
|
1074 |
const username = document.getElementById('secondaryMinerUser').value;
|
1075 |
+
const isSolo = document.getElementById('soloMiningToggle').checked;
|
1076 |
|
1077 |
if (poolUrl && username) {
|
1078 |
+
const mode = isSolo ? 'SOLO mining mode' : 'POOL mining mode';
|
1079 |
+
alert(`Connecting secondary miner to:\n${poolUrl}\nUsername: ${username}\nMode: ${mode}`);
|
1080 |
// In a real app, you would initiate the connection here
|
1081 |
} else {
|
1082 |
alert('Please enter both Pool URL and Username');
|