@if (DealerHand.IndexOf(card) == 0 && IsPlayerTurn)
{
-
+
}
else
{
@@ -185,15 +185,26 @@
{
if (!IsPlayerTurn || IsGameOver) return;
- PlayerHand.Add(GameDeck.DealCard());
+ var newCard = GameDeck.DealCard();
+ if (newCard != null)
+ {
+ PlayerHand.Add(newCard);
- if (PlayerScore > 21)
- {
- EndGame("Перебор! Вы проиграли.");
+ if (PlayerScore > 21)
+ {
+ EndGame("Перебор! Вы проиграли.");
+ }
+ else if (PlayerScore == 21)
+ {
+ PlayerStand();
+ }
}
- else if (PlayerScore == 21)
+ else
{
- PlayerStand();
+ // Колода пуста, можно обработать этот случай
+ GameMessage = "Колода пуста! Создается новая колода...";
+ GameDeck = new Deck();
+ GameDeck.Shuffle();
}
StateHasChanged();
diff --git a/Components/Pages/BlackjackGame.razor.css b/Components/Pages/BlackjackGame.razor.css
index bfe00b4..1773b7b 100644
--- a/Components/Pages/BlackjackGame.razor.css
+++ b/Components/Pages/BlackjackGame.razor.css
@@ -1,5 +1,5 @@
:root {
- /* Обновленная цветовая палитра - более яркие и контрастные цвета */
+ /* Цветовая палитра */
--casino-green: #2a9d8f;
--casino-dark-green: #226f66;
--felt-green: #40a886;
@@ -13,26 +13,55 @@
--gray: #7d8597;
--light-gray: #f1f3f5;
--blue: #3a86ff;
- /* Улучшенные тени и эффекты - без затемнений */
- --card-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
+ /* Общие эффекты */
+ --card-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
--button-shadow: 0 6px 0 var(--dark-gold);
--transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
- --text-shadow: none;
}
-/* Основной фон казино - убрано затемнение */
+/* Базовая структура страницы */
.casino-background {
- background-image: url('_content/БлэкДжек/images/casino-bg.jpg');
- background-size: cover;
- background-position: center;
+ background: linear-gradient(135deg, #2c3e50, #4a6572, #2c3e50);
+ background-size: 400% 400%;
+ animation: gradient 15s ease infinite;
min-height: 100vh;
- padding: 2rem;
+ padding: 20px;
box-sizing: border-box;
display: flex;
justify-content: center;
align-items: center;
font-family: 'Poppins', 'Montserrat', sans-serif;
color: var(--white);
+ position: relative;
+ overflow-x: hidden;
+}
+
+/* Анимация градиентного фона */
+@keyframes gradient {
+ 0% {
+ background-position: 0% 50%;
+ }
+
+ 50% {
+ background-position: 100% 50%;
+ }
+
+ 100% {
+ background-position: 0% 50%;
+ }
+}
+
+/* Текстура фона */
+.casino-background::before {
+ content: "";
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background-image: radial-gradient(circle at 25px 25px, rgba(255, 255, 255, 0.1) 2px, transparent 0);
+ background-size: 100px 100px;
+ pointer-events: none;
}
/* Основной контейнер игры */
@@ -40,25 +69,13 @@
width: 100%;
max-width: 1000px;
background: linear-gradient(145deg, var(--casino-green), var(--casino-dark-green));
- border-radius: 24px;
- box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
- padding: 2.5rem;
+ border-radius: 20px;
+ box-shadow: 0 12px 25px rgba(0, 0, 0, 0.3);
+ padding: 30px;
position: relative;
- overflow: hidden;
- border: 8px solid var(--wood-brown);
-}
-
-/* Декоративный элемент с фишками */
-.chip-stack {
- background-image: url('_content/БлэкДжек/images/chips-stack.png');
- background-size: contain;
- background-repeat: no-repeat;
- width: 90px;
- height: 90px;
- position: absolute;
- right: 2rem;
- top: 2rem;
- filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.2));
+ border: 6px solid var(--wood-brown);
+ display: flex;
+ flex-direction: column;
}
/* Заголовок игры */
@@ -67,156 +84,244 @@
justify-content: center;
align-items: center;
position: relative;
- margin-bottom: 2.5rem;
+ margin-bottom: 20px;
}
.game-title {
color: var(--light-gold);
text-transform: uppercase;
text-align: center;
- font-size: 3.2rem;
+ font-size: 3rem;
margin: 0;
- letter-spacing: 4px;
+ letter-spacing: 3px;
font-weight: 800;
position: relative;
+ z-index: 2;
}
.game-title::after {
content: '';
position: absolute;
- bottom: -12px;
+ bottom: -10px;
left: 50%;
transform: translateX(-50%);
width: 70%;
- height: 4px;
+ height: 3px;
background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
-/* Область сообщений - улучшена читаемость */
+/* Стопка фишек - декоративный элемент */
+.chip-stack {
+ width: 70px;
+ height: 70px;
+ position: absolute;
+ right: 0;
+ top: 0;
+ filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ z-index: 1;
+}
+
+ .chip-stack::before {
+ content: "";
+ width: 60px;
+ height: 10px;
+ background: linear-gradient(to right, var(--red), var(--gold), var(--blue), var(--black));
+ border-radius: 5px;
+ position: absolute;
+ top: 20px;
+ transform: rotate(-15deg);
+ }
+
+ .chip-stack::after {
+ content: "";
+ width: 60px;
+ height: 60px;
+ background: conic-gradient(var(--gold) 0deg 60deg, var(--blue) 60deg 120deg, var(--red) 120deg 240deg, var(--black) 240deg 360deg);
+ border-radius: 50%;
+ position: absolute;
+ top: 0;
+ border: 2px solid rgba(0,0,0,0.2);
+ box-shadow: 0 5px 15px rgba(0,0,0,0.3);
+ }
+
+/* Область сообщений */
.message-box {
- background-color: #ffffff;
- border-left: 6px solid var(--gold);
- padding: 1.2rem;
- margin: 1.2rem auto 2.2rem;
+ background-color: var(--white);
+ border-left: 5px solid var(--gold);
+ padding: 15px 20px;
+ margin: 0 auto 25px;
color: var(--black);
- border-radius: 10px;
- box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
+ border-radius: 8px;
+ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
text-align: center;
max-width: 85%;
transition: var(--transition);
+ z-index: 2;
+ position: relative;
}
.message-win {
- border-left: 6px solid #4caf50;
+ border-left: 5px solid #4caf50;
background-color: #e8f5e9;
color: #2e7d32;
}
.message-lose {
- border-left: 6px solid var(--red);
+ border-left: 5px solid var(--red);
background-color: #ffebee;
color: #c62828;
}
.message-info {
- border-left: 6px solid var(--blue);
+ border-left: 5px solid var(--blue);
background-color: #e1f5fe;
color: #0277bd;
}
.message-content {
- font-size: 1.3rem;
+ font-size: 1.2rem;
font-weight: 600;
letter-spacing: 0.5px;
}
-/* Область игры */
+/* Основная игровая область */
.game-area {
background-color: var(--felt-green);
- border-radius: 20px;
- padding: 2.2rem;
- box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
+ border-radius: 16px;
+ padding: 25px;
+ box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.3);
position: relative;
- border: 4px solid var(--casino-dark-green);
+ border: 3px solid var(--casino-dark-green);
+ display: flex;
+ flex-direction: column;
}
-/* Стили секций игроков */
+ /* Текстура игрового стола */
+ .game-area::before {
+ content: "";
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background-image: repeating-linear-gradient(45deg, transparent, transparent 2px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.03) 4px);
+ border-radius: inherit;
+ z-index: 1;
+ pointer-events: none;
+ }
+
+/* Секции игроков */
.player-section {
- margin-bottom: 2.4rem;
position: relative;
+ z-index: 2;
+ margin-bottom: 15px;
}
+.player-section-user {
+ margin-top: 15px;
+ margin-bottom: 25px;
+}
+
+/* Информация об игроке */
.player-info {
display: flex;
align-items: center;
- gap: 1.2rem;
- margin-bottom: 1.2rem;
+ gap: 15px;
+ margin-bottom: 15px;
}
.player-avatar {
- width: 55px;
- height: 55px;
+ width: 50px;
+ height: 50px;
border-radius: 50%;
- background-position: center;
- background-size: cover;
- box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
+ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
border: 3px solid var(--gold);
+ position: relative;
+ overflow: hidden;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ background: #e8e8e8;
}
-.dealer-avatar {
- background-image: url('_content/БлэкДжек/images/dealer-avatar.png');
+/* Аватар дилера */
+.dealer-avatar::after {
+ content: "♠";
+ font-size: 30px;
+ color: var(--black);
+ text-shadow: 0 2px 2px rgba(0, 0, 0, 0.2);
}
+.dealer-avatar::before {
+ content: "";
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ height: 20px;
+ background: linear-gradient(to bottom, #3f51b5, transparent);
+}
+
+/* Аватар игрока */
.player-avatar-user {
- background-image: url('_content/БлэкДжек/images/player-avatar.png');
+ background: linear-gradient(135deg, #e4d9b4, #f8eecc);
}
+ .player-avatar-user::after {
+ content: "♥";
+ font-size: 30px;
+ color: var(--red);
+ text-shadow: 0 2px 2px rgba(0, 0, 0, 0.2);
+ }
+
+ .player-avatar-user::before {
+ content: "";
+ position: absolute;
+ bottom: -15px;
+ left: 0;
+ right: 0;
+ height: 30px;
+ border-radius: 50% 50% 0 0;
+ background: rgba(0,0,0,0.1);
+ }
+
+/* Заголовок игрока */
.player-title {
color: var(--white);
- font-size: 1.7rem;
+ font-size: 1.5rem;
margin: 0;
font-weight: 600;
letter-spacing: 0.5px;
+ display: flex;
+ align-items: center;
}
+/* Значок с очками */
.score-badge {
background: #ffffff;
- padding: 0.3rem 0.8rem;
+ padding: 5px 10px;
border-radius: 50px;
- font-size: 1.2rem;
- margin-left: 0.8rem;
+ font-size: 1.1rem;
+ margin-left: 10px;
color: var(--black);
border: 2px solid var(--dark-gold);
- box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
+ display: inline-block;
}
-.table-felt {
- background-color: var(--felt-green);
- padding: 1.2rem;
- border-radius: 16px;
- box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.3);
-}
-
-/* Карты в руке */
+/* Область для карт */
.hand {
display: flex;
flex-wrap: wrap;
- min-height: 170px;
- gap: 0.8rem;
- padding: 0.8rem;
+ min-height: 160px;
+ padding: 10px;
position: relative;
justify-content: center;
-}
-
-.dealer-hand::before {
- content: '';
- position: absolute;
- top: -12px;
- left: 50%;
- transform: translateX(-50%);
- width: 75%;
- height: 3px;
- background: linear-gradient(90deg, transparent, var(--gold), transparent);
+ gap: 10px;
+ z-index: 2;
}
/* Разделитель между дилером и игроком */
@@ -224,8 +329,9 @@
display: flex;
justify-content: center;
gap: 15px;
- margin: 2rem 0;
+ margin: 20px 0;
position: relative;
+ z-index: 2;
}
.table-divider::before {
@@ -234,18 +340,19 @@
top: 50%;
left: 5%;
right: 5%;
- height: 2px;
- background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
+ height: 1px;
+ background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
+ z-index: 1;
}
-/* Игральные фишки */
+/* Фишки на столе */
.chip {
- width: 40px;
- height: 40px;
+ width: 36px;
+ height: 36px;
border-radius: 50%;
- box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
+ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
position: relative;
- z-index: 1;
+ z-index: 2;
transition: transform 0.3s ease;
}
@@ -253,85 +360,186 @@
transform: translateY(-3px);
}
+ .chip::after {
+ content: "";
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ width: 24px;
+ height: 24px;
+ border-radius: 50%;
+ border: 1px dashed rgba(255, 255, 255, 0.5);
+ }
+
.red-chip {
background: radial-gradient(circle at 30% 30%, #ff8a8a 0%, var(--red) 60%);
- border: 3px dashed #ffc7c7;
+ border: 2px dashed #ffc7c7;
}
.blue-chip {
background: radial-gradient(circle at 30% 30%, #94d0ff 0%, var(--blue) 60%);
- border: 3px dashed #c5e5ff;
+ border: 2px dashed #c5e5ff;
}
.green-chip {
background: radial-gradient(circle at 30% 30%, #89e89c 0%, #3cac4c 60%);
- border: 3px dashed #d2f9db;
+ border: 2px dashed #d2f9db;
}
.black-chip {
background: radial-gradient(circle at 30% 30%, #a6aaaf 0%, var(--black) 60%);
- border: 3px dashed #e2e6eb;
+ border: 2px dashed #e2e6eb;
}
-/* Стили для контейнера карты */
+/* Контейнер карты */
.card-container {
position: relative;
- transform-style: preserve-3d;
- transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
- margin: 0.3rem;
+ perspective: 1000px;
+ margin: 5px;
+ z-index: 2;
}
.card-container.card-hidden {
transform: rotateY(0deg);
}
-/* Игральная карта */
+/* Игральная карта - базовый стиль */
.playing-card {
width: 110px;
height: 154px;
- background-color: var(--white);
- border-radius: 10px;
+ background-color: #ffffff;
+ border-radius: 8px;
box-shadow: var(--card-shadow);
position: relative;
+ transform-style: preserve-3d;
+ backface-visibility: hidden;
+ transition: transform 0.3s ease, box-shadow 0.3s ease;
+ border: 1px solid rgba(0, 0, 0, 0.15);
display: flex;
justify-content: center;
align-items: center;
- transform-style: preserve-3d;
- backface-visibility: hidden;
- border: 1px solid rgba(0, 0, 0, 0.15);
- transition: transform 0.3s ease, box-shadow 0.3s ease;
+ /* Удаляем линовку */
+ background-image: none;
}
+ /* Добавляем декоративную внутреннюю рамку для всех карт */
+ .playing-card::before {
+ content: "";
+ position: absolute;
+ top: 5px;
+ left: 5px;
+ right: 5px;
+ bottom: 5px;
+ border: 1px solid rgba(0, 0, 0, 0.1);
+ border-radius: 4px;
+ z-index: 1;
+ pointer-events: none;
+ }
+
+
+/* Улучшаем эффект при наведении */
.card-container:hover .playing-card {
- box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
- transform: translateY(-5px);
+ transform: translateY(-5px) rotate(1deg);
+ box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
}
-.card-back {
- background-color: #3f51b5;
- transform: rotateY(0deg);
+/* Рубашка карты - полностью переопределяем все стили */
+.playing-card.card-back {
+ /* Отключаем все ранее определённые фоны */
+ background: none;
+ background-color: #303f9f;
+ background-image: none !important;
position: relative;
- background: linear-gradient(145deg, #5c6bc0, #3949ab);
+ overflow: hidden;
}
-.card-back-design {
- width: 85%;
- height: 85%;
- background-image: url('_content/БлэкДжек/images/card-back.png');
- background-size: contain;
- background-repeat: no-repeat;
- background-position: center;
-}
+ /* Узор на рубашке */
+ .playing-card.card-back::before {
+ content: "";
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background-image: repeating-linear-gradient( 45deg, #3949ab, #3949ab 10px, #303f9f 10px, #303f9f 20px );
+ opacity: 0.7;
+ z-index: 1;
+ }
+ /* Символ в центре */
+ .playing-card.card-back::after {
+ content: "?";
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ font-size: 50px;
+ color: white;
+ z-index: 2;
+ text-shadow: 0 0 5px rgba(0,0,0,0.5);
+ }
+
+/* Фон для красных карт (червы и бубны) */
.card-red {
color: #e53935;
+ background: linear-gradient(135deg, #fff, #fff8f8);
}
+ /* Тонкий узор для красных карт */
+ .card-red::after {
+ content: "";
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ opacity: 0.05;
+ background-image: repeating-linear-gradient(45deg, #e53935, #e53935 10px, transparent 10px, transparent 20px), repeating-linear-gradient(-45deg, #e53935, #e53935 10px, transparent 10px, transparent 20px);
+ border-radius: 7px;
+ z-index: 1;
+ }
+
+/* Фон для черных карт (пики и трефы) */
.card-black {
color: #212121;
+ background: linear-gradient(135deg, #fff, #f8f8ff);
}
-/* Уголки карты */
+ /* Тонкий узор для черных карт */
+ .card-black::after {
+ content: "";
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ opacity: 0.05;
+ background-image: repeating-linear-gradient(45deg, #212121, #212121 10px, transparent 10px, transparent 20px), repeating-linear-gradient(-45deg, #212121, #212121 10px, transparent 10px, transparent 20px);
+ border-radius: 7px;
+ z-index: 1;
+ }
+
+
+/* Улучшение видимости содержимого карты */
+.card-corner, .card-center-suit {
+ position: relative;
+ z-index: 2;
+}
+
+/* Добавляем тень для масти в центре */
+.card-center-suit {
+ font-size: 3rem;
+ filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.2));
+}
+
+/* Эффект при наведении */
+.card-container:hover .playing-card {
+ transform: translateY(-5px) rotate(1deg);
+ box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
+}
+
+/* Углы карт */
.card-corner {
position: absolute;
display: flex;
@@ -341,27 +549,27 @@
}
.top-left {
- top: 8px;
- left: 8px;
+ top: 6px;
+ left: 6px;
}
.bottom-right {
- bottom: 8px;
- right: 8px;
+ bottom: 6px;
+ right: 6px;
transform: rotate(180deg);
}
.card-rank {
- font-size: 1.5rem;
+ font-size: 1.4rem;
font-weight: bold;
}
.card-suit {
- font-size: 1.3rem;
+ font-size: 1.2rem;
}
.card-center-suit {
- font-size: 3.2rem;
+ font-size: 3rem;
filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.1));
}
@@ -369,117 +577,146 @@
.action-buttons {
display: flex;
justify-content: center;
- gap: 2rem;
- margin-top: 2.5rem;
+ gap: 20px;
+ margin-top: 25px;
flex-wrap: wrap;
+ position: relative;
+ z-index: 3;
}
/* 3D кнопки */
.btn-3d {
position: relative;
- padding: 14px 28px;
+ padding: 12px 25px;
background: linear-gradient(to bottom, var(--gold), var(--dark-gold));
color: var(--black);
border: none;
border-radius: 50px;
- font-size: 1.1rem;
+ font-size: 1rem;
font-weight: 700;
text-transform: uppercase;
- box-shadow: var(--button-shadow), 0 10px 20px rgba(0, 0, 0, 0.2);
+ box-shadow: var(--button-shadow), 0 8px 16px rgba(0, 0, 0, 0.18);
transition: all 0.25s;
cursor: pointer;
outline: none;
- min-width: 160px;
+ min-width: 150px;
display: flex;
align-items: center;
justify-content: center;
- gap: 10px;
+ gap: 8px;
letter-spacing: 1px;
+ z-index: 3;
}
.btn-3d:hover {
background: linear-gradient(to bottom, var(--light-gold), var(--gold));
transform: translateY(-3px);
- box-shadow: 0 9px 0 var(--dark-gold), 0 14px 25px rgba(0, 0, 0, 0.2);
+ box-shadow: 0 9px 0 var(--dark-gold), 0 12px 22px rgba(0, 0, 0, 0.2);
}
.btn-3d:active {
transform: translateY(3px);
- box-shadow: 0 3px 0 var(--dark-gold), 0 5px 10px rgba(0, 0, 0, 0.1);
+ box-shadow: 0 3px 0 var(--dark-gold), 0 4px 8px rgba(0, 0, 0, 0.1);
}
.btn-3d:disabled {
background: linear-gradient(to bottom, var(--gray), #939cad);
color: var(--light-gray);
cursor: not-allowed;
- box-shadow: 0 6px 0 #636b7c, 0 10px 20px rgba(0, 0, 0, 0.1);
+ box-shadow: 0 6px 0 #636b7c, 0 8px 16px rgba(0, 0, 0, 0.1);
opacity: 0.8;
}
+/* Кнопка "Взять карту" */
.btn-hit {
background: linear-gradient(to bottom, #76cf79, #48a04c);
- box-shadow: 0 6px 0 #3e8942, 0 10px 20px rgba(0, 0, 0, 0.2);
+ box-shadow: 0 6px 0 #3e8942, 0 8px 16px rgba(0, 0, 0, 0.18);
color: white;
}
.btn-hit:hover {
background: linear-gradient(to bottom, #91d994, #53b557);
- box-shadow: 0 9px 0 #3e8942, 0 14px 25px rgba(0, 0, 0, 0.2);
+ box-shadow: 0 9px 0 #3e8942, 0 12px 22px rgba(0, 0, 0, 0.2);
}
.btn-hit:active {
- box-shadow: 0 3px 0 #3e8942, 0 5px 10px rgba(0, 0, 0, 0.1);
+ box-shadow: 0 3px 0 #3e8942, 0 4px 8px rgba(0, 0, 0, 0.1);
}
+/* Кнопка "Стоп" */
.btn-stand {
background: linear-gradient(to bottom, #ff7875, #d63d38);
- box-shadow: 0 6px 0 #c62828, 0 10px 20px rgba(0, 0, 0, 0.2);
+ box-shadow: 0 6px 0 #c62828, 0 8px 16px rgba(0, 0, 0, 0.18);
color: white;
}
.btn-stand:hover {
background: linear-gradient(to bottom, #ff9793, #e34744);
- box-shadow: 0 9px 0 #c62828, 0 14px 25px rgba(0, 0, 0, 0.2);
+ box-shadow: 0 9px 0 #c62828, 0 12px 22px rgba(0, 0, 0, 0.2);
}
.btn-stand:active {
- box-shadow: 0 3px 0 #c62828, 0 5px 10px rgba(0, 0, 0, 0.1);
+ box-shadow: 0 3px 0 #c62828, 0 4px 8px rgba(0, 0, 0, 0.1);
}
+/* Кнопка "Новая игра" */
.btn-new-game {
background: linear-gradient(to bottom, #7986cb, #495cc9);
color: var(--white);
- box-shadow: 0 6px 0 #3949ab, 0 10px 20px rgba(0, 0, 0, 0.2);
+ box-shadow: 0 6px 0 #3949ab, 0 8px 16px rgba(0, 0, 0, 0.18);
}
.btn-new-game:hover {
background: linear-gradient(to bottom, #9aa5d6, #5969d2);
- box-shadow: 0 9px 0 #3949ab, 0 14px 25px rgba(0, 0, 0, 0.2);
+ box-shadow: 0 9px 0 #3949ab, 0 12px 22px rgba(0, 0, 0, 0.2);
}
.btn-new-game:active {
- box-shadow: 0 3px 0 #3949ab, 0 5px 10px rgba(0, 0, 0, 0.1);
+ box-shadow: 0 3px 0 #3949ab, 0 4px 8px rgba(0, 0, 0, 0.1);
}
+/* Иконки для кнопок */
.btn-icon {
display: inline-block;
- width: 24px;
- height: 24px;
- background-size: contain;
- background-repeat: no-repeat;
- filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
+ width: 20px;
+ height: 20px;
+ position: relative;
+ filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.2));
}
-.hit-icon {
- background-image: url('_content/БлэкДжек/images/hit-icon.svg');
+/* Иконка "Взять карту" */
+.hit-icon::before {
+ content: "+";
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ font-size: 20px;
+ font-weight: bold;
+ color: #ffffff;
}
-.stand-icon {
- background-image: url('_content/БлэкДжек/images/stand-icon.svg');
+/* Иконка "Стоп" */
+.stand-icon::before {
+ content: "✋";
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ font-size: 16px;
+ color: #ffffff;
}
-.new-game-icon {
- background-image: url('_content/БлэкДжек/images/new-game-icon.svg');
+/* Иконка "Новая игра" */
+.new-game-icon::before {
+ content: "↻";
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ font-size: 18px;
+ color: #ffffff;
+ font-weight: bold;
}
/* Начальный экран */
@@ -488,45 +725,168 @@
flex-direction: column;
align-items: center;
justify-content: center;
- padding: 4rem 1rem;
+ padding: 40px 20px;
}
+/* Заменяем старый логотип игры на анимированный */
.game-logo {
- width: 350px;
- height: 230px;
- background-image: url('_content/БлэкДжек/images/blackjack-logo.png');
- background-size: contain;
- background-position: center;
- background-repeat: no-repeat;
- margin-bottom: 4rem;
- filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
+ width: 300px;
+ height: 200px;
+ margin-bottom: 40px;
+ position: relative;
+ filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.25));
transition: transform 0.5s ease;
+ display: flex;
+ align-items: center;
+ justify-content: center;
}
- .game-logo:hover {
- transform: scale(1.05);
+ /* Удаляем старые псевдоэлементы с текстом */
+ .game-logo::before,
+ .game-logo::after {
+ content: none;
}
+/* Создаем анимированную карточную колоду */
+.game-logo {
+ position: relative;
+ perspective: 1000px;
+}
+
+ /* Анимированная колода карт */
+ .game-logo::before {
+ content: "";
+ position: absolute;
+ width: 120px;
+ height: 160px;
+ background: linear-gradient(145deg, var(--gold), var(--dark-gold));
+ border-radius: 10px;
+ box-shadow: 0 15px 25px rgba(0, 0, 0, 0.4);
+ transform-style: preserve-3d;
+ animation: cardShuffle 3s infinite ease-in-out;
+ }
+
+ /* Лицевая карта с символом */
+ .game-logo::after {
+ content: "♠";
+ position: absolute;
+ width: 120px;
+ height: 160px;
+ background: white;
+ border-radius: 10px;
+ box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
+ font-size: 70px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ color: var(--black);
+ transform-style: preserve-3d;
+ animation: cardFlip 3s infinite ease-in-out;
+ border: 2px solid var(--dark-gold);
+ }
+
+/* Анимация перемешивания колоды */
+@keyframes cardShuffle {
+ 0% {
+ transform: translateX(-80px) rotateY(0) translateZ(0);
+ }
+
+ 25% {
+ transform: translateX(-30px) rotateY(10deg) translateZ(10px);
+ }
+
+ 50% {
+ transform: translateX(30px) rotateY(-10deg) translateZ(20px);
+ }
+
+ 75% {
+ transform: translateX(80px) rotateY(10deg) translateZ(10px);
+ }
+
+ 100% {
+ transform: translateX(-80px) rotateY(0) translateZ(0);
+ }
+}
+
+/* Анимация переворота карты */
+@keyframes cardFlip {
+ 0% {
+ transform: translateZ(20px) rotateY(0);
+ opacity: 1;
+ }
+
+ 45% {
+ transform: translateZ(80px) rotateY(180deg);
+ opacity: 0.8;
+ }
+
+ 55% {
+ transform: translateZ(80px) rotateY(180deg);
+ opacity: 0.8;
+ }
+
+ 100% {
+ transform: translateZ(20px) rotateY(360deg);
+ opacity: 1;
+ }
+}
+
+/* Дополняем анимацию подсветкой */
+.game-logo::before {
+ animation: cardShuffle 3s infinite ease-in-out, glow 2s infinite alternate;
+}
+
+@keyframes glow {
+ from {
+ box-shadow: 0 0 10px 2px var(--gold);
+ }
+
+ to {
+ box-shadow: 0 0 20px 5px var(--light-gold);
+ }
+}
+
+/* Адаптивные стили для анимированного логотипа */
+@media (max-width: 768px) {
+ .game-logo::before,
+ .game-logo::after {
+ width: 100px;
+ height: 140px;
+ }
+
+ .game-logo::after {
+ font-size: 60px;
+ }
+}
+
+@media (max-width: 480px) {
+ .game-logo::before,
+ .game-logo::after {
+ width: 80px;
+ height: 112px;
+ }
+
+ .game-logo::after {
+ font-size: 50px;
+ }
+}
+
+/* Кнопка начала игры */
.btn-start {
- font-size: 1.5rem;
- padding: 18px 45px;
- min-width: 220px;
- box-shadow: 0 8px 0 var(--dark-gold), 0 15px 25px rgba(0, 0, 0, 0.2);
+ font-size: 1.4rem;
+ padding: 16px 40px;
+ min-width: 200px;
}
- .btn-start:hover {
- transform: translateY(-4px);
- box-shadow: 0 12px 0 var(--dark-gold), 0 20px 35px rgba(0, 0, 0, 0.2);
- }
-
/* Адаптивные стили */
@media (max-width: 768px) {
.blackjack-container {
- padding: 1.5rem;
+ padding: 20px;
+ border-width: 4px;
}
.game-title {
- font-size: 2.2rem;
+ font-size: 2rem;
}
.playing-card {
@@ -535,58 +895,165 @@
}
.card-rank {
- font-size: 1.3rem;
- }
-
- .card-center-suit {
- font-size: 2.6rem;
- }
-
- .action-buttons {
- gap: 1.2rem;
- }
-
- .btn-3d {
- padding: 12px 20px;
- min-width: 140px;
- font-size: 1rem;
- }
-}
-
-@media (max-width: 480px) {
- .playing-card {
- width: 70px;
- height: 98px;
- }
-
- .card-rank {
- font-size: 1.1rem;
+ font-size: 1.2rem;
}
.card-suit {
- font-size: 1rem;
+ font-size: 1.1rem;
}
.card-center-suit {
- font-size: 2.2rem;
+ font-size: 2.4rem;
+ }
+
+ .hand {
+ min-height: 130px;
}
.action-buttons {
- flex-direction: column;
- align-items: center;
- gap: 1rem;
+ gap: 15px;
+ margin-top: 20px;
}
.btn-3d {
- width: 100%;
- max-width: 220px;
+ padding: 10px 18px;
+ min-width: 130px;
+ font-size: 0.9rem;
}
- .game-area {
- padding: 1.5rem;
+ .player-title {
+ font-size: 1.3rem;
}
.message-content {
font-size: 1.1rem;
}
+
+ .chip-stack {
+ width: 60px;
+ height: 60px;
+ }
+
+ .chip-stack::after {
+ width: 45px;
+ height: 45px;
+ }
+
+ .chip-stack::before {
+ width: 45px;
+ height: 8px;
+ }
+
+ .game-logo::before {
+ font-size: 80px;
+ }
+
+ .game-logo::after {
+ font-size: 36px;
+ bottom: 40px;
+ }
+}
+
+@media (max-width: 480px) {
+ .casino-background {
+ padding: 10px;
+ }
+
+ .blackjack-container {
+ padding: 15px;
+ border-width: 3px;
+ }
+
+ .game-title {
+ font-size: 1.6rem;
+ }
+
+ .playing-card {
+ width: 70px;
+ height: 98px;
+ }
+
+ .hand {
+ min-height: 105px;
+ gap: 5px;
+ padding: 5px;
+ }
+
+ .card-rank {
+ font-size: 1rem;
+ }
+
+ .card-suit {
+ font-size: 0.9rem;
+ }
+
+ .card-center-suit {
+ font-size: 1.8rem;
+ }
+
+ .action-buttons {
+ flex-direction: column;
+ align-items: center;
+ gap: 12px;
+ }
+
+ .btn-3d {
+ width: 100%;
+ max-width: 250px;
+ }
+
+ .game-area {
+ padding: 15px;
+ }
+
+ .message-content {
+ font-size: 1rem;
+ }
+
+ .player-info {
+ gap: 10px;
+ margin-bottom: 10px;
+ }
+
+ .player-avatar {
+ width: 40px;
+ height: 40px;
+ }
+
+ .player-title {
+ font-size: 1.1rem;
+ }
+
+ .score-badge {
+ font-size: 0.9rem;
+ padding: 3px 8px;
+ }
+
+ .chip-stack {
+ display: none;
+ }
+
+ .table-divider {
+ margin: 15px 0;
+ }
+
+ .game-logo {
+ width: 240px;
+ height: 160px;
+ margin-bottom: 30px;
+ }
+
+ .game-logo::before {
+ font-size: 60px;
+ }
+
+ .game-logo::after {
+ font-size: 28px;
+ bottom: 35px;
+ }
+
+ .btn-start {
+ font-size: 1.2rem;
+ padding: 14px 30px;
+ }
}
diff --git a/Components/Pages/Home.razor b/Components/Pages/Home.razor
index 9001e0b..e22a343 100644
--- a/Components/Pages/Home.razor
+++ b/Components/Pages/Home.razor
@@ -1,4 +1,4 @@
-@page "/"
+@page "/home"
Home
diff --git a/Components/Routes.razor b/Components/Routes.razor
deleted file mode 100644
index 8e65da2..0000000
--- a/Components/Routes.razor
+++ /dev/null
@@ -1,19 +0,0 @@
-@using Microsoft.AspNetCore.Components.Web
-@using Microsoft.AspNetCore.Components.Routing
-
-
-
- @if (routeData.PageType.Name == "Index" || string.IsNullOrEmpty(routeData.PageType.Name))
- {
-
- }
- else
- {
-
- }
-
-
- Не найдено
- Извините, страница не найдена.
-
-
diff --git a/Models/Deck.cs b/Models/Deck.cs
index 9bd702b..24de1dd 100644
--- a/Models/Deck.cs
+++ b/Models/Deck.cs
@@ -51,16 +51,17 @@ namespace БлэкДжек.Components // Замените BlazorBlackjack на
{
if (Cards.Count == 0)
{
- // Можно пересоздать и перемешать колоду, если она закончилась
- // InitializeDeck();
- // Shuffle();
- // Или просто вернуть null/выбросить исключение
- return null;
+ // Вместо возврата null, пересоздаем колоду
+ InitializeDeck();
+ Shuffle();
}
Card card = Cards[0];
Cards.RemoveAt(0);
return card;
}
+
+
+
}
}
\ No newline at end of file
diff --git a/Program.cs b/Program.cs
index 50c10ee..abe8e71 100644
--- a/Program.cs
+++ b/Program.cs
@@ -9,7 +9,6 @@ builder.Services.AddRazorComponents()
.AddInteractiveServerComponents();
var app = builder.Build();
-app.UseStaticFiles();
// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
@@ -20,7 +19,6 @@ if (!app.Environment.IsDevelopment())
}
app.UseHttpsRedirection();
-
app.UseStaticFiles();
app.UseAntiforgery();
diff --git a/wwwroot/_content/images/blackjack-logo.png b/wwwroot/_content/images/blackjack-logo.png
new file mode 100644
index 0000000..585ec72
Binary files /dev/null and b/wwwroot/_content/images/blackjack-logo.png differ
diff --git a/wwwroot/_content/images/card-back.png b/wwwroot/_content/images/card-back.png
new file mode 100644
index 0000000..69ff3b4
Binary files /dev/null and b/wwwroot/_content/images/card-back.png differ
diff --git a/wwwroot/_content/images/dealer-avatar.png b/wwwroot/_content/images/dealer-avatar.png
new file mode 100644
index 0000000..c625a44
Binary files /dev/null and b/wwwroot/_content/images/dealer-avatar.png differ
diff --git a/wwwroot/_content/images/hit-icon.png b/wwwroot/_content/images/hit-icon.png
new file mode 100644
index 0000000..10a5d1e
Binary files /dev/null and b/wwwroot/_content/images/hit-icon.png differ
diff --git a/wwwroot/_content/images/new-game-icon.png b/wwwroot/_content/images/new-game-icon.png
new file mode 100644
index 0000000..ce2694c
Binary files /dev/null and b/wwwroot/_content/images/new-game-icon.png differ
diff --git a/wwwroot/_content/images/player-avatar.png b/wwwroot/_content/images/player-avatar.png
new file mode 100644
index 0000000..ff5a876
Binary files /dev/null and b/wwwroot/_content/images/player-avatar.png differ
diff --git a/wwwroot/_content/images/stand-icon.png b/wwwroot/_content/images/stand-icon.png
new file mode 100644
index 0000000..a6ae0f6
Binary files /dev/null and b/wwwroot/_content/images/stand-icon.png differ
diff --git a/БлэкДжек.csproj b/БлэкДжек.csproj
index 1b28a01..54af58c 100644
--- a/БлэкДжек.csproj
+++ b/БлэкДжек.csproj
@@ -6,4 +6,14 @@
enable
+
+
+
+
+
+
+
+
+
+