ui tweak
This commit is contained in:
@@ -12,8 +12,7 @@ window.renderTowns = function() {
|
||||
// Get active filters
|
||||
const searchTerm = (document.getElementById('town-search')?.value || '').toLowerCase();
|
||||
const reqFullWh = document.getElementById('filter-full-wh')?.checked;
|
||||
const reqFestival = document.getElementById('filter-festival')?.checked;
|
||||
const reqPoints = document.getElementById('filter-points')?.checked;
|
||||
const reqNotBuilding = document.getElementById('filter-not-building')?.checked;
|
||||
|
||||
const filteredTowns = window.towns.filter(t => {
|
||||
// 1. Search by name
|
||||
@@ -29,13 +28,8 @@ window.renderTowns = function() {
|
||||
// 2. Full WH (>95%)
|
||||
if (reqFullWh && Math.max(wPct, sPct, iPct) < 0.95) return false;
|
||||
|
||||
// 3. Festival (Wood>15k, Stone>18k, Iron>15k)
|
||||
// City Festival exact costs = 15000, 18000, 15000
|
||||
if (reqFestival && ((res.wood || 0) < 15000 || (res.stone || 0) < 18000 || (res.iron || 0) < 15000)) return false;
|
||||
|
||||
// 4. Large Points
|
||||
const pts = typeof t.points === 'number' ? t.points : parseInt(t.points) || 0;
|
||||
if (reqPoints && pts < 10000) return false;
|
||||
// 3. Not Building (no items in build_queue)
|
||||
if (reqNotBuilding && t.build_queue && t.build_queue.length > 0) return false;
|
||||
|
||||
return true;
|
||||
});
|
||||
@@ -62,9 +56,6 @@ window.renderTowns = function() {
|
||||
if (wPct >= 0.95 || sPct >= 0.95 || iPct >= 0.95) {
|
||||
markers += '<span title="Γεμάτη Αποθήκη!" style="margin-right:4px;">⚠️</span>';
|
||||
}
|
||||
if ((res.wood || 0) >= 15000 && (res.stone || 0) >= 18000 && (res.iron || 0) >= 15000) {
|
||||
markers += '<span title="Αρκετοί πόροι για Φεστιβάλ!" style="margin-right:4px;">🎭</span>';
|
||||
}
|
||||
|
||||
const getC = (pct) => pct >= 0.95 ? 'color:#ff4a4a;font-weight:bold;' : '';
|
||||
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
|
||||
<header>
|
||||
<h1><a href="/" style="text-decoration: none; margin-right: 15px; cursor: pointer;" title="Back to Players">⬅️</a> ⚔️ Grepolis Remote</h1>
|
||||
<div class="status-indicator">
|
||||
<div class="status-indicator" style="display: flex; align-items: center; gap: 10px;">
|
||||
<button class="btn btn-gold btn-sm" id="live-btn" onclick="window.requestLiveSync()" title="Request immediate data update from game" style="padding: 4px 8px; font-size: 0.72rem; border-radius: 4px; border: 1px solid #c8a44a;">⚡ Live Sync</button>
|
||||
<div id="server-status" class="conn-badge">Server…</div>
|
||||
<div id="client-status" class="conn-badge">Client…</div>
|
||||
</div>
|
||||
@@ -29,7 +30,6 @@
|
||||
<div id="town-panel">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;">
|
||||
<h2 style="margin: 0;">Towns</h2>
|
||||
<button class="btn btn-gold btn-sm" id="live-btn" onclick="window.requestLiveSync()" title="Request immediate data update from game" style="padding: 4px 8px; font-size: 0.72rem;">⚡ Live Sync</button>
|
||||
</div>
|
||||
|
||||
<div id="town-filters" style="margin-bottom: 15px; padding: 10px; background: #0f3460; border-radius: 6px; border: 1px solid #2a4a6a;">
|
||||
@@ -41,11 +41,7 @@
|
||||
</label>
|
||||
|
||||
<label style="font-size: 0.8rem; cursor: pointer; display: flex; align-items: center; gap: 4px; background: rgba(0,0,0,0.2); padding: 4px 8px; border-radius: 12px; border: 1px solid #2a4a6a;">
|
||||
<input type="checkbox" id="filter-festival" onchange="window.renderTowns()"> 🎭 Ελεύθεροι Πόροι
|
||||
</label>
|
||||
|
||||
<label style="font-size: 0.8rem; cursor: pointer; display: flex; align-items: center; gap: 4px; background: rgba(0,0,0,0.2); padding: 4px 8px; border-radius: 12px; border: 1px solid #2a4a6a;">
|
||||
<input type="checkbox" id="filter-points" onchange="window.renderTowns()"> 📈 10k+ Πόντοι
|
||||
<input type="checkbox" id="filter-not-building" onchange="window.renderTowns()"> 🏗️ Δεν χτίζει
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user