Загрузить файлы в «css»

This commit is contained in:
svoboda200786 2025-11-01 14:39:50 +00:00
parent eeb53a27fa
commit d44bfe3933

View File

@ -1,158 +1,254 @@
/* Импортируем шрифт, который указали в HTML */ /* Импортируем шрифт, который указали в HTML */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap'); @import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');
/* Базовый сброс стилей и настройка всей страницы */ /* Базовый сброс стилей и настройка всей страницы */
* { * {
box-sizing: border-box; box-sizing: border-box;
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
body { body {
/* Фон и центрирование игрового контейнера */ /* Фон и центрирование игрового контейнера */
background-color: #1c1c1c; background-color: #1c1c1c;
color: #f0f0f0; color: #f0f0f0;
font-family: 'Press Start 2P', cursive; font-family: 'Press Start 2P', cursive;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
min-height: 100vh; min-height: 100vh;
overflow: hidden; }
}
/* Главный контейнер, который держит поле и боковую панель */
/* Главный контейнер, который держит поле и боковую панель */ .tetris-wrapper {
.tetris-wrapper { display: flex;
display: flex; gap: 25px; /* Расстояние между игровым полем и панелью */
gap: 25px; /* Расстояние между игровым полем и панелью */ padding: 20px;
padding: 20px; border: 5px solid #555;
border: 5px solid #555; border-radius: 10px;
border-radius: 10px; background-color: #333;
background-color: #333; box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
box-shadow: 0 0 20px rgba(0, 0, 0, 0.5); }
}
/* Стиль для основного игрового холста */
/* Стиль для основного игрового холста */ #game-board {
#game-board { border: 3px solid #777;
border: 3px solid #777; background-color: #000000;
background-color: #000000; /*flex-grow: 0;*/
/*flex-grow: 0;*/ align-self: flex-start;
align-self: flex-start; }
}
/* Боковая панель с информацией */
/* Боковая панель с информацией */ .side-panel {
.side-panel { display: flex;
display: flex; flex-direction: column;
flex-direction: column; width: 200px;
width: 200px; text-align: center;
text-align: center; }
}
.side-panel h1 {
.side-panel h1 { font-size: 2.2em;
font-size: 2.2em; margin-bottom: 25px;
margin-bottom: 25px; color: #e74c3c;
color: #e74c3c; text-shadow: 3px 3px #000;
text-shadow: 3px 3px #000; }
}
/* Контейнеры для счёта, линий и уровня */
/* Контейнеры для счёта, линий и уровня */ .info-box {
.info-box { background-color: #000;
background-color: #000; border: 2px solid #777;
border: 2px solid #777; padding: 15px 10px;
padding: 15px 10px; margin-bottom: 20px;
margin-bottom: 20px; border-radius: 5px;
border-radius: 5px; }
}
.info-title {
.info-title { font-size: 0.8em;
font-size: 0.8em; color: #999;
color: #999; margin-bottom: 10px;
margin-bottom: 10px; display: block; /* Чтобы margin-bottom сработал */
display: block; /* Чтобы margin-bottom сработал */ }
}
.info-box p {
.info-box p { font-size: 1.5em;
font-size: 1.5em; color: #f1c40f; /* Яркий желтый для цифр */
color: #f1c40f; /* Яркий желтый для цифр */ }
}
/* Отдельные стили для контейнера следующей фигуры */
/* Отдельные стили для контейнера следующей фигуры */ .next-piece-container {
.next-piece-container { display: flex; /* Используем flexbox */
display: flex; /* Используем flexbox */ flex-direction: column;
flex-direction: column; justify-content: center; /* Центрируем по вертикали */
justify-content: center; /* Центрируем по вертикали */ align-items: center; /* Центрируем по горизонтали */
align-items: center; /* Центрируем по горизонтали */ /* Убрали flex-grow, чтобы высота зависела от контента */
/* Убрали flex-grow, чтобы высота зависела от контента */ }
}
#next-piece-board {
#next-piece-board { background-color: #000;
background-color: #000; border: 2px solid #777;
border: 2px solid #777; /* Убрали margin, так как центрированием теперь управляет родитель */
/* Убрали margin, так как центрированием теперь управляет родитель */ max-width: 100%;
max-width: 100%; height: auto;
height: auto; }
}
/* Общий стиль для кнопок */
/* Общий стиль для кнопок */ .game-button {
.game-button { background-color: #27ae60; /* Зеленый */
background-color: #27ae60; /* Зеленый */ color: #fff;
color: #fff; border: none;
border: none; padding: 15px;
padding: 15px; font-family: 'Press Start 2P', cursive;
font-family: 'Press Start 2P', cursive; text-transform: uppercase;
text-transform: uppercase; cursor: pointer;
cursor: pointer; border-radius: 5px;
border-radius: 5px; border-bottom: 4px solid #229954; /* 3D-эффект */
border-bottom: 4px solid #229954; /* 3D-эффект */ transition: all 0.1s ease;
transition: all 0.1s ease; margin-top: auto
margin-top: auto }
}
.game-button:hover {
.game-button:hover { background-color: #2ecc71;
background-color: #2ecc71; transform: translateY(-2px); /* Небольшой подъём при наведении */
transform: translateY(-2px); /* Небольшой подъём при наведении */ }
}
.game-button:active {
.game-button:active { transform: translateY(1px); /* Эффект нажатия */
transform: translateY(1px); /* Эффект нажатия */ border-bottom-width: 2px;
border-bottom-width: 2px; }
}
/* Слой-оверлей для модальных окон */
/* Слой-оверлей для модальных окон */ #game-overlay {
#game-overlay { position: fixed;
position: fixed; top: 0;
top: 0; left: 0;
left: 0; width: 100%;
width: 100%; height: 100%;
height: 100%; background-color: rgba(0, 0, 0, 0.8);
background-color: rgba(0, 0, 0, 0.8); display: flex;
display: flex; justify-content: center;
justify-content: center; align-items: center;
align-items: center; }
}
/* Модальное окно для сообщений (Пауза, Конец игры) */
/* Модальное окно для сообщений (Пауза, Конец игры) */ #game-modal {
#game-modal { background-color: #333;
background-color: #333; padding: 30px 40px;
padding: 30px 40px; border-radius: 10px;
border-radius: 10px; border: 5px solid #555;
border: 5px solid #555; text-align: center;
text-align: center; box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
box-shadow: 0 0 20px rgba(0, 0, 0, 0.8); }
}
#modal-title {
#modal-title { font-size: 1.8em;
font-size: 1.8em; margin-bottom: 15px;
margin-bottom: 15px; color: #e74c3c;
color: #e74c3c; }
}
#modal-text {
#modal-text { font-size: 1.1em;
font-size: 1.1em; margin-bottom: 25px;
margin-bottom: 25px; line-height: 1.5;
line-height: 1.5; }
}
/* Вспомогательный класс, чтобы скрыть элемент */
/* Вспомогательный класс, чтобы скрыть элемент */ .hidden {
.hidden { display: none !important;
display: none !important; }
#game-area-container {
position: relative; /* Контекст для позиционирования джойстика */
}
#joystick-controls {
display: none; /* Скрыт по умолчанию на десктопе */
position: absolute;
bottom: 15px;
left: 0;
width: 100%;
padding: 0 10px;
box-sizing: border-box;
display: flex;
justify-content: space-between;
align-items: center;
gap: 10px;
}
.joystick-btn {
flex-grow: 1; /* Кнопки занимают равное пространство */
background-color: rgba(255, 255, 255, 0.25);
border: 2px solid rgba(255, 255, 255, 0.4);
color: #1c1c1c;
font-size: 2.8em;
font-family: sans-serif; /* Для лучшего отображения стрелок */
padding: 10px 0;
border-radius: 10px;
-webkit-tap-highlight-color: transparent; /* Убираем подсветку при тапе на iOS */
}
.joystick-btn:active {
background-color: rgba(255, 255, 255, 0.5);
}
/* --- СТИЛИ ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ --- */
@media (max-width: 620px) {
body {
align-items: flex-start;
}
.tetris-wrapper {
flex-direction: column;
align-items: center;
gap: 15px;
width: 100%;
padding: 0;
border: none;
background: none;
box-shadow: none;
}
.side-panel {
order: 1;
width: 100%;
max-width: 309px;
flex-direction: row;
flex-wrap: wrap; /* Разрешаем перенос */
gap: 5px;
}
#game-area-container {
order: 2; /* Контейнер с игрой и джойстиком идет вторым */
}
/* Отображаем джойстик на мобильных */
#joystick-controls {
display: flex;
}
/* Скрываем ненужные элементы */
.side-panel h1,
.next-piece-container {
display: none;
}
.info-box {
flex: 1 1 80px;
margin-bottom: 5px;
padding: 8px;
}
.info-title {
font-size: 0.7em;
margin-bottom: 5px;
}
.info-box p {
font-size: 1.2em;
}
/* Кнопка "Старт" возвращается наверх и занимает всю ширину */
#start-button {
flex-basis: 100%;
margin-top: 5px;
}
} }