tetris/style.css
2025-03-02 22:56:48 +08:00

104 lines
1.8 KiB
CSS

body {
margin: 0;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
font-family: Arial, sans-serif;
color: white;
}
.game-container {
display: flex;
gap: 20px;
padding: 20px;
background: rgba(0, 0, 0, 0.8);
border-radius: 10px;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}
canvas {
border: 2px solid #444;
background: #000;
}
.game-info {
display: flex;
flex-direction: column;
gap: 20px;
}
.score-board, .next-block {
background: rgba(255, 255, 255, 0.1);
padding: 15px;
border-radius: 8px;
text-align: center;
}
.next-block canvas {
background: #000;
margin-top: 10px;
width: 120px; /* 根据最大方块尺寸设置 */
height: 90px;
border: 2px solid #444;
}
.controls {
display: flex;
flex-direction: column;
gap: 10px;
}
.control-btn {
padding: 12px 24px;
background: linear-gradient(145deg, #4CAF50, #45a049);
border: none;
border-radius: 25px;
color: white;
font-size: 16px;
cursor: pointer;
transition: all 0.3s ease;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}
.control-btn:hover {
transform: translateY(-2px);
box-shadow: 0 6px 8px rgba(0, 0, 0, 0.3);
}
.control-btn:active {
transform: translateY(1px);
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.mobile-controls {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 10px;
}
.arrow-btn {
width: 60px;
height: 60px;
padding: 0;
font-size: 24px;
border-radius: 50%;
}
#rotate {
grid-column: 2;
}
#down {
grid-column: 1 / 4;
}
/* 暂停按钮样式 */
#pauseBtn {
background: linear-gradient(145deg, #2196F3, #1976D2);
}
.control-btn:disabled {
opacity: 0.5;
cursor: not-allowed;
}