|
| 1 | +import React, { useState } from 'react'; |
| 2 | +import Layout from '@theme/Layout'; |
| 3 | +import Head from '@docusaurus/Head'; |
| 4 | + |
| 5 | +const ScannerPage: React.FC = () => { |
| 6 | + const [isLoading, setIsLoading] = useState(true); |
| 7 | + |
| 8 | + const loadingMessages = [ |
| 9 | + "we're running this on a Raspberry Pi in someone's basement", |
| 10 | + "our infrastructure budget is approximately $3.50", |
| 11 | + "running on hopes, dreams, and a single DigitalOcean droplet", |
| 12 | + "our server is literally a toaster with WiFi", |
| 13 | + "our datacenter is just a laptop under someone's desk", |
| 14 | + "hosted on a refurbished calculator from the 90s", |
| 15 | + "powered by the collective sighs of our unpaid developers" |
| 16 | + ]; |
| 17 | + |
| 18 | + const randomMessage = loadingMessages[Math.floor(Math.random() * loadingMessages.length)]; |
| 19 | + |
| 20 | + return ( |
| 21 | + <Layout> |
| 22 | + <Head> |
| 23 | + <title>Scanner - TON Security</title> |
| 24 | + <meta name="description" content="TON Smart Contract Scanner" /> |
| 25 | + </Head> |
| 26 | + <div style={{ |
| 27 | + padding: 0, |
| 28 | + margin: 0, |
| 29 | + height: 'calc(100vh - 60px)', // Account for navbar height |
| 30 | + width: '100%', |
| 31 | + position: 'relative' |
| 32 | + }}> |
| 33 | + {isLoading && ( |
| 34 | + <div style={{ |
| 35 | + position: 'absolute', |
| 36 | + top: 0, |
| 37 | + left: 0, |
| 38 | + right: 0, |
| 39 | + bottom: 0, |
| 40 | + display: 'flex', |
| 41 | + alignItems: 'center', |
| 42 | + justifyContent: 'center', |
| 43 | + backgroundColor: 'var(--ifm-background-color)', |
| 44 | + zIndex: 10 |
| 45 | + }}> |
| 46 | + <div style={{ |
| 47 | + textAlign: 'center', |
| 48 | + color: 'var(--ifm-color-emphasis-700)' |
| 49 | + }}> |
| 50 | + <div style={{ |
| 51 | + width: '40px', |
| 52 | + height: '40px', |
| 53 | + border: '4px solid var(--ifm-color-emphasis-300)', |
| 54 | + borderTop: '4px solid var(--ifm-color-primary)', |
| 55 | + borderRadius: '50%', |
| 56 | + animation: 'spin 1s linear infinite', |
| 57 | + margin: '0 auto 20px auto' |
| 58 | + }} /> |
| 59 | + <div style={{ fontSize: '1.2rem' }}> |
| 60 | + Loading scanner... |
| 61 | + </div> |
| 62 | + <div style={{ fontSize: '0.9rem', marginTop: '8px' }}> |
| 63 | + Keep patience: {randomMessage} |
| 64 | + </div> |
| 65 | + <style>{` |
| 66 | + @keyframes spin { |
| 67 | + 0% { transform: rotate(0deg); } |
| 68 | + 100% { transform: rotate(360deg); } |
| 69 | + } |
| 70 | + `}</style> |
| 71 | + </div> |
| 72 | + </div> |
| 73 | + )} |
| 74 | + <iframe |
| 75 | + src="https://scan.nowarp.io" |
| 76 | + style={{ |
| 77 | + width: '100%', |
| 78 | + height: '100%', |
| 79 | + border: 'none' |
| 80 | + }} |
| 81 | + title="TON Contract Scanner" |
| 82 | + allow="clipboard-read; clipboard-write" |
| 83 | + onLoad={() => setIsLoading(false)} |
| 84 | + /> |
| 85 | + </div> |
| 86 | + </Layout> |
| 87 | + ); |
| 88 | +}; |
| 89 | + |
| 90 | +export default ScannerPage; |
0 commit comments