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 profit/loss calculator
- Basic glossary of crypto terms
- Responsive design (mobile-friendly)
Here’s the full HTML code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Crypto Beginner Toolbox</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 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 {
display: block;
margin-top: 10px;
}
input, select, button {
width: 100%;
padding: 10px;
margin-top: 5px;
margin-bottom: 10px;
border: 1px solid #ccc;
border-radius: 5px;
}
button {
background-color: #4CAF50;
color: white;
cursor: pointer;
}
button:hover {
background-color: #45a049;
}
.result {
margin-top: 10px;
font-weight: bold;
}
.glossary-item {
margin-bottom: 10px;
}
.glossary-item strong {
display: block;
margin-bottom: 5px;
}
</style>
</head>
<body>
<h1>Crypto Beginner Toolbox</h1>
<!-- Price Lookup Section -->
<div class="section">
<h2>🔍 Crypto Price Lookup</h2>
<label for="crypto-select">Select Cryptocurrency:</label>
<select id="crypto-select">
<option value="bitcoin">Bitcoin (BTC)</option>
<option value="ethereum">Ethereum (ETH)</option>
<option value="dogecoin">Dogecoin (DOGE)</option>
<option value="cardano">Cardano (ADA)</option>
<option value="solana">Solana (SOL)</option>
</select>
<button onclick="getPrice()">Get Current Price</button>
<div id="price-result" class="result"></div>
</div>
<!-- Profit/Loss Calculator Section -->
<div class="section">
<h2>💰 Profit/Loss Calculator</h2>
<label for="buy-price">Buy Price (USD):</label>
<input type="number" id="buy-price" placeholder="e.g., 30000">
<label for="sell-price">Sell Price (USD):</label>
<input type="number" id="sell-price" placeholder="e.g., 35000">
<label for="amount">Amount (Coins):</label>
<input type="number" id="amount" placeholder="e.g., 0.5">
<button onclick="calculateProfit()">Calculate</button>
<div id="profit-result" class="result"></div>
</div>
<!-- Glossary Section -->
<div class="section">
<h2>📚 Crypto Glossary</h2>
<div class="glossary-item">
<strong>Blockchain:</strong>
A decentralized digital ledger that records transactions across many computers.
</div>
<div class="glossary-item">
<strong>Wallet:</strong>
A digital tool (software or hardware) that stores your cryptocurrency securely.
</div>
<div class="glossary-item">
<strong>Altcoin:</strong>
Any cryptocurrency other than Bitcoin.
</div>
<div class="glossary-item">
<strong>HODL:</strong>
A slang term meaning to hold onto your crypto rather than selling it.
</div>
<div class="glossary-item">
<strong>DeFi:</strong>
Short for "Decentralized Finance," financial services built on blockchain technology.
</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: $${price.toLocaleString()}`;
} catch (error) {
resultDiv.textContent = 'Error fetching price. Please try again.';
}
}
function calculateProfit() {
const buyPrice = parseFloat(document.getElementById('buy-price').value);
const sellPrice = parseFloat(document.getElementById('sell-price').value);
const amount = parseFloat(document.getElementById('amount').value);
const resultDiv = document.getElementById('profit-result');
if (isNaN(buyPrice) || isNaN(sellPrice) || isNaN(amount)) {
resultDiv.textContent = 'Please fill in all fields correctly.';
return;
}
const profit = (sellPrice - buyPrice) * amount;
const profitText = profit >= 0 ? `Profit: $${profit.toFixed(2)}` : `Loss: $${Math.abs(profit).toFixed(2)}`;
resultDiv.textContent = profitText;
}
</script>
</body>
</html>
—
✅ Features:
- Fetches real-time prices from CoinGecko API
- Calculates profit or loss based on buy/sell prices and amount
- Provides a simple glossary for beginners
- Mobile-friendly and clean design
- No external libraries needed (pure HTML, CSS, JS)
—
Would you also like a version with:
- Dark mode toggle?
- More coins?
- Local storage to save favorite coins?
- A simple portfolio tracker?
Let me know! 🚀