chatgpt-4o-latest-20250326· OpenAI LMArena Human Preference 140K
Create a toolbox app for crypto beginner. All in one single html
- User
Create a toolbox app for crypto beginner. All in one single html
- Assistant
Of course! I'll create a simple, beginner-friendly "Crypto Toolbox" app — all in a single HTML file. It will include:
- Crypto price lookup (using a public API)
- Simple crypto converter (e.g., BTC to USD)
- Glossary of basic crypto terms
- Wallet address generator (mock, for educational purposes)
Here's the full HTML code:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Crypto Beginner Toolbox</title> <style> body { font-family: Arial, sans-serif; margin: 20px; background: #f4f4f4; } h1, h2 { text-align: center; } .section { background: white; padding: 20px; margin-bottom: 20px; border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); } label, select, input, button { display: block; margin: 10px 0; width: 100%; padding: 8px; font-size: 1em; } button { background-color: #4CAF50; color: white; border: none; cursor: pointer; } button:hover { background-color: #45a049; } .result { margin-top: 10px; font-weight: bold; } ul { list-style-type: disc; padding-left: 20px; } </style> </head> <body> <h1>🛠️ Crypto Beginner Toolbox</h1> <div class="section" id="price-checker"> <h2>🔍 Check Crypto Price</h2> <select id="crypto-select"> <option value="bitcoin">Bitcoin (BTC)</option> <option value="ethereum">Ethereum (ETH)</option> <option value="dogecoin">Dogecoin (DOGE)</option> </select> <button onclick="getPrice()">Get Current Price (USD)</button> <div class="result" id="price-result"></div> </div> <div class="section" id="converter"> <h2>💱 Crypto Converter</h2> <label for="amount">Amount in Crypto:</label> <input type="number" id="amount" placeholder="e.g., 0.5"> <select id="convert-crypto-select"> <option value="bitcoin">Bitcoin (BTC)</option> <option value="ethereum">Ethereum (ETH)</option> <option value="dogecoin">Dogecoin (DOGE)</option> </select> <button onclick="convertCrypto()">Convert to USD</button> <div class="result" id="convert-result"></div> </div> <div class="section" id="glossary"> <h2>📚 Crypto Glossary</h2> <ul> <li><strong>Blockchain:</strong> A digital ledger of transactions distributed across a network.</li> <li><strong>Wallet:</strong> A digital tool to store cryptocurrencies securely.</li> <li><strong>Private Key:</strong> A secret code that allows you to access your crypto.</li> <li><strong>Public Key:</strong> An address you share to receive crypto.</li> <li><strong>Altcoin:</strong> Any cryptocurrency other than Bitcoin.</li> <li><strong>Exchange:</strong> A platform to buy, sell, or trade cryptocurrencies.</li> </ul> </div> <div class="section" id="wallet-generator"> <h2>🔐 Mock Wallet Address Generator</h2> <button onclick="generateWallet()">Generate Wallet Address</button> <div class="result" id="wallet-result"></div> </div> <script> async function getPrice() { const crypto = document.getElementById('crypto-select').value; const resultDiv = document.getElementById('price-result'); resultDiv.textContent = 'Loading...'; try { const response = await fetch(`https://api.coingecko.com/api/v3/simple/price?ids=${crypto}&vs_currencies=usd`); const data = await response.json(); const price = data[crypto].usd; resultDiv.textContent = `Current price of ${crypto.charAt(0).toUpperCase() + crypto.slice(1)}: $${price}`; } catch (error) { resultDiv.textContent = 'Error fetching price.'; } } async function convertCrypto() { const crypto = document.getElementById('convert-crypto-select').value; const amount = parseFloat(document.getElementById('amount').value); const resultDiv = document.getElementById('convert-result'); if (isNaN(amount) || amount <= 0) { resultDiv.textContent = 'Please enter a valid amount.'; return; } resultDiv.textContent = 'Converting...'; try { const response = await fetch(`https://api.coingecko.com/api/v3/simple/price?ids=${crypto}&vs_currencies=usd`); const data = await response.json(); const price = data[crypto].usd; const total = (amount * price).toFixed(2); resultDiv.textContent = `${amount} ${crypto.toUpperCase()} ≈ $${total} USD`; } catch (error) { resultDiv.textContent = 'Error converting.'; } } function generateWallet() { const resultDiv = document.getElementById('wallet-result'); const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; let address = '0x'; for (let i = 0; i < 40; i++) { address += chars.charAt(Math.floor(Math.random() * chars.length)); } resultDiv.textContent = `Mock Wallet Address: ${address}`; } </script> </body> </html>—
✅ Features:
- Fetches real-time prices from CoinGecko API
- Converts crypto amount to USD
- Provides a simple glossary
- Generates a mock wallet address (for learning, not real use)
—
Would you also like a slightly more advanced version with:
- Dark mode toggle
- More coins
- Real wallet generation (using libraries like ethers.js)? 🚀
Let me know!
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.