Pennyalpha / templates /index.html
Sergidev's picture
Update templates/index.html
307c7a3 verified
raw
history blame
2.88 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Pennyflip</title>
<link rel="stylesheet" href="{{ url_for('static', filename='styles.css') }}">
</head>
<body>
<div id="game-container">
<h1>Pennyflip</h1>
<div id="info">
Balance: $<span id="balance">0.00</span> | Flips left: <span id="flips-left">1000</span>
</div>
<div id="coin"></div>
<div id="shop">
{% for coin in coins %}
<div class="shop-item" data-index="{{ loop.index0 }}">
<div class="shop-coin" style="background-color: {{ coin.color }}">
<span class="coin-price">${{ "%.2f"|format(coin.price) }}</span>
</div>
<div class="coin-name">{{ coin.name }}</div>
<div class="coin-tooltip">
<strong>{{ coin.name }}</strong><br>
Cost: ${{ "%.2f"|format(coin.price) }}<br>
Value: ${{ "%.2f"|format(coin.value) }}<br>
Win rate: {{ "%.2f"|format(coin.winrate) }}<br>
{% if coin.ability %}
Ability: {{ coin.ability }}
{% endif %}
</div>
</div>
{% endfor %}
</div>
<button id="generate-coin">Generate New Coin ($4)</button>
<div id="leaderboard">
<h2>Leaderboard</h2>
<table>
<thead>
<tr>
<th>Rank</th>
<th>Initials</th>
<th>Score</th>
</tr>
</thead>
<tbody>
{% for entry in leaderboard %}
<tr>
<td>{{ loop.index }}</td>
<td>{{ entry.initials }}</td>
<td>${{ "%.2f"|format(entry.score) }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div id="game-over" class="modal">
<div class="modal-content">
<h2>Game Over</h2>
<p>Your final score: $<span id="final-score"></span></p>
<input type="text" id="initials" maxlength="3" placeholder="Enter your initials">
<button id="submit-score">Submit Score</button>
<button id="play-again">Play Again</button>
</div>
</div>
<div id="loading-overlay">
<div class="loading-message">Generating coin...</div>
</div>
</div>
<script>
var coins = {{ coins|tojson|safe }};
</script>
<script src="{{ url_for('static', filename='script.js') }}"></script>
</body>
</html>