This commit is contained in:
2026-01-27 22:52:44 +03:00
parent dedc2635f2
commit 14d46962d4
5 changed files with 569 additions and 71 deletions

View File

@ -444,6 +444,7 @@
<div class="opponent-name ${isDead ? 'defeated-name' : ''}">${escapeHtml(name)}${isDead ? ' <span class="defeated-badge">✝</span>' : ''}</div>
<div class="opponent-stats ${isDead ? 'defeated-stats' : ''}">
<span class="opponent-health">❤ ${p.health ?? 30}</span>
${(p.armor || 0) > 0 ? `<span class="opponent-armor">🛡 ${p.armor}</span>` : ''}
<span>🔵 ${p.mana ?? 0}/${p.maxMana ?? 0}</span>
${p.deck && p.deck.length > 0 ? `<span>📚 ${p.deck.length}</span>` : ''}
</div>
@ -779,6 +780,18 @@
setTimeout(() => healthEl.classList.remove('health-changed'), 500);
}
}
// Отображение брони
const armorEl = $('your-armor');
const armorDisplayEl = $('armor-display');
if (armorEl && armorDisplayEl) {
const armor = state.isSpectator ? 0 : (state.yourArmor || you?.armor || 0);
armorEl.textContent = armor;
if (armor > 0) {
armorDisplayEl.style.display = 'inline-flex';
} else {
armorDisplayEl.style.display = 'none';
}
}
$('your-deck').textContent = state.yourDeckCount ?? you.deck?.length ?? 0;
const lastLog = state.log && state.log.length ? state.log[state.log.length - 1] : null;

View File

@ -197,6 +197,10 @@
<i class="swg swg-deathstar health-icon" aria-hidden="true"></i>
<span id="your-health">30</span>
</span>
<span class="armor-display" id="armor-display" style="display: none;">
<i class="swg swg-deathstar armor-icon" aria-hidden="true"></i>
<span id="your-armor">0</span>
</span>
<span class="deck-count"><i class="swg swg-galrep deck-icon" aria-hidden="true"></i><span id="your-deck">0</span> в колоде</span>
</div>
<div class="header-center">

View File

