88 lines
2.1 KiB
Plaintext
88 lines
2.1 KiB
Plaintext
<style>
|
|
body {
|
|
font-family: Arial, sans-serif;
|
|
max-width: 960px;
|
|
margin: 40px auto;
|
|
padding: 0 16px;
|
|
background: #111;
|
|
color: #f5f5f5;
|
|
}
|
|
|
|
h1 {
|
|
margin-bottom: 12px;
|
|
}
|
|
|
|
button {
|
|
background: #ff6b00;
|
|
color: white;
|
|
border: none;
|
|
padding: 12px 18px;
|
|
border-radius: 8px;
|
|
cursor: pointer;
|
|
font-size: 16px;
|
|
}
|
|
|
|
.stats, .cards {
|
|
margin-top: 24px;
|
|
}
|
|
|
|
.card {
|
|
border: 1px solid #333;
|
|
border-radius: 10px;
|
|
padding: 12px;
|
|
margin-bottom: 10px;
|
|
background: #1a1a1a;
|
|
}
|
|
|
|
.meta {
|
|
color: #4ade80;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.non-meta {
|
|
color: #f87171;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.muted {
|
|
color: #aaa;
|
|
font-size: 14px;
|
|
}
|
|
</style>
|
|
|
|
<h1>Clash Deck Generator</h1>
|
|
<p>Generate a deck based on roles, meta cards, and special slot rules.</p>
|
|
|
|
<form action="/decks/generate" method="post">
|
|
<button type="submit">Generate deck</button>
|
|
</form>
|
|
|
|
<% if deck.any? %>
|
|
<div class="stats">
|
|
<h2>Deck stats</h2>
|
|
<p><strong>Average elixir:</strong> <%= stats[:average_elixir] %></p>
|
|
<p><strong>Meta cards:</strong> <%= stats[:meta_cards_count] %></p>
|
|
<p><strong>Spells:</strong> <%= stats[:spells_count] %></p>
|
|
<p><strong>Troops:</strong> <%= stats[:troops_count] %></p>
|
|
<p><strong>Buildings:</strong> <%= stats[:buildings_count] %></p>
|
|
<p><strong>Champions:</strong> <%= stats[:champions_count] %></p>
|
|
<p><strong>Heroes:</strong> <%= stats[:heroes_count] %></p>
|
|
<p><strong>Evolutions:</strong> <%= stats[:evolutions_count] %></p>
|
|
</div>
|
|
|
|
<div class="cards">
|
|
<h2>Deck cards</h2>
|
|
|
|
<% deck.each_with_index do |card, index| %>
|
|
<% meta_class = card.is_meta == 1 ? "meta" : "non-meta" %>
|
|
<% meta_text = card.is_meta == 1 ? "META" : "NON-META" %>
|
|
|
|
<div class="card">
|
|
<div><strong><%= index + 1 %>. <%= card.name %></strong></div>
|
|
<div class="muted"><%= card.rarity %> | <%= card.type %> | <%= card.elixir_cost %> elixir</div>
|
|
<div class="<%= meta_class %>"><%= meta_text %></div>
|
|
<div class="muted">Roles: <%= roles_repo.roles_for(card.name).join(", ") %></div>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
<% end %> |