mirror of
https://github.com/ghndrx/k8s-game-2048.git
synced 2026-02-10 06:45:07 +00:00
feat: Improve tile spacing to prevent overlapping
- Increase margin between grid cells from 15px to 18px - Update JavaScript positioning to match new spacing (124.25px) - Increase game container size from 500px to 512px to accommodate larger grid - Fix visual issue where tiles appeared too close together
This commit is contained in:
@@ -246,8 +246,8 @@ class Game2048 {
|
||||
const tile = document.createElement('div');
|
||||
tile.className = `tile tile-${this.grid[row][col]}`;
|
||||
tile.textContent = this.grid[row][col];
|
||||
tile.style.left = `${col * 121.25}px`;
|
||||
tile.style.top = `${row * 121.25}px`;
|
||||
tile.style.left = `${col * 124.25}px`;
|
||||
tile.style.top = `${row * 124.25}px`;
|
||||
|
||||
if (this.grid[row][col] > 2048) {
|
||||
tile.className = 'tile tile-super';
|
||||
|
||||
@@ -25,7 +25,7 @@ h1.title {
|
||||
}
|
||||
|
||||
.container {
|
||||
width: 500px;
|
||||
width: 512px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
@@ -141,8 +141,8 @@ h1.title {
|
||||
touch-action: none;
|
||||
background: #bbada0;
|
||||
border-radius: 10px;
|
||||
width: 500px;
|
||||
height: 500px;
|
||||
width: 512px;
|
||||
height: 512px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
@@ -208,7 +208,7 @@ h1.title {
|
||||
}
|
||||
|
||||
.grid-row {
|
||||
margin-bottom: 15px;
|
||||
margin-bottom: 18px;
|
||||
}
|
||||
|
||||
.grid-row:last-child {
|
||||
@@ -220,7 +220,7 @@ h1.title {
|
||||
height: 106.25px;
|
||||
background: rgba(238, 228, 218, 0.35);
|
||||
border-radius: 6px;
|
||||
margin-right: 15px;
|
||||
margin-right: 18px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user