@ -735,6 +735,9 @@ html, body {
z-index: 11;
}
.opponent-name { font-weight: 700; color: var(--cyan); margin-bottom: 0.35rem; font-size: 0.95rem; }
.opponent-armor { color: #5eb3e8; font-weight: 600; }
.armor-display { color: #5eb3e8; font-weight: 600; margin-left: 0.5rem; }
.armor-icon { color: #5eb3e8; }
.opponent-name.defeated-name {
text-decoration: line-through;
color: #666;
@ -2421,6 +2424,7 @@ html, body {
width: 100%;
justify-content: space-between;
flex-wrap: wrap;
gap: 0.4rem;
gap: 0.5rem;
}
@ -2431,18 +2435,25 @@ html, body {
}
.btn {
min-height: 44px;
padding: 0.85rem 1.5rem;
font-size: 1rem;
min-height: 40px;
padding: 0.6rem 1.2rem;
font-size: 0.9rem;
touch-action: manipulation;
}
.btn-end-turn {
min-height: 48px;
padding: 0.7rem 1.6rem;
font-size: 1.05rem;
min-height: 40px;
padding: 0.5rem 1rem;
font-size: 0.9rem;
flex: 1;
min-width: 120px;
min-width: 100px;
}
.btn-forge, .btn-hero-ability, .btn-draw-card {
min-height: 38px;
padding: 0.45rem 0.9rem;
font-size: 0.85rem;
min-width: 70px;
}
.btn-instructions, .btn-settings {
@ -2454,19 +2465,43 @@ html, body {
}
.card-wrap {
width: 140px;
height: 196px;
width: 120px;
height: 168px;
touch-action: manipulation;
}
.board .card-wrap {
width: 100px;
height: 140px;
width: 85px;
height: 119px;
}
.opponents .card-wrap {
width: 100px;
height: 140px;
width: 85px;
height: 119px;
}
/* Уменьшаем текст на картах для средних мобильных */
.card-name {
font-size: 0.7rem !important;
}
.card-cost {
font-size: 0.8rem !important;
width: 20px !important;
height: 20px !important;
}
.card-stats {
font-size: 0.75rem !important;
}
.card-stats .atk, .card-stats .hp {
font-size: 0.75rem !important;
}
.card-text {
font-size: 0.65rem !important;
-webkit-line-clamp: 3 !important;
}
.opponents {
@ -2491,7 +2526,7 @@ html, body {
}
.hand .card-wrap {
margin-left: -30px;
margin-left: -25px;
scroll-snap-align: start;
flex-shrink: 0;
}
@ -2511,19 +2546,19 @@ html, body {
}
.deck-fan {
width: 90px;
height: 126px;
width: 80px;
height: 112px;
flex-shrink: 0;
}
.deck-stack {
width: 85px;
height: 120px;
width: 75px;
height: 105px;
}
.deck-stack .deck-card {
width: 85px;
height: 120px;
width: 75px;
height: 105px;
}
.board {
@ -2704,54 +2739,224 @@ html, body {
padding: 1rem;
}
/* Уменьшаем карты */
.card-wrap {
width: 120px;
height: 168px;
width: 100px;
height: 140px;
}
.board .card-wrap {
width: 85px;
height: 119px;
width: 70px;
height: 98px;
}
.opponents .card-wrap {
width: 85px;
height: 119px;
width: 70px;
height: 98px;
}
.hand .card-wrap {
margin-left: -35px;
margin-left: -25px;
}
.hand-container {
min-height: 160px;
min-height: 140px;
padding: 0.25rem;
}
.hand {
gap: 0.2rem;
padding: 0.25rem;
}
/* Уменьшаем колоду */
.deck-fan {
width: 70px;
height: 98px;
}
.deck-stack {
width: 65px;
height: 91px;
}
.deck-stack .deck-card {
width: 65px;
height: 91px;
}
/* Уменьшаем заголовок игры */
.game-header {
padding: 0.5rem;
font-size: 0.9rem;
padding: 0.4rem;
font-size: 0.75rem;
gap: 0.3rem;
}
.header-left, .header-center, .header-right {
gap: 0.3rem;
}
/* Маленькие кнопки */
.btn {
padding: 0.75rem 1.2rem;
font-size: 0.95rem;
padding: 0.4rem 0.7rem;
font-size: 0.75rem;
min-height: 36px;
border-radius: 6px;
}
.btn-end-turn {
padding: 0.4rem 0.8rem;
font-size: 0.8rem;
min-height: 36px;
min-width: 80px;
}
.btn-forge, .btn-hero-ability, .btn-draw-card {
padding: 0.35rem 0.6rem;
font-size: 0.7rem;
min-height: 32px;
min-width: 60px;
}
.btn-instructions, .btn-settings {
width: 32px;
height: 32px;
font-size: 0.9rem;
min-width: 32px;
min-height: 32px;
}
/* Уменьшаем текст на картах */
.card-name {
font-size: 0.6rem !important;
line-height: 1.1 !important;
}
.card-cost {
font-size: 0.75rem !important;
width: 18px !important;
height: 18px !important;
}
.card-stats {
font-size: 0.7rem !important;
gap: 0.3rem !important;
}
.card-stats .atk, .card-stats .hp {
font-size: 0.7rem !important;
}
.card-text {
font-size: 0.55rem !important;
line-height: 1.2 !important;
-webkit-line-clamp: 3 !important;
margin-bottom: 0.2rem !important;
}
.card-info {
padding: 0.3rem !important;
}
/* Уменьшаем доски */
.board {
min-height: 100px;
padding: 0.3rem;
}
.your-board {
min-height: 90px;
padding: 0.3rem;
}
.opponent-block {
padding: 0.3rem;
}
.opponent-name {
font-size: 0.75rem;
}
.opponent-stats {
font-size: 0.7rem;
}
/* Уменьшаем статистику игрока */
#your-mana, #your-max-mana, #your-health {
font-size: 1rem;
}
#your-name {
font-size: 0.85rem;
}
/* Уменьшаем анонсы */
.attack-announcement {
font-size: 1.5rem;
padding: 1.5rem 2rem;
font-size: 1.2rem;
padding: 1rem 1.5rem;
}
/* Уменьшаем модальные окна */
.modal {
padding: 1rem;
padding: 0.75rem;
max-width: 95vw;
}
.modal h2 {
font-size: 1.1rem;
}
.modal p {
font-size: 0.85rem;
}
/* Галерея карт */
.cards-gallery-grid {
grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
gap: 0.5rem;
}
.gallery-card {
width: 85px !important;
height: 119px !important;
width: 70px !important;
height: 98px !important;
}
/* Уменьшаем чат */
.chat-container {
width: calc(100vw - 10px);
right: 5px;
bottom: 5px;
max-height: 250px;
}
.chat-content {
height: 200px;
}
.chat-messages {
font-size: 0.75rem;
padding: 0.5rem;
}
/* Уменьшаем кузницу */
.forge-sidebar {
padding: 0.5rem;
}
.forge-cards-list .card-wrap {
width: 80px;
height: 112px;
}
/* Уменьшаем лог игры */
#game-log {
font-size: 0.7rem;
max-width: 150px;
}
/* Уменьшаем таймер */
.turn-timer {
font-size: 0.75rem;
padding: 0.3rem 0.6rem;
}
}