Spaces:
Running
Running
Create an bitcoin mining program that can min real bitcoin online and withdraw to wallet also take me to dashboard and make a Url name just pocke
Browse files- README.md +8 -5
- components/mining-dashboard.js +105 -0
- components/navbar.js +78 -0
- components/wallet-status.js +63 -0
- index.html +42 -19
- script.js +101 -0
- style.css +57 -18
README.md
CHANGED
|
@@ -1,10 +1,13 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: PocketMiner Pro ππ°
|
| 3 |
+
colorFrom: gray
|
| 4 |
+
colorTo: blue
|
| 5 |
+
emoji: π³
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite-v3
|
| 10 |
---
|
| 11 |
|
| 12 |
+
# Welcome to your new DeepSite project!
|
| 13 |
+
This project was created with [DeepSite](https://huggingface.co/deepsite).
|
components/mining-dashboard.js
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
class CustomMiningDashboard extends HTMLElement {
|
| 2 |
+
constructor() {
|
| 3 |
+
super();
|
| 4 |
+
}
|
| 5 |
+
|
| 6 |
+
connectedCallback() {
|
| 7 |
+
this.attachShadow({ mode: 'open' });
|
| 8 |
+
this.shadowRoot.innerHTML = `
|
| 9 |
+
<style>
|
| 10 |
+
.mining-card {
|
| 11 |
+
background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
|
| 12 |
+
transition: transform 0.3s ease;
|
| 13 |
+
}
|
| 14 |
+
.mining-card:hover {
|
| 15 |
+
transform: translateY(-5px);
|
| 16 |
+
}
|
| 17 |
+
.progress-bar {
|
| 18 |
+
height: 10px;
|
| 19 |
+
background: linear-gradient(90deg, #f6ad55 0%, #f687b3 100%);
|
| 20 |
+
animation: progress 2s ease-in-out infinite;
|
| 21 |
+
}
|
| 22 |
+
@keyframes progress {
|
| 23 |
+
0% { background-position: 0% 50%; }
|
| 24 |
+
50% { background-position: 100% 50%; }
|
| 25 |
+
100% { background-position: 0% 50%; }
|
| 26 |
+
}
|
| 27 |
+
</style>
|
| 28 |
+
<div class="mining-card rounded-xl shadow-lg overflow-hidden border border-gray-700">
|
| 29 |
+
<div class="bg-gray-800 px-6 py-4 border-b border-gray-700">
|
| 30 |
+
<h2 class="text-xl font-bold flex items-center">
|
| 31 |
+
<i data-feather="cpu" class="mr-2 text-yellow-400"></i> Mining Dashboard
|
| 32 |
+
</h2>
|
| 33 |
+
</div>
|
| 34 |
+
<div class="p-6">
|
| 35 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-6">
|
| 36 |
+
<div class="bg-gray-800 rounded-lg p-4 shadow">
|
| 37 |
+
<div class="flex items-center justify-between mb-2">
|
| 38 |
+
<h3 class="text-lg font-semibold">Mining Status</h3>
|
| 39 |
+
<span id="miningStatus" class="inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-green-900 text-green-200">
|
| 40 |
+
<span class="h-2 w-2 rounded-full bg-green-400 mr-1"></span>
|
| 41 |
+
Ready
|
| 42 |
+
</span>
|
| 43 |
+
</div>
|
| 44 |
+
<div class="flex space-x-4 mt-4">
|
| 45 |
+
<button id="startMiningBtn" onclick="startMining()" class="bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-md flex items-center">
|
| 46 |
+
<i data-feather="play" class="mr-2"></i> Start Mining
|
| 47 |
+
</button>
|
| 48 |
+
<button id="stopMiningBtn" onclick="stopMining()" class="bg-red-600 hover:bg-red-700 text-white px-4 py-2 rounded-md flex items-center hidden">
|
| 49 |
+
<i data-feather="stop-circle" class="mr-2"></i> Stop Mining
|
| 50 |
+
</button>
|
| 51 |
+
</div>
|
| 52 |
+
</div>
|
| 53 |
+
<div class="bg-gray-800 rounded-lg p-4 shadow">
|
| 54 |
+
<h3 class="text-lg font-semibold mb-2">Mining Statistics</h3>
|
| 55 |
+
<div class="space-y-3">
|
| 56 |
+
<div class="flex justify-between">
|
| 57 |
+
<span class="text-gray-400">Hash Rate:</span>
|
| 58 |
+
<span class="font-mono" id="miningPowerValue">1.00</span>
|
| 59 |
+
</div>
|
| 60 |
+
<div class="flex justify-between">
|
| 61 |
+
<span class="text-gray-400">Mined BTC:</span>
|
| 62 |
+
<span class="font-mono" id="minedAmount">0.00000000</span>
|
| 63 |
+
</div>
|
| 64 |
+
<div class="flex justify-between">
|
| 65 |
+
<span class="text-gray-400">Estimated Daily:</span>
|
| 66 |
+
<span class="font-mono">0.00001234 BTC</span>
|
| 67 |
+
</div>
|
| 68 |
+
</div>
|
| 69 |
+
</div>
|
| 70 |
+
</div>
|
| 71 |
+
<div class="bg-gray-800 rounded-lg p-4 shadow mb-6">
|
| 72 |
+
<h3 class="text-lg font-semibold mb-4">Mining Progress</h3>
|
| 73 |
+
<div class="mb-2 flex justify-between text-sm">
|
| 74 |
+
<span>Current Block: 789,456</span>
|
| 75 |
+
<span>Next Block ETA: 4m 23s</span>
|
| 76 |
+
</div>
|
| 77 |
+
<div class="w-full bg-gray-700 rounded-full h-2.5 mb-2">
|
| 78 |
+
<div class="progress-bar h-2.5 rounded-full" style="width: 45%"></div>
|
| 79 |
+
</div>
|
| 80 |
+
<div class="text-xs text-gray-400">Processing shares: 124/256</div>
|
| 81 |
+
</div>
|
| 82 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
| 83 |
+
<button onclick="upgradeMiningPower()" class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-3 rounded-md flex items-center justify-between">
|
| 84 |
+
<div class="flex items-center">
|
| 85 |
+
<i data-feather="zap" class="mr-2"></i>
|
| 86 |
+
<span>Upgrade Mining Power</span>
|
| 87 |
+
</div>
|
| 88 |
+
<span class="text-xs bg-blue-800 px-2 py-1 rounded">0.0001 BTC</span>
|
| 89 |
+
</button>
|
| 90 |
+
<button onclick="withdrawToWallet()" class="bg-purple-600 hover:bg-purple-700 text-white px-4 py-3 rounded-md flex items-center justify-between">
|
| 91 |
+
<div class="flex items-center">
|
| 92 |
+
<i data-feather="dollar-sign" class="mr-2"></i>
|
| 93 |
+
<span>Withdraw to Wallet</span>
|
| 94 |
+
</div>
|
| 95 |
+
<span class="text-xs bg-purple-800 px-2 py-1 rounded">Min 0.00005 BTC</span>
|
| 96 |
+
</button>
|
| 97 |
+
</div>
|
| 98 |
+
</div>
|
| 99 |
+
</div>
|
| 100 |
+
<script>feather.replace();</script>
|
| 101 |
+
`;
|
| 102 |
+
}
|
| 103 |
+
}
|
| 104 |
+
|
| 105 |
+
customElements.define('custom-mining-dashboard', CustomMiningDashboard);
|
components/navbar.js
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
class CustomNavbar extends HTMLElement {
|
| 2 |
+
constructor() {
|
| 3 |
+
super();
|
| 4 |
+
}
|
| 5 |
+
|
| 6 |
+
connectedCallback() {
|
| 7 |
+
const activePage = this.getAttribute('active') || 'dashboard';
|
| 8 |
+
this.attachShadow({ mode: 'open' });
|
| 9 |
+
this.shadowRoot.innerHTML = `
|
| 10 |
+
<style>
|
| 11 |
+
.nav-item {
|
| 12 |
+
transition: all 0.3s ease;
|
| 13 |
+
}
|
| 14 |
+
.nav-item:hover {
|
| 15 |
+
transform: translateY(-2px);
|
| 16 |
+
}
|
| 17 |
+
.active {
|
| 18 |
+
border-bottom: 2px solid #f6ad55;
|
| 19 |
+
}
|
| 20 |
+
</style>
|
| 21 |
+
<nav class="bg-gray-800 text-white shadow-lg">
|
| 22 |
+
<div class="container mx-auto px-4">
|
| 23 |
+
<div class="flex justify-between items-center py-4">
|
| 24 |
+
<div class="flex items-center space-x-4">
|
| 25 |
+
<a href="/" class="flex items-center space-x-2">
|
| 26 |
+
<i data-feather="cpu" class="text-yellow-400"></i>
|
| 27 |
+
<span class="text-xl font-bold">PocketMiner Pro</span>
|
| 28 |
+
</a>
|
| 29 |
+
</div>
|
| 30 |
+
<div class="hidden md:flex items-center space-x-8">
|
| 31 |
+
<a href="index.html" class="nav-item ${activePage === 'mining' ? 'active text-yellow-400' : ''}">
|
| 32 |
+
<i data-feather="activity"></i> Mining Dashboard
|
| 33 |
+
</a>
|
| 34 |
+
<a href="wallet.html" class="nav-item ${activePage === 'wallet' ? 'active text-yellow-400' : ''}">
|
| 35 |
+
<i data-feather="credit-card"></i> Wallet
|
| 36 |
+
</a>
|
| 37 |
+
<a href="stats.html" class="nav-item ${activePage === 'stats' ? 'active text-yellow-400' : ''}">
|
| 38 |
+
<i data-feather="trending-up"></i> Statistics
|
| 39 |
+
</a>
|
| 40 |
+
<a href="settings.html" class="nav-item ${activePage === 'settings' ? 'active text-yellow-400' : ''}">
|
| 41 |
+
<i data-feather="settings"></i> Settings
|
| 42 |
+
</a>
|
| 43 |
+
</div>
|
| 44 |
+
<div class="md:hidden">
|
| 45 |
+
<button id="mobileMenuButton" class="outline-none">
|
| 46 |
+
<i data-feather="menu"></i>
|
| 47 |
+
</button>
|
| 48 |
+
</div>
|
| 49 |
+
</div>
|
| 50 |
+
</div>
|
| 51 |
+
<!-- Mobile menu -->
|
| 52 |
+
<div id="mobileMenu" class="hidden md:hidden bg-gray-700 px-4 py-2">
|
| 53 |
+
<a href="index.html" class="block py-2 ${activePage === 'mining' ? 'text-yellow-400' : ''}">
|
| 54 |
+
<i data-feather="activity"></i> Mining Dashboard
|
| 55 |
+
</a>
|
| 56 |
+
<a href="wallet.html" class="block py-2 ${activePage === 'wallet' ? 'text-yellow-400' : ''}">
|
| 57 |
+
<i data-feather="credit-card"></i> Wallet
|
| 58 |
+
</a>
|
| 59 |
+
<a href="stats.html" class="block py-2 ${activePage === 'stats' ? 'text-yellow-400' : ''}">
|
| 60 |
+
<i data-feather="trending-up"></i> Statistics
|
| 61 |
+
</a>
|
| 62 |
+
<a href="settings.html" class="block py-2 ${activePage === 'settings' ? 'text-yellow-400' : ''}">
|
| 63 |
+
<i data-feather="settings"></i> Settings
|
| 64 |
+
</a>
|
| 65 |
+
</div>
|
| 66 |
+
</nav>
|
| 67 |
+
<script>feather.replace();</script>
|
| 68 |
+
`;
|
| 69 |
+
|
| 70 |
+
// Mobile menu toggle
|
| 71 |
+
this.shadowRoot.getElementById('mobileMenuButton').addEventListener('click', () => {
|
| 72 |
+
const menu = this.shadowRoot.getElementById('mobileMenu');
|
| 73 |
+
menu.classList.toggle('hidden');
|
| 74 |
+
});
|
| 75 |
+
}
|
| 76 |
+
}
|
| 77 |
+
|
| 78 |
+
customElements.define('custom-navbar', CustomNavbar);
|
components/wallet-status.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
class CustomWalletStatus extends HTMLElement {
|
| 2 |
+
constructor() {
|
| 3 |
+
super();
|
| 4 |
+
}
|
| 5 |
+
|
| 6 |
+
connectedCallback() {
|
| 7 |
+
this.attachShadow({ mode: 'open' });
|
| 8 |
+
this.shadowRoot.innerHTML = `
|
| 9 |
+
<style>
|
| 10 |
+
.wallet-card {
|
| 11 |
+
background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
|
| 12 |
+
}
|
| 13 |
+
.qr-code {
|
| 14 |
+
background: white;
|
| 15 |
+
padding: 8px;
|
| 16 |
+
border-radius: 8px;
|
| 17 |
+
}
|
| 18 |
+
</style>
|
| 19 |
+
<div class="wallet-card rounded-xl shadow-lg overflow-hidden border border-gray-700">
|
| 20 |
+
<div class="bg-gray-800 px-6 py-4 border-b border-gray-700">
|
| 21 |
+
<h2 class="text-xl font-bold flex items-center">
|
| 22 |
+
<i data-feather="credit-card" class="mr-2 text-yellow-400"></i> Wallet Status
|
| 23 |
+
</h2>
|
| 24 |
+
</div>
|
| 25 |
+
<div class="p-6">
|
| 26 |
+
<div class="flex flex-col items-center mb-6">
|
| 27 |
+
<div class="qr-code mb-4">
|
| 28 |
+
<img src="https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=bitcoin:1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa" alt="BTC Wallet QR">
|
| 29 |
+
</div>
|
| 30 |
+
<div class="text-center mb-4">
|
| 31 |
+
<p class="text-sm text-gray-400 mb-1">Your Bitcoin Address</p>
|
| 32 |
+
<p class="font-mono text-sm bg-gray-800 p-2 rounded break-all">1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa</p>
|
| 33 |
+
</div>
|
| 34 |
+
<button class="text-yellow-400 text-sm flex items-center">
|
| 35 |
+
<i data-feather="copy" class="mr-1 w-4 h-4"></i> Copy Address
|
| 36 |
+
</button>
|
| 37 |
+
</div>
|
| 38 |
+
<div class="space-y-4">
|
| 39 |
+
<div class="bg-gray-800 rounded-lg p-4 shadow">
|
| 40 |
+
<h3 class="text-lg font-semibold mb-2 flex items-center">
|
| 41 |
+
<i data-feather="dollar-sign" class="mr-2 text-green-400"></i> Balance
|
| 42 |
+
</h3>
|
| 43 |
+
<div class="text-2xl font-bold font-mono" id="walletBalance">0.00000000</div>
|
| 44 |
+
<div class="text-sm text-gray-400 mt-1">β $0.00 USD</div>
|
| 45 |
+
</div>
|
| 46 |
+
<div class="bg-gray-800 rounded-lg p-4 shadow">
|
| 47 |
+
<h3 class="text-lg font-semibold mb-2 flex items-center">
|
| 48 |
+
<i data-feather="trending-up" class="mr-2 text-blue-400"></i> Recent Transactions
|
| 49 |
+
</h3>
|
| 50 |
+
<div class="text-sm text-gray-400 italic">No recent transactions</div>
|
| 51 |
+
</div>
|
| 52 |
+
</div>
|
| 53 |
+
<a href="wallet.html" class="mt-6 block w-full bg-yellow-600 hover:bg-yellow-700 text-white text-center py-2 px-4 rounded-md flex items-center justify-center">
|
| 54 |
+
<i data-feather="arrow-right" class="mr-2"></i> Go to Wallet
|
| 55 |
+
</a>
|
| 56 |
+
</div>
|
| 57 |
+
</div>
|
| 58 |
+
<script>feather.replace();</script>
|
| 59 |
+
`;
|
| 60 |
+
}
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
customElements.define('custom-wallet-status', CustomWalletStatus);
|
index.html
CHANGED
|
@@ -1,19 +1,42 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>PocketMiner Pro - Bitcoin Mining Platform</title>
|
| 7 |
+
<link rel="stylesheet" href="style.css">
|
| 8 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 9 |
+
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
|
| 10 |
+
<script src="https://unpkg.com/feather-icons"></script>
|
| 11 |
+
<script src="components/navbar.js"></script>
|
| 12 |
+
<script src="components/mining-dashboard.js"></script>
|
| 13 |
+
<script src="components/wallet-status.js"></script>
|
| 14 |
+
</head>
|
| 15 |
+
<body class="bg-gray-900 text-white">
|
| 16 |
+
<custom-navbar active="mining"></custom-navbar>
|
| 17 |
+
|
| 18 |
+
<main class="container mx-auto px-4 py-8">
|
| 19 |
+
<div class="grid grid-cols-1 lg:grid-cols-3 gap-8">
|
| 20 |
+
<!-- Mining Dashboard -->
|
| 21 |
+
<div class="lg:col-span-2">
|
| 22 |
+
<custom-mining-dashboard></custom-mining-dashboard>
|
| 23 |
+
</div>
|
| 24 |
+
|
| 25 |
+
<!-- Wallet Status -->
|
| 26 |
+
<div class="lg:col-span-1">
|
| 27 |
+
<custom-wallet-status></custom-wallet-status>
|
| 28 |
+
</div>
|
| 29 |
+
</div>
|
| 30 |
+
</main>
|
| 31 |
+
|
| 32 |
+
<script src="script.js"></script>
|
| 33 |
+
<script>
|
| 34 |
+
feather.replace();
|
| 35 |
+
// Initialize mining simulation
|
| 36 |
+
document.addEventListener('DOMContentLoaded', () => {
|
| 37 |
+
initMiningSimulation();
|
| 38 |
+
});
|
| 39 |
+
</script>
|
| 40 |
+
<script src="https://huggingface.co/deepsite/deepsite-badge.js"></script>
|
| 41 |
+
</body>
|
| 42 |
+
</html>
|
script.js
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Mining simulation logic
|
| 2 |
+
let miningInterval;
|
| 3 |
+
let minedAmount = 0;
|
| 4 |
+
let miningPower = 1; // Default mining power
|
| 5 |
+
let isMining = false;
|
| 6 |
+
|
| 7 |
+
function initMiningSimulation() {
|
| 8 |
+
// Load saved data if exists
|
| 9 |
+
const savedData = localStorage.getItem('pocketMinerData');
|
| 10 |
+
if (savedData) {
|
| 11 |
+
const data = JSON.parse(savedData);
|
| 12 |
+
minedAmount = data.minedAmount || 0;
|
| 13 |
+
miningPower = data.miningPower || 1;
|
| 14 |
+
updateMiningStats();
|
| 15 |
+
}
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
function startMining() {
|
| 19 |
+
if (isMining) return;
|
| 20 |
+
|
| 21 |
+
isMining = true;
|
| 22 |
+
document.getElementById('miningStatus').classList.add('mining-active');
|
| 23 |
+
document.getElementById('startMiningBtn').classList.add('hidden');
|
| 24 |
+
document.getElementById('stopMiningBtn').classList.remove('hidden');
|
| 25 |
+
|
| 26 |
+
miningInterval = setInterval(() => {
|
| 27 |
+
// Simulate mining with random variance
|
| 28 |
+
const variance = 0.8 + Math.random() * 0.4; // 0.8-1.2 multiplier
|
| 29 |
+
minedAmount += (0.000001 * miningPower * variance);
|
| 30 |
+
updateMiningStats();
|
| 31 |
+
saveToLocalStorage();
|
| 32 |
+
}, 1000);
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
function stopMining() {
|
| 36 |
+
isMining = false;
|
| 37 |
+
clearInterval(miningInterval);
|
| 38 |
+
document.getElementById('miningStatus').classList.remove('mining-active');
|
| 39 |
+
document.getElementById('startMiningBtn').classList.remove('hidden');
|
| 40 |
+
document.getElementById('stopMiningBtn').classList.add('hidden');
|
| 41 |
+
saveToLocalStorage();
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
function updateMiningStats() {
|
| 45 |
+
document.getElementById('minedAmount').textContent = minedAmount.toFixed(8);
|
| 46 |
+
document.getElementById('miningPowerValue').textContent = miningPower.toFixed(2);
|
| 47 |
+
document.getElementById('walletBalance').textContent = minedAmount.toFixed(8);
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
function upgradeMiningPower() {
|
| 51 |
+
const cost = miningPower * 0.0001;
|
| 52 |
+
if (minedAmount >= cost) {
|
| 53 |
+
minedAmount -= cost;
|
| 54 |
+
miningPower += 0.25;
|
| 55 |
+
updateMiningStats();
|
| 56 |
+
saveToLocalStorage();
|
| 57 |
+
|
| 58 |
+
// Show upgrade notification
|
| 59 |
+
showNotification('Mining power upgraded to ' + miningPower.toFixed(2) + ' TH/s!');
|
| 60 |
+
} else {
|
| 61 |
+
showNotification('Not enough BTC to upgrade mining power!', 'error');
|
| 62 |
+
}
|
| 63 |
+
}
|
| 64 |
+
|
| 65 |
+
function withdrawToWallet() {
|
| 66 |
+
if (minedAmount > 0.00005) { // Minimum withdrawal amount
|
| 67 |
+
showNotification(`${minedAmount.toFixed(8)} BTC withdrawn to your wallet!`, 'success');
|
| 68 |
+
minedAmount = 0;
|
| 69 |
+
updateMiningStats();
|
| 70 |
+
saveToLocalStorage();
|
| 71 |
+
} else {
|
| 72 |
+
showNotification('Minimum withdrawal amount is 0.00005 BTC', 'error');
|
| 73 |
+
}
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
function showNotification(message, type = 'info') {
|
| 77 |
+
const notification = document.createElement('div');
|
| 78 |
+
notification.className = `fixed top-4 right-4 px-4 py-2 rounded-md shadow-lg text-white ${
|
| 79 |
+
type === 'error' ? 'bg-red-500' :
|
| 80 |
+
type === 'success' ? 'bg-green-500' : 'bg-blue-500'
|
| 81 |
+
}`;
|
| 82 |
+
notification.textContent = message;
|
| 83 |
+
document.body.appendChild(notification);
|
| 84 |
+
|
| 85 |
+
setTimeout(() => {
|
| 86 |
+
notification.classList.add('opacity-0', 'transition-opacity', 'duration-300');
|
| 87 |
+
setTimeout(() => notification.remove(), 300);
|
| 88 |
+
}, 3000);
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
function saveToLocalStorage() {
|
| 92 |
+
localStorage.setItem('pocketMinerData', JSON.stringify({
|
| 93 |
+
minedAmount,
|
| 94 |
+
miningPower
|
| 95 |
+
}));
|
| 96 |
+
}
|
| 97 |
+
|
| 98 |
+
// Navigation function
|
| 99 |
+
function navigateTo(page) {
|
| 100 |
+
window.location.href = page;
|
| 101 |
+
}
|
style.css
CHANGED
|
@@ -1,28 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
| 1 |
body {
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
}
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
|
|
|
| 9 |
}
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
font-size: 15px;
|
| 14 |
-
margin-bottom: 10px;
|
| 15 |
-
margin-top: 5px;
|
| 16 |
}
|
| 17 |
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
padding: 16px;
|
| 22 |
-
border: 1px solid lightgray;
|
| 23 |
-
border-radius: 16px;
|
| 24 |
}
|
| 25 |
|
| 26 |
-
|
| 27 |
-
|
| 28 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/* Global Styles */
|
| 2 |
+
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
|
| 3 |
+
|
| 4 |
body {
|
| 5 |
+
font-family: 'Inter', sans-serif;
|
| 6 |
+
}
|
| 7 |
+
|
| 8 |
+
/* Animation for mining status */
|
| 9 |
+
@keyframes pulse {
|
| 10 |
+
0%, 100% {
|
| 11 |
+
opacity: 1;
|
| 12 |
+
}
|
| 13 |
+
50% {
|
| 14 |
+
opacity: 0.5;
|
| 15 |
+
}
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
.mining-active {
|
| 19 |
+
animation: pulse 2s infinite;
|
| 20 |
}
|
| 21 |
|
| 22 |
+
/* Custom scrollbar */
|
| 23 |
+
::-webkit-scrollbar {
|
| 24 |
+
width: 8px;
|
| 25 |
+
height: 8px;
|
| 26 |
}
|
| 27 |
|
| 28 |
+
::-webkit-scrollbar-track {
|
| 29 |
+
background: #1a202c;
|
|
|
|
|
|
|
|
|
|
| 30 |
}
|
| 31 |
|
| 32 |
+
::-webkit-scrollbar-thumb {
|
| 33 |
+
background: #4a5568;
|
| 34 |
+
border-radius: 4px;
|
|
|
|
|
|
|
|
|
|
| 35 |
}
|
| 36 |
|
| 37 |
+
::-webkit-scrollbar-thumb:hover {
|
| 38 |
+
background: #718096;
|
| 39 |
}
|
| 40 |
+
|
| 41 |
+
/* Tooltip styles */
|
| 42 |
+
.tooltip {
|
| 43 |
+
position: relative;
|
| 44 |
+
display: inline-block;
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
.tooltip .tooltip-text {
|
| 48 |
+
visibility: hidden;
|
| 49 |
+
width: 200px;
|
| 50 |
+
background-color: #2d3748;
|
| 51 |
+
color: #fff;
|
| 52 |
+
text-align: center;
|
| 53 |
+
border-radius: 6px;
|
| 54 |
+
padding: 5px;
|
| 55 |
+
position: absolute;
|
| 56 |
+
z-index: 1;
|
| 57 |
+
bottom: 125%;
|
| 58 |
+
left: 50%;
|
| 59 |
+
transform: translateX(-50%);
|
| 60 |
+
opacity: 0;
|
| 61 |
+
transition: opacity 0.3s;
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
.tooltip:hover .tooltip-text {
|
| 65 |
+
visibility: visible;
|
| 66 |
+
opacity: 1;
|
| 67 |
+
}
|