diff --git a/client/game.js b/client/game.js index 1d694cc..a42e70b 100644 --- a/client/game.js +++ b/client/game.js @@ -645,7 +645,7 @@ class CardGame { this.animateDrawCards(data.forced_draw_player_id, data.forced_draw_count); }, 300); - const cardName = `${data.top_card.rank}${this.getSuitSymbol(data.top_card.suit)}`; + const cardName = `${data.top_card.rank}${this.getSuitSymbolForLog(data.top_card.suit)}`; const cardsText = data.forced_draw_count === 1 ? '1 карту' : `${data.forced_draw_count} карты`; this.addLogEntry(`${data.forced_draw_player_nickname} взял ${cardsText} от ${cardName}`); } @@ -702,7 +702,7 @@ class CardGame { } // Логируем событие - const cardName = `${data.card.rank}${this.getSuitSymbol(data.card.suit)}`; + const cardName = `${data.card.rank} ${this.getSuitSymbolForLog(data.card.suit)}`; this.addLogEntry(`${data.player_nickname} сыграл ${cardName}`); // Если выбрана масть дамой @@ -748,7 +748,7 @@ class CardGame { const cardsText = data.cards_count === 1 ? '1 карту' : `${data.cards_count} карты`; if (data.waiting_for_eight) { const topCard = data.top_card; - this.addLogEntry(`${data.player_nickname} взял ${cardsText} от ${topCard.rank}${this.getSuitSymbol(topCard.suit)}`); + this.addLogEntry(`${data.player_nickname} взял ${cardsText} от ${topCard.rank} ${this.getSuitSymbolForLog(topCard.suit)}`); } else { const cardsText = data.cards_count === 1 ? 'карту' : 'карты'; this.addLogEntry(`${data.player_nickname} взял ${data.cards_count} ${cardsText}`); @@ -1143,7 +1143,9 @@ class CardGame { // Показываем индикатор всегда когда есть выбранная масть (после дамы) if (data.chosen_suit) { this.chosenSuitIndicator.style.display = 'block'; - this.chosenSuitIndicator.textContent = this.getSuitSymbol(data.chosen_suit); + const suitEmoji = this.getSuitSymbol(data.chosen_suit); + const suitClass = data.chosen_suit; // hearts, diamonds, clubs, spades + this.chosenSuitIndicator.innerHTML = `${suitEmoji}`; } else { this.chosenSuitIndicator.style.display = 'none'; } @@ -1380,6 +1382,16 @@ class CardGame { return symbols[suit] || ''; } + getSuitSymbolForLog(suit) { + const symbols = { + 'hearts': '♥️', + 'diamonds': '♦️', + 'clubs': '♣️', + 'spades': '♠️' + }; + return symbols[suit] || ''; + } + getSuitName(suit) { const names = { 'hearts': 'черви', @@ -1510,7 +1522,7 @@ class CardGame { const entry = document.createElement('div'); entry.className = extraClass ? `log-entry ${extraClass}` : 'log-entry'; - entry.textContent = message; + entry.innerHTML = message; // Добавляем в начало (новые сверху) this.gameLog.insertBefore(entry, this.gameLog.firstChild); diff --git a/client/night-mode.css b/client/night-mode.css index da09286..7465fc0 100644 --- a/client/night-mode.css +++ b/client/night-mode.css @@ -385,7 +385,7 @@ body.night-mode .card { background: #9ca3af; color: white; border-color: #374151; - filter: brightness(0.8); + filter: brightness(0.9); transition: all 0.3s ease; } @@ -399,6 +399,7 @@ body.night-mode .card.hearts .card-suit, body.night-mode .card.diamonds .card-rank, body.night-mode .card.diamonds .card-suit { color: #ffffff; + filter: grayscale(1) contrast(1) brightness(3) drop-shadow(rgba(189, 189, 189, 0.79) 0px 0px 1px); } body.night-mode .card.spades, @@ -411,11 +412,6 @@ body.night-mode .card.spades .card-suit, body.night-mode .card.clubs .card-rank, body.night-mode .card.clubs .card-suit { color: #1a1a1a; -} - -body.night-mode .card .card-rank, -body.night-mode .card .card-suit { - color: inherit; filter: contrast(4) saturate(0.5) drop-shadow(0px 0px 1px #333333c9); } @@ -490,11 +486,23 @@ body.night-mode .chosen-suit-label { /* Индикатор выбранной масти */ body.night-mode #chosen-suit-indicator { - background: rgb(206 207 207); + background: rgb(140 147 157); border-color: #5ecc7b; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6); } +/* Красные масти в индикаторе делаем белыми */ +body.night-mode .suit-emoji-indicator.hearts, +body.night-mode .suit-emoji-indicator.diamonds { + filter: grayscale(1) contrast(1) brightness(3) drop-shadow(rgba(189, 189, 189, 0.79) 0px 0px 1px); +} + +/* Чёрные масти в индикаторе */ +body.night-mode .suit-emoji-indicator.clubs, +body.night-mode .suit-emoji-indicator.spades { + filter: contrast(4) saturate(0.5) drop-shadow(0px 0px 1px #333333c9); +} + /* Player info - табло игрока */ body.night-mode .player-info { background: rgba(42, 61, 82, 0.95); @@ -645,8 +653,37 @@ body.night-mode .suit-btn { color: #ffffff; } -body.night-mode .suit-emoji { - filter: contrast(4) saturate(0.5) drop-shadow(0px 0px 4px #333333c9); +/* Красные масти в suit-selector делаем белыми */ +body.night-mode .suit-btn[data-suit="hearts"] .suit-emoji, +body.night-mode .suit-btn[data-suit="diamonds"] .suit-emoji { + filter: grayscale(1) contrast(1) brightness(3) drop-shadow(rgba(189, 189, 189, 0.79) 0px 0px 1px); +} + +/* Черные масти в suit-selector */ +body.night-mode .suit-btn[data-suit="spades"] .suit-emoji, +body.night-mode .suit-btn[data-suit="clubs"] .suit-emoji { + filter: contrast(4) saturate(0.5) drop-shadow(0px 0px 1px #333333c9); +} + +/* Suit symbols (анимация выбора масти) */ +body.night-mode .suit-symbol { + background: #2a3d52; + border-color: #3b5998; +} + +body.night-mode .suit-symbol.hearts, +body.night-mode .suit-symbol.diamonds { + filter: grayscale(1) contrast(1) brightness(3) drop-shadow(rgba(189, 189, 189, 0.79) 0px 0px 1px); +} + +body.night-mode .suit-symbol.clubs, +body.night-mode .suit-symbol.spades { + color: #ffffff; + filter: contrast(4) saturate(0.5) drop-shadow(0px 0px 1px #333333c9); +} + +body.night-mode .suit-arrow { + color: #5ecc7b; } /* Results modal */ @@ -694,6 +731,7 @@ body.night-mode .result-card.hearts .card-suit, body.night-mode .result-card.diamonds .card-rank, body.night-mode .result-card.diamonds .card-suit { color: #ffffff; + filter: grayscale(1) contrast(1) brightness(3) drop-shadow(rgba(189, 189, 189, 0.79) 0px 0px 1px); } body.night-mode .result-card.spades, @@ -706,6 +744,7 @@ body.night-mode .result-card.spades .card-suit, body.night-mode .result-card.clubs .card-rank, body.night-mode .result-card.clubs .card-suit { color: #1a1a1a; + filter: contrast(4) saturate(0.5) drop-shadow(0px 0px 1px #333333c9); } /* Game log */ @@ -723,6 +762,18 @@ body.night-mode .log-entry.highlight { color: #5ecc7b; } +/* Красные масти в чате (логе) делаем белыми */ +body.night-mode .suit-emoji-log.hearts, +body.night-mode .suit-emoji-log.diamonds { + filter: grayscale(1) contrast(1) brightness(3) drop-shadow(rgba(189, 189, 189, 0.79) 0px 0px 1px); +} + +/* Чёрные масти в чате (логе) */ +body.night-mode .suit-emoji-log.clubs, +body.night-mode .suit-emoji-log.spades { + filter: contrast(4) saturate(0.5) drop-shadow(0px 0px 1px #c7c7c73c); +} + /* Error screen */ body.night-mode #error-screen { background: #1a2332;