Untitled

 avatar
user_7910178
plain_text
17 days ago
2.9 kB
1
Indexable
Never
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>My Trading Platform</title>
  <style>
    body {
      font-family: Arial, sans-serif;
      margin: 0;
      padding: 0;
      background-color: #f5f6fa;
    }
    header {
      background-color: #2f3640;
      color: white;
      padding: 20px;
      text-align: center;
    }
    .container {
      padding: 20px;
    }
    .market-section {
      display: flex;
      justify-content: space-between;
    }
    .market-section div {
      width: 30%;
      background-color: white;
      padding: 10px;
      border-radius: 8px;
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }
    .market-section div h2 {
      text-align: center;
    }
    button {
      padding: 10px 20px;
      background-color: #273c75;
      color: white;
      border: none;
      border-radius: 5px;
      cursor: pointer;
    }
    button:hover {
      background-color: #192a56;
    }
  </style>
</head>
<body>
  <header>
    <h1>My Trading Platform</h1>
  </header>

  <div class="container">
    <h2>Live Market Prices</h2>
    <div class="market-section">
      <div>
        <h2>BTC/USD</h2>
        <p>Price: <span id="btcPrice">...</span></p>
        <button onclick="buyBTC()">Buy</button>
        <button onclick="sellBTC()">Sell</button>
      </div>
      <div>
        <h2>ETH/USD</h2>
        <p>Price: <span id="ethPrice">...</span></p>
        <button onclick="buyETH()">Buy</button>
        <button onclick="sellETH()">Sell</button>
      </div>
      <div>
        <h2>LTC/USD</h2>
        <p>Price: <span id="ltcPrice">...</span></p>
        <button onclick="buyLTC()">Buy</button>
        <button onclick="sellLTC()">Sell</button>
      </div>
    </div>
  </div>

  <script>
    // Mock price data (in a real platform, use API calls for live data)
    let btcPrice = 40000;
    let ethPrice = 3000;
    let ltcPrice = 150;

    // Update market prices on the page
    document.getElementById('btcPrice').innerText = btcPrice;
    document.getElementById('ethPrice').innerText = ethPrice;
    document.getElementById('ltcPrice').innerText = ltcPrice;

    // Example functions for trading actions
    function buyBTC() {
      alert("You bought 1 BTC at $" + btcPrice);
    }

    function sellBTC() {
      alert("You sold 1 BTC at $" + btcPrice);
    }

    function buyETH() {
      alert("You bought 1 ETH at $" + ethPrice);
    }

    function sellETH() {
      alert("You sold 1 ETH at $" + ethPrice);
    }

    function buyLTC() {
      alert("You bought 1 LTC at $" + ltcPrice);
    }

    function sellLTC() {
      alert("You sold 1 LTC at $" + ltcPrice);
    }
  </script>
</body>
</html>
Leave a Comment