<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>ETH Flash Transaction @Spectrix_official</title>
    <style>
        body {
            font-family: 'Arial', sans-serif;
            background-color: #e9ecef;
            color: #343a40;
            padding: 20px;
            margin: 0;
        }
        h1 {
            color: #007bff;
            text-align: center;
        }
        .container {
            max-width: 600px;
            margin: 0 auto;
            background-color: #ffffff;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        }
        input {
            margin: 10px 0;
            padding: 10px;
            width: calc(100% - 22px);
            border: 1px solid #ced4da;
            border-radius: 5px;
            font-size: 16px;
        }
        button {
            padding: 10px 15px;
            background-color: #007bff;
            color: white;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 16px;
            width: 100%;
        }
        button:hover {
            background-color: #0056b3;
        }
        #log {
            margin-top: 20px;
            padding: 10px;
            background-color: #f8f9fa;
            border: 1px solid #ced4da;
            border-radius: 5px;
            max-height: 300px;
            overflow-y: auto;
        }
        .log-entry {
            margin: 5px 0;
            padding: 8px;
            border-radius: 3px;
            background-color: #e9ecef;
        }
        .hash {
            color: #28a745;
            font-weight: bold;
        }
        .info {
            color: #17a2b8;
        }
        .error {
            color: #dc3545;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>ETH Flash Transaction @Spectrix_official</h1>
        <button id="startButton">Start</button>
        <div id="transferSection" style="display: none;">
            <div id="walletInfo"></div>
            <input type="text" id="recipient" placeholder="Recipient Address" />
            <input type="number" id="amount" placeholder="Amount to Send (ETH)" />
            <button id="sendButton">Send ETH</button>
        </div>
        <div id="log"></div>
    </div>

    <script>
        let fakeWallet;
        let remainingAmount = 500; // Amount in ETH

        document.getElementById('startButton').onclick = function() {
            // Generate a fake wallet address
            fakeWallet = '0x' + Math.random().toString(16).slice(2, 42); // Generate a random wallet address

            // Show the wallet info and transfer section
            document.getElementById('walletInfo').innerHTML = `Temporary Wallet Created: <span class="hash">${fakeWallet}.... </span> with <strong>${remainingAmount} ETH Flashed Inside of it.</strong>`;
            document.getElementById('transferSection').style.display = 'block';
            logMessage(`Temporary Wallet Created: <span class="hash">${fakeWallet}.... </span> with <strong>${remainingAmount} ETH</strong>`, 'info');
        };

        document.getElementById('sendButton').onclick = function() {
            const recipient = document.getElementById('recipient').value;
            const amountToSend = parseFloat(document.getElementById('amount').value);

            if (amountToSend > remainingAmount) {
                logMessage(`Error: Cannot send more than <strong>${remainingAmount} ETH</strong>.`, 'error');
                return;
            }

            // Deduct the amount sent from the remaining balance
            remainingAmount -= amountToSend;

            // Simulate a realistic transaction hash
            const simulatedHash = '0x' + Math.random().toString(16).slice(2, 66); // Generate a random hash

            // Log the simulated transaction details
            logMessage(`Transaction Hash: <span class="hash">${simulatedHash}....</span>`, 'info');
            logMessage(`Flashed Amount: <strong>${amountToSend} ETH</strong>`, 'info');
            logMessage(`Recipient Address: <strong>${recipient}</strong>`, 'info');
            logMessage(`Remaining Balance: <strong>${remainingAmount} ETH</strong>`, 'info');

            // Simulate a delay for receiving ETH
            const timeToReceive = "1 hour"; // Simulated time to receive
            const startTime = Date.now();

            setTimeout(() => {
                const timeTaken = ((Date.now() - startTime) / 1000).toFixed(2); // Time taken in seconds
                logMessage(`Time Taken: <strong>${timeTaken} seconds</strong>`, 'info');
                logMessage(`ETH will be received by <strong>${recipient}</strong> in approximately <strong>${timeToReceive}</strong>.`, 'info');
            }, 2000); // 2 seconds delay for simulation
        };

        function logMessage(message, type) {
            const logDiv = document.getElementById('log');
            const logEntry = document.createElement('div');
            logEntry.className = `log-entry ${type}`;
            logEntry.innerHTML = message;
            logDiv.appendChild(logEntry);
            logDiv.scrollTop = logDiv.scrollHeight; // Auto-scroll to the bottom
        }
    </script>
</body>
</html>