Spaces:
Running
Running
File size: 43,579 Bytes
ac725a5 4a18745 ac725a5 |
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 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Mining⛏️</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
@keyframes pulse {
0%, 100% { opacity: 1; }
50% { opacity: 0.5; }
}
.pulse-animation {
animation: pulse 2s infinite;
}
.miner-active {
box-shadow: 0 0 15px rgba(59, 130, 246, 0.7);
}
.progress-bar {
transition: width 0.5s ease-in-out;
}
.resource-icon {
transition: all 0.3s ease;
}
.resource-icon:hover {
transform: scale(1.1);
}
.floating {
animation: floating 3s ease-in-out infinite;
}
@keyframes floating {
0% { transform: translateY(0px); }
50% { transform: translateY(-10px); }
100% { transform: translateY(0px); }
}
.crypto-logo {
width: 24px;
height: 24px;
border-radius: 50%;
display: inline-block;
margin-right: 8px;
vertical-align: middle;
}
.coin-selector {
background: rgba(255,255,255,0.1);
border-radius: 20px;
padding: 2px;
display: inline-flex;
}
.coin-option {
padding: 4px 12px;
border-radius: 20px;
cursor: pointer;
transition: all 0.3s ease;
}
.coin-option.active {
background: rgba(59, 130, 246, 0.7);
}
.coin-option:hover:not(.active) {
background: rgba(255,255,255,0.2);
}
.mining-animation {
position: relative;
overflow: hidden;
}
.mining-animation::after {
content: "";
position: absolute;
top: 0;
left: 0;
right: 0;
height: 3px;
background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.7), transparent);
animation: miningGlow 2s infinite;
}
@keyframes miningGlow {
0% { transform: translateX(-100%); }
100% { transform: translateX(100%); }
}
.connect-btn {
position: fixed;
bottom: 6rem;
right: 2rem;
width: 60px;
height: 60px;
border-radius: 50%;
background: linear-gradient(135deg, #3B82F6, #8B5CF6);
box-shadow: 0 4px 15px rgba(59, 130, 246, 0.5);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
z-index: 50;
transition: all 0.3s ease;
}
.connect-btn:hover {
transform: scale(1.1);
box-shadow: 0 6px 20px rgba(59, 130, 246, 0.7);
}
.wallet-input {
background: rgba(255,255,255,0.05);
border: 1px solid rgba(255,255,255,0.1);
transition: all 0.3s ease;
}
.wallet-input:focus {
border-color: #3B82F6;
box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}
.lucky-miner {
background: linear-gradient(135deg, rgba(20, 184, 166, 0.1), rgba(5, 150, 105, 0.1));
border: 1px solid rgba(20, 184, 166, 0.3);
}
.lucky-miner.active {
box-shadow: 0 0 15px rgba(20, 184, 166, 0.7);
}
</style>
</head>
<body class="bg-gray-900 text-white min-h-screen">
<div class="container mx-auto px-4 py-8">
<!-- Header with logo and coin selector -->
<header class="flex flex-col items-center mb-10">
<div class="flex items-center space-x-4 mb-4">
<div class="floating relative">
<div class="absolute -inset-2 bg-blue-500 rounded-full opacity-20 blur"></div>
<img src="https://cryptologos.cc/logos/bitcoin-cash-bch-logo.png" alt="CryptoMiner Pro" class="w-16 h-16">
</div>
<h1 class="text-4xl font-bold bg-gradient-to-r from-blue-400 to-purple-500 bg-clip-text text-transparent">
JVALKENBURG Mining
</h1>
</div>
<p class="text-gray-400 text-center max-w-2xl mb-6">
Advanced cryptocurrency mining operations with Lucky Miner technology
</p>
<div class="coin-selector mb-8">
<div class="coin-option active" onclick="switchCoin('BCH')">
<span class="crypto-logo" style="background-color: #0AC18E;"></span>
BCH
</div>
<div class="coin-option" onclick="switchCoin('FB')">
<span class="crypto-logo" style="background-color: #F7931A;"></span>
FB
</div>
</div>
</header>
<!-- Wallet Address Input -->
<div class="bg-gray-800 rounded-xl p-6 shadow-lg mb-8">
<h2 class="text-xl font-semibold mb-4 flex items-center">
<i class="fas fa-wallet mr-2 text-blue-400"></i> Wallet Configuration
</h2>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<label class="block text-sm font-medium mb-2">BCH Wallet Address</label>
<input type="text" id="bch-wallet" placeholder="bitcoincash:..."
class="w-full px-4 py-2 rounded-lg wallet-input focus:outline-none">
</div>
<div>
<label class="block text-sm font-medium mb-2">FB Wallet Address</label>
<input type="text" id="fb-wallet" placeholder="0x..."
class="w-full px-4 py-2 rounded-lg wallet-input focus:outline-none">
</div>
</div>
<button onclick="saveWalletInfo()" class="mt-4 px-6 py-2 bg-blue-600 hover:bg-blue-500 rounded-lg transition">
Save Wallet Info
</button>
</div>
<!-- Main dashboard -->
<div class="grid grid-cols-1 lg:grid-cols-3 gap-8 mb-10">
<!-- Resources panel -->
<div class="bg-gray-800 rounded-xl p-6 shadow-lg col-span-1">
<h2 class="text-xl font-semibold mb-4 flex items-center">
<i class="fas fa-wallet mr-2 text-blue-400"></i> Wallet Balance
</h2>
<div class="space-y-4">
<div class="flex justify-between items-center p-3 bg-gray-700 rounded-lg">
<div class="flex items-center">
<i class="fab fa-bitcoin text-yellow-400 text-xl mr-3 resource-icon"></i>
<span>Bitcoin Cash (BCH)</span>
</div>
<span class="font-mono" id="bch-count">0</span>
</div>
<div class="flex justify-between items-center p-3 bg-gray-700 rounded-lg">
<div class="flex items-center">
<i class="fas fa-project-diagram text-orange-500 text-xl mr-3 resource-icon"></i>
<span>Fractal Bitcoin (FB)</span>
</div>
<span class="font-mono" id="fb-count">0</span>
</div>
<div class="flex justify-between items-center p-3 bg-gray-700 rounded-lg">
<div class="flex items-center">
<i class="fas fa-bolt text-blue-400 text-xl mr-3 resource-icon"></i>
<span>Mining Power</span>
</div>
<span class="font-mono" id="power-count">0 MH/s</span>
</div>
</div>
<div class="mt-6 bg-gray-700 p-4 rounded-lg">
<h3 class="font-medium mb-2">Estimated Earnings</h3>
<div class="flex justify-between text-sm">
<span>Daily:</span>
<span id="daily-earnings" class="font-mono">0 BCH</span>
</div>
<div class="flex justify-between text-sm">
<span>Weekly:</span>
<span id="weekly-earnings" class="font-mono">0 BCH</span>
</div>
<div class="flex justify-between text-sm">
<span>Monthly:</span>
<span id="monthly-earnings" class="font-mono">0 BCH</span>
</div>
</div>
</div>
<!-- Mining status -->
<div class="bg-gray-800 rounded-xl p-6 shadow-lg col-span-1 lg:col-span-2 mining-animation">
<h2 class="text-xl font-semibold mb-4 flex items-center">
<i class="fas fa-hard-hat mr-2 text-blue-400"></i> Mining Operations
</h2>
<div class="mb-6">
<div class="flex justify-between mb-2">
<span>Mining Progress</span>
<span id="mining-progress-text">0%</span>
</div>
<div class="w-full bg-gray-700 rounded-full h-4">
<div id="mining-progress-bar" class="progress-bar h-4 rounded-full bg-gradient-to-r from-blue-500 to-purple-500" style="width: 0%"></div>
</div>
</div>
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
<div class="bg-gray-700 p-4 rounded-lg">
<div class="flex justify-between items-center mb-2">
<span>Active Miners</span>
<span id="active-miners" class="font-mono">0</span>
</div>
<div class="text-sm text-gray-400">Efficiency: <span id="miner-efficiency">0%</span></div>
</div>
<div class="bg-gray-700 p-4 rounded-lg">
<div class="flex justify-between items-center mb-2">
<span>Hashrate</span>
<span id="hashrate" class="font-mono">0 MH/s</span>
</div>
<div class="text-sm text-gray-400">Shares: <span id="shares">0</span></div>
</div>
<div class="bg-gray-700 p-4 rounded-lg">
<div class="flex justify-between items-center mb-2">
<span>Next Block</span>
<span id="next-block" class="font-mono">--:--</span>
</div>
<div class="text-sm text-gray-400">Difficulty: <span id="difficulty">0</span></div>
</div>
</div>
<div class="mt-6 grid grid-cols-2 gap-4">
<button
id="start-mining-btn"
class="col-span-2 py-3 bg-green-600 hover:bg-green-500 rounded-lg transition flex items-center justify-center"
onclick="toggleMining()">
<i class="fas fa-play mr-2"></i> Start Mining
</button>
</div>
</div>
</div>
<!-- Miners control panel -->
<div class="bg-gray-800 rounded-xl p-6 shadow-lg mb-10">
<h2 class="text-xl font-semibold mb-6 flex items-center">
<i class="fas fa-server mr-2 text-blue-400"></i> Mining Rigs
</h2>
<div class="grid grid-cols-1 lg:grid-cols-2 gap-4">
<!-- Lucky Miner -->
<div id="miner-1" class="bg-gray-700 rounded-lg p-4 transition-all duration-300 lucky-miner">
<div class="flex justify-between items-center mb-3">
<h3 class="font-medium">Lucky Miner Rig #08D9</h3>
<span id="miner-1-status" class="text-xs px-2 py-1 rounded-full bg-gray-600">OFFLINE</span>
</div>
<div class="flex justify-between text-sm text-gray-400 mb-1">
<span>Hashrate:</span>
<span id="miner-1-hashrate">0 MH/s</span>
</div>
<div class="flex justify-between text-sm text-gray-400 mb-3">
<span>Power:</span>
<span id="miner-1-power">0 W</span>
</div>
<div class="flex justify-between text-sm text-gray-400 mb-3">
<span>Luck Bonus:</span>
<span id="miner-1-luck">+25%</span>
</div>
<button
id="miner-1-btn"
class="w-full py-2 rounded-lg bg-gray-600 hover:bg-gray-500 transition"
onclick="toggleMiner(1)">
Activate
</button>
</div>
<!-- Cloud Miner -->
<div id="miner-2" class="bg-gray-700 rounded-lg p-4 transition-all duration-300">
<div class="flex justify-between items-center mb-3">
<h3 class="font-medium">Cloud Miner</h3>
<span id="miner-2-status" class="text-xs px-2 py-1 rounded-full bg-gray-600">OFFLINE</span>
</div>
<div class="flex justify-between text-sm text-gray-400 mb-1">
<span>Hashrate:</span>
<span id="miner-2-hashrate">0 MH/s</span>
</div>
<div class="flex justify-between text-sm text-gray-400 mb-3">
<span>Power:</span>
<span id="miner-2-power">0 W</span>
</div>
<button
id="miner-2-btn"
class="w-full py-2 rounded-lg bg-gray-600 hover:bg-gray-500 transition"
onclick="toggleMiner(2)">
Activate
</button>
</div>
</div>
</div>
<!-- Upgrades and actions -->
<div class="grid grid-cols-1 lg:grid-cols-2 gap-8">
<!-- Upgrades -->
<div class="bg-gray-800 rounded-xl p-6 shadow-lg">
<h2 class="text-xl font-semibold mb-6 flex items-center">
<i class="fas fa-level-up-alt mr-2 text-blue-400"></i> Upgrades
</h2>
<div class="space-y-4">
<div class="flex justify-between items-center p-4 bg-gray-700 rounded-lg">
<div>
<h3 class="font-medium">Hashrate Boost</h3>
<p class="text-sm text-gray-400">Increase hashrate by 25% per miner</p>
</div>
<button
id="hashrate-upgrade-btn"
class="px-4 py-2 bg-blue-600 hover:bg-blue-500 rounded-lg transition disabled:opacity-50"
onclick="buyUpgrade('hashrate')"
disabled>
<span class="font-mono">0.5</span> <i class="fab fa-bitcoin ml-1"></i>
</button>
</div>
<div class="flex justify-between items-center p-4 bg-gray-700 rounded-lg">
<div>
<h3 class="font-medium">Energy Efficiency</h3>
<p class="text-sm text-gray-400">Reduce power consumption by 20%</p>
</div>
<button
id="efficiency-upgrade-btn"
class="px-4 py-2 bg-blue-600 hover:bg-blue-500 rounded-lg transition disabled:opacity-50"
onclick="buyUpgrade('efficiency')"
disabled>
<span class="font-mono">0.75</span> <i class="fab fa-bitcoin ml-1"></i>
</button>
</div>
<div class="flex justify-between items-center p-4 bg-gray-700 rounded-lg">
<div>
<h3 class="font-medium">Cloud Capacity</h3>
<p class="text-sm text-gray-400">Double cloud mining capacity</p>
</div>
<button
id="miner-upgrade-btn"
class="px-4 py-2 bg-blue-600 hover:bg-blue-500 rounded-lg transition disabled:opacity-50"
onclick="buyUpgrade('miner')"
disabled>
<span class="font-mono">1.2</span> <i class="fab fa-bitcoin ml-1"></i>
</button>
</div>
</div>
</div>
<!-- Actions -->
<div class="bg-gray-800 rounded-xl p-6 shadow-lg">
<h2 class="text-xl font-semibold mb-6 flex items-center">
<i class="fas fa-rocket mr-2 text-blue-400"></i> Quick Actions
</h2>
<div class="grid grid-cols-2 gap-4">
<button
id="withdraw-btn"
class="col-span-2 py-3 bg-purple-600 hover:bg-purple-500 rounded-lg transition flex items-center justify-center"
onclick="withdrawFunds()">
<i class="fas fa-wallet mr-2"></i> Withdraw Funds
</button>
<button
class="py-3 bg-green-600 hover:bg-green-500 rounded-lg transition flex items-center justify-center"
onclick="exchangeToBCH()">
<i class="fas fa-exchange-alt mr-2"></i> FB → BCH
</button>
<button
class="py-3 bg-yellow-600 hover:bg-yellow-500 rounded-lg transition flex items-center justify-center"
onclick="exchangeToFB()">
<i class="fas fa-exchange-alt mr-2"></i> BCH → FB
</button>
</div>
<div class="mt-6 p-4 bg-gray-700 rounded-lg">
<h3 class="font-medium mb-2">Market Prices</h3>
<div class="text-sm space-y-2">
<div class="flex justify-between">
<span>1 BCH =</span>
<span id="bch-price">$250.00</span>
</div>
<div class="flex justify-between">
<span>1 FB =</span>
<span id="fb-price">$0.85</span>
</div>
<div class="flex justify-between">
<span>Exchange Rate:</span>
<span>1 BCH = 300 FB</span>
</div>
</div>
</div>
</div>
</div>
<!-- Connect Button -->
<div class="connect-btn" onclick="connectToLuckyMiner()">
<i class="fas fa-plug text-white text-xl"></i>
</div>
<!-- Notifications area -->
<div id="notifications" class="fixed bottom-4 right-4 space-y-2 max-w-xs"></div>
</div>
<script>
// Game state
const state = {
currentCoin: 'BCH', // 'BCH' or 'FB'
wallet: {
BCH: 0,
FB: 0,
power: 0 // in MH/s
},
walletAddresses: {
BCH: '',
FB: ''
},
miners: {
1: {
active: false,
baseHashrate: 100, // MH/s (higher for Lucky Miner)
powerUsage: 800, // W
type: 'Lucky',
luckBonus: 0.25 // 25% bonus
},
2: {
active: false,
baseHashrate: 20,
powerUsage: 0,
type: 'Cloud',
unlocked: true
}
},
upgrades: {
hashrate: { level: 0, cost: 0.5 },
efficiency: { level: 0, cost: 0.75 },
miner: { level: 0, cost: 1.2 }
},
mining: false,
miningProgress: 0,
shares: 0,
difficulty: 1000000,
lastUpdate: Date.now(),
prices: {
BCH: 250.00,
FB: 0.85
},
luckyMinerConnected: false
};
// DOM elements
const elements = {
bchCount: document.getElementById('bch-count'),
fbCount: document.getElementById('fb-count'),
powerCount: document.getElementById('power-count'),
miningProgressBar: document.getElementById('mining-progress-bar'),
miningProgressText: document.getElementById('mining-progress-text'),
activeMiners: document.getElementById('active-miners'),
minerEfficiency: document.getElementById('miner-efficiency'),
hashrate: document.getElementById('hashrate'),
shares: document.getElementById('shares'),
nextBlock: document.getElementById('next-block'),
difficulty: document.getElementById('difficulty'),
dailyEarnings: document.getElementById('daily-earnings'),
weeklyEarnings: document.getElementById('weekly-earnings'),
monthlyEarnings: document.getElementById('monthly-earnings'),
startMiningBtn: document.getElementById('start-mining-btn'),
notifications: document.getElementById('notifications'),
bchPrice: document.getElementById('bch-price'),
fbPrice: document.getElementById('fb-price'),
bchWalletInput: document.getElementById('bch-wallet'),
fbWalletInput: document.getElementById('fb-wallet')
};
// Initialize miner elements
for (let i = 1; i <= 2; i++) {
elements[`miner${i}Status`] = document.getElementById(`miner-${i}-status`);
elements[`miner${i}Btn`] = document.getElementById(`miner-${i}-btn`);
elements[`miner${i}Hashrate`] = document.getElementById(`miner-${i}-hashrate`);
elements[`miner${i}Power`] = document.getElementById(`miner-${i}-power`);
elements[`miner${i}Container`] = document.getElementById(`miner-${i}`);
}
// Special element for Lucky Miner
elements.miner1Luck = document.getElementById('miner-1-luck');
// Upgrade buttons
elements.hashrateUpgradeBtn = document.getElementById('hashrate-upgrade-btn');
elements.efficiencyUpgradeBtn = document.getElementById('efficiency-upgrade-btn');
elements.minerUpgradeBtn = document.getElementById('miner-upgrade-btn');
// Game loop
function gameLoop() {
const now = Date.now();
const deltaTime = (now - state.lastUpdate) / 1000; // in seconds
state.lastUpdate = now;
// Update mining if active
if (state.mining) {
updateMining(deltaTime);
}
// Update UI
updateUI();
// Check for upgrades availability
checkUpgrades();
requestAnimationFrame(gameLoop);
}
function updateMining(deltaTime) {
let activeMiners = 0;
let totalHashrate = 0;
let totalPower = 0;
// Calculate active miners and their rates
for (let i = 1; i <= 2; i++) {
const miner = state.miners[i];
if (miner.active && (i !== 2 || miner.unlocked)) {
activeMiners++;
// Calculate hashrate with upgrades
let hashrate = miner.baseHashrate * (1 + state.upgrades.hashrate.level * 0.25);
// Apply luck bonus for Lucky Miner
if (miner.type === 'Lucky' && state.luckyMinerConnected) {
hashrate *= (1 + miner.luckBonus);
}
totalHashrate += hashrate;
// Calculate power with efficiency upgrades
const power = miner.powerUsage * (1 - state.upgrades.efficiency.level * 0.2);
totalPower += power;
}
}
// Update mining progress
if (activeMiners > 0) {
// Calculate mining progress based on hashrate and difficulty
const progressRate = (totalHashrate * 1000) / state.difficulty; // Adjusted for difficulty
state.miningProgress += progressRate * deltaTime;
// Check if we mined a block (every 100% progress)
if (state.miningProgress >= 100) {
state.miningProgress = 0;
state.shares++;
// Add coins based on current coin being mined
const coinsEarned = calculateCoinsEarned(totalHashrate);
state.wallet[state.currentCoin] += coinsEarned;
// Randomly adjust difficulty
state.difficulty = Math.max(500000, state.difficulty + (Math.random() * 200000 - 100000));
addNotification(`Block mined! +${coinsEarned.toFixed(8)} ${state.currentCoin}`, 'success');
}
}
// Update wallet power
state.wallet.power = totalHashrate;
// Update stats
state.activeMiners = activeMiners;
state.totalHashrate = totalHashrate;
state.totalPower = totalPower;
}
function calculateCoinsEarned(hashrate) {
// Base reward decreases as you mine more (simulating halving)
const baseReward = 0.01 * Math.pow(0.9, Math.floor(state.shares / 100));
// Adjust reward based on hashrate (more hashrate = more reward)
const reward = baseReward * (hashrate / 100);
return Math.max(reward, 0.00000001); // Minimum reward
}
function updateUI() {
// Update wallet counters
elements.bchCount.textContent = state.wallet.BCH.toFixed(8);
elements.fbCount.textContent = state.wallet.FB.toFixed(8);
elements.powerCount.textContent = `${state.wallet.power.toFixed(2)} MH/s`;
// Update mining progress
elements.miningProgressBar.style.width = `${state.miningProgress}%`;
elements.miningProgressText.textContent = `${Math.floor(state.miningProgress)}%`;
// Update miner status
for (let i = 1; i <= 2; i++) {
const miner = state.miners[i];
if (miner.active) {
elements[`miner${i}Status`].textContent = 'ACTIVE';
elements[`miner${i}Status`].className = 'text-xs px-2 py-1 rounded-full bg-green-600';
elements[`miner${i}Btn`].textContent = 'Deactivate';
elements[`miner${i}Btn`].className = 'w-full py-2 rounded-lg bg-red-600 hover:bg-red-500 transition';
elements[`miner${i}Container`].classList.add(i === 1 ? 'miner-active lucky-miner' : 'miner-active');
// Calculate hashrate with upgrades
let hashrate = miner.baseHashrate * (1 + state.upgrades.hashrate.level * 0.25);
// Apply luck bonus for Lucky Miner
if (i === 1 && state.luckyMinerConnected) {
hashrate *= (1 + miner.luckBonus);
}
elements[`miner${i}Hashrate`].textContent = `${hashrate.toFixed(2)} MH/s`;
// Calculate power with efficiency upgrades
const power = miner.powerUsage * (1 - state.upgrades.efficiency.level * 0.2);
elements[`miner${i}Power`].textContent = `${power.toFixed(0)} W`;
} else {
elements[`miner${i}Status`].textContent = 'OFFLINE';
elements[`miner${i}Status`].className = 'text-xs px-2 py-1 rounded-full bg-gray-600';
elements[`miner${i}Btn`].textContent = 'Activate';
elements[`miner${i}Btn`].className = 'w-full py-2 rounded-lg bg-gray-600 hover:bg-gray-500 transition';
elements[`miner${i}Container`].classList.remove('miner-active', 'lucky-miner');
elements[`miner${i}Hashrate`].textContent = '0 MH/s';
elements[`miner${i}Power`].textContent = '0 W';
}
}
// Update Lucky Miner stats
if (state.luckyMinerConnected) {
elements.miner1Luck.textContent = `+${(state.miners[1].luckBonus * 100).toFixed(0)}%`;
elements.miner1Luck.className = 'text-sm text-green-400';
} else {
elements.miner1Luck.textContent = '+0%';
elements.miner1Luck.className = 'text-sm text-gray-400';
}
// Update stats
elements.activeMiners.textContent = state.activeMiners;
const efficiency = state.upgrades.efficiency.level * 20;
elements.minerEfficiency.textContent = `${efficiency}%`;
elements.hashrate.textContent = `${state.totalHashrate.toFixed(2)} MH/s`;
elements.shares.textContent = state.shares;
elements.difficulty.textContent = Math.floor(state.difficulty).toLocaleString();
// Calculate next block time
if (state.activeMiners > 0 && state.totalHashrate > 0) {
const timeLeft = Math.max(0, (100 - state.miningProgress) / (state.totalHashrate * 1000 / state.difficulty));
const minutes = Math.floor(timeLeft / 60);
const seconds = Math.floor(timeLeft % 60);
elements.nextBlock.textContent = `${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`;
} else {
elements.nextBlock.textContent = '--:--';
}
// Update estimated earnings
const dailyEarnings = calculateCoinsEarned(state.totalHashrate) * 24;
elements.dailyEarnings.textContent = `${dailyEarnings.toFixed(8)} ${state.currentCoin}`;
elements.weeklyEarnings.textContent = `${(dailyEarnings * 7).toFixed(8)} ${state.currentCoin}`;
elements.monthlyEarnings.textContent = `${(dailyEarnings * 30).toFixed(8)} ${state.currentCoin}`;
// Update market prices
elements.bchPrice.textContent = `$${state.prices.BCH.toFixed(2)}`;
elements.fbPrice.textContent = `$${state.prices.FB.toFixed(2)}`;
// Update mining button
if (state.mining) {
elements.startMiningBtn.innerHTML = '<i class="fas fa-stop mr-2"></i> Stop Mining';
elements.startMiningBtn.className = 'col-span-2 py-3 bg-red-600 hover:bg-red-500 rounded-lg transition flex items-center justify-center';
} else {
elements.startMiningBtn.innerHTML = '<i class="fas fa-play mr-2"></i> Start Mining';
elements.startMiningBtn.className = 'col-span-2 py-3 bg-green-600 hover:bg-green-500 rounded-lg transition flex items-center justify-center';
}
}
function checkUpgrades() {
// Hashrate upgrade
if (state.wallet.BCH >= state.upgrades.hashrate.cost && state.upgrades.hashrate.level < 4) {
elements.hashrateUpgradeBtn.disabled = false;
elements.hashrateUpgradeBtn.innerHTML = `<span class="font-mono">${state.upgrades.hashrate.cost}</span> <i class="fab fa-bitcoin ml-1"></i>`;
} else {
elements.hashrateUpgradeBtn.disabled = true;
if (state.upgrades.hashrate.level >= 4) {
elements.hashrateUpgradeBtn.innerHTML = '<span>MAX</span>';
}
}
// Efficiency upgrade
if (state.wallet.BCH >= state.upgrades.efficiency.cost && state.upgrades.efficiency.level < 5) {
elements.efficiencyUpgradeBtn.disabled = false;
elements.efficiencyUpgradeBtn.innerHTML = `<span class="font-mono">${state.upgrades.efficiency.cost}</span> <i class="fab fa-bitcoin ml-1"></i>`;
} else {
elements.efficiencyUpgradeBtn.disabled = true;
if (state.upgrades.efficiency.level >= 5) {
elements.efficiencyUpgradeBtn.innerHTML = '<span>MAX</span>';
}
}
// Miner upgrade
if (state.wallet.BCH >= state.upgrades.miner.cost && state.upgrades.miner.level < 1) {
elements.minerUpgradeBtn.disabled = false;
elements.minerUpgradeBtn.innerHTML = `<span class="font-mono">${state.upgrades.miner.cost}</span> <i class="fab fa-bitcoin ml-1"></i>`;
} else {
elements.minerUpgradeBtn.disabled = true;
if (state.upgrades.miner.level >= 1) {
elements.minerUpgradeBtn.innerHTML = '<span>MAX</span>';
}
}
}
function toggleMiner(minerId) {
const miner = state.miners[minerId];
// Check if miner is unlocked (only relevant for cloud miner)
if (minerId === 2 && !miner.unlocked) return;
// Toggle miner
miner.active = !miner.active;
if (miner.active) {
addNotification(`Miner #${minerId} activated`, "success");
} else {
addNotification(`Miner #${minerId} deactivated`, "info");
}
}
function toggleMining() {
state.mining = !state.mining;
if (state.mining) {
// Check if we have active miners
let activeMiners = 0;
for (let i = 1; i <= 2; i++) {
if (state.miners[i].active && (i !== 2 || state.miners[2].unlocked)) {
activeMiners++;
}
}
if (activeMiners === 0) {
addNotification("No active miners to start mining!", "error");
state.mining = false;
return;
}
addNotification(`Started mining ${state.currentCoin}`, "success");
} else {
addNotification("Mining stopped", "info");
}
}
function buyUpgrade(type) {
const upgrade = state.upgrades[type];
// Check if we can afford it
if (state.wallet.BCH < upgrade.cost) {
addNotification("Not enough BCH for this upgrade!", "error");
return;
}
// Check if already max level
if ((type === 'hashrate' && upgrade.level >= 4) ||
(type === 'efficiency' && upgrade.level >= 5) ||
(type === 'miner' && upgrade.level >= 1)) {
return;
}
// Apply upgrade
state.wallet.BCH -= upgrade.cost;
upgrade.level += 1;
// Special effects for each upgrade
if (type === 'hashrate') {
addNotification(`Hashrate increased to ${upgrade.level * 25}%!`, "success");
upgrade.cost = Math.floor(upgrade.cost * 1.5 * 100) / 100;
} else if (type === 'efficiency') {
addNotification(`Power efficiency increased to ${upgrade.level * 20}%!`, "success");
upgrade.cost = Math.floor(upgrade.cost * 1.8 * 100) / 100;
} else if (type === 'miner') {
state.miners[2].baseHashrate *= 2;
addNotification("Cloud mining capacity doubled!", "success");
}
}
function withdrawFunds() {
if (state.wallet.BCH < 0.001 && state.wallet.FB < 1) {
addNotification("Not enough funds to withdraw", "info");
return;
}
let message = "Withdrawn:";
if (state.wallet.BCH >= 0.001) {
message += ` ${state.wallet.BCH.toFixed(8)} BCH`;
state.wallet.BCH = 0;
}
if (state.wallet.FB >= 1) {
message += ` ${state.wallet.FB.toFixed(2)} FB`;
state.wallet.FB = 0;
}
addNotification(message, "success");
}
function exchangeToBCH() {
if (state.wallet.FB < 300) {
addNotification("You need at least 300 FB to exchange for 1 BCH", "info");
return;
}
const exchangeAmount = Math.floor(state.wallet.FB / 300);
state.wallet.FB -= exchangeAmount * 300;
state.wallet.BCH += exchangeAmount;
addNotification(`Exchanged ${exchangeAmount * 300} FB for ${exchangeAmount} BCH`, "success");
}
function exchangeToFB() {
if (state.wallet.BCH < 1) {
addNotification("You need at least 1 BCH to exchange for 300 FB", "info");
return;
}
const exchangeAmount = Math.floor(state.wallet.BCH);
state.wallet.BCH -= exchangeAmount;
state.wallet.FB += exchangeAmount * 300;
addNotification(`Exchanged ${exchangeAmount} BCH for ${exchangeAmount * 300} FB`, "success");
}
function switchCoin(coin) {
if (coin === state.currentCoin) return;
state.currentCoin = coin;
state.miningProgress = 0;
// Update UI for coin selector
document.querySelectorAll('.coin-option').forEach(option => {
if (option.textContent.includes(coin)) {
option.classList.add('active');
} else {
option.classList.remove('active');
}
});
addNotification(`Now mining ${coin}`, "info");
}
function connectToLuckyMiner() {
state.luckyMinerConnected = !state.luckyMinerConnected;
if (state.luckyMinerConnected) {
addNotification("Connected to Lucky Miner Rig #08D9", "success");
} else {
addNotification("Disconnected from Lucky Miner Rig", "info");
}
}
function saveWalletInfo() {
state.walletAddresses.BCH = elements.bchWalletInput.value.trim();
state.walletAddresses.FB = elements.fbWalletInput.value.trim();
if (state.walletAddresses.BCH || state.walletAddresses.FB) {
addNotification("Wallet addresses saved!", "success");
} else {
addNotification("Please enter at least one wallet address", "info");
}
}
function addNotification(message, type) {
const notification = document.createElement('div');
notification.className = `p-3 rounded-lg shadow-lg flex items-start ${type === 'error' ? 'bg-red-600' : type === 'success' ? 'bg-green-600' : 'bg-blue-600'}`;
const icon = document.createElement('i');
icon.className = `mr-2 ${type === 'error' ? 'fas fa-exclamation-circle' : type === 'success' ? 'fas fa-check-circle' : 'fas fa-info-circle'}`;
const text = document.createElement('span');
text.textContent = message;
notification.appendChild(icon);
notification.appendChild(text);
elements.notifications.appendChild(notification);
// Auto-remove after 3 seconds
setTimeout(() => {
notification.classList.add('opacity-0', 'transition-opacity', 'duration-500');
setTimeout(() => notification.remove(), 500);
}, 3000);
}
// Initialize the game
function init() {
// Set initial UI state
updateUI();
// Start game loop
gameLoop();
// Add welcome notification
setTimeout(() => {
addNotification("Welcome to JVALKENBURG Mining Ops!", "info");
setTimeout(() => {
addNotification("Connect to your Lucky Miner Rig to get started", "info");
}, 1500);
}, 500);
// Simulate price changes
setInterval(() => {
// Random price fluctuations
state.prices.BCH = Math.max(100, state.prices.BCH + (Math.random() * 10 - 5));
state.prices.FB = Math.max(0.5, state.prices.FB + (Math.random() * 0.1 - 0.05));
// Occasionally add small amounts of coins (simulating mining rewards)
if (Math.random() > 0.95) {
const smallReward = Math.random() * 0.0001;
state.wallet[state.currentCoin] += smallReward;
}
}, 10000);
}
// Start the game
init();
</script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=privateuserh/jvmnnvbeta1-0" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html> |