php
This commit is contained in:
parent
7249f46c37
commit
bfe422bbdd
@ -81,10 +81,14 @@ table {
|
|||||||
table-layout: fixed;
|
table-layout: fixed;
|
||||||
border-spacing: 0;
|
border-spacing: 0;
|
||||||
width: 0;
|
width: 0;
|
||||||
|
height: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
td {
|
td {
|
||||||
border: 1px solid transparent;
|
border: 1px solid transparent;
|
||||||
|
padding: 0;
|
||||||
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#hold {
|
#hold {
|
||||||
@ -171,8 +175,8 @@ td {
|
|||||||
|
|
||||||
.ghost {
|
.ghost {
|
||||||
background-color: rgba(255, 255, 255, 0.4);
|
background-color: rgba(255, 255, 255, 0.4);
|
||||||
border-color: rgba(255, 255, 255, 0.3);
|
border-color: rgba(255, 255, 255, 0.2);
|
||||||
border-style: inset;
|
border-style: solid;
|
||||||
}
|
}
|
||||||
|
|
||||||
#stats {
|
#stats {
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
function addButton($action, $label) {
|
function addButton($action, $label) {
|
||||||
?>
|
?>
|
||||||
<div><?=$label?></div>
|
<div><?=$label?></div>
|
||||||
<button type='button' onclick='changeKey(this, "<?=$action?>")'>
|
<button type="button" onclick="changeKey(this, '<?=$action?>')">
|
||||||
<script>getKey("<?=$action?>")</script>
|
<script>getKey("<?=$action?>")</script>
|
||||||
</button>
|
</button>
|
||||||
<?php }
|
<?php }
|
||||||
@ -29,7 +29,7 @@
|
|||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
<div id="play">
|
<div id="play">
|
||||||
<a href="webtris.html">JOUER</a>
|
<a href="webtris.php">JOUER</a>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
@ -206,12 +206,6 @@ class MinoesTable {
|
|||||||
this.columns = columns
|
this.columns = columns
|
||||||
this.piece = null
|
this.piece = null
|
||||||
this.table = document.getElementById(id)
|
this.table = document.getElementById(id)
|
||||||
for (var y=0; y < rows; y++) {
|
|
||||||
var row = this.table.insertRow()
|
|
||||||
for (var x=0; x < columns; x++) {
|
|
||||||
row.insertCell()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
drawMino(x, y, className) {
|
drawMino(x, y, className) {
|
||||||
|
@ -10,9 +10,24 @@
|
|||||||
<body>
|
<body>
|
||||||
<h1>WEBTRIS</h1>
|
<h1>WEBTRIS</h1>
|
||||||
<div id="grid">
|
<div id="grid">
|
||||||
<table id="hold"><table>
|
<?php
|
||||||
<table id="matrix"><table>
|
function echoTable($id, $rows, $columns) {
|
||||||
<table id="next"><table>
|
echo " <table id='$id'>\n";
|
||||||
|
echo " <tbody>\n";
|
||||||
|
for ($y = 0; $y < $rows; $y++) {
|
||||||
|
echo " <tr>";
|
||||||
|
for ($x = 0; $x < $columns; $x++) {
|
||||||
|
echo "<td></td>";
|
||||||
|
}
|
||||||
|
echo "</tr>\n";
|
||||||
|
}
|
||||||
|
echo " </tbody>\n";
|
||||||
|
echo " </table>\n";
|
||||||
|
}
|
||||||
|
echoTable("hold", 6, 6);
|
||||||
|
echoTable("matrix", 24, 10);
|
||||||
|
echoTable("next", 24, 6);
|
||||||
|
?>
|
||||||
<table id="stats">
|
<table id="stats">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr><td class="stat-label">SCORE</td><td class="stat-value" id="score">0</td></tr>
|
<tr><td class="stat-label">SCORE</td><td class="stat-value" id="score">0</td></tr>
|
Reference in New Issue
Block a user