format
This commit is contained in:
parent
affa958ab8
commit
0c8b42f3ea
@ -34,7 +34,7 @@ a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.actions {
|
||||
#actions {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
grid-gap: 20px;
|
||||
|
@ -56,34 +56,34 @@ canvas {
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
.hold {
|
||||
#hold {
|
||||
width: 120px;
|
||||
}
|
||||
|
||||
.stats {
|
||||
#stats {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
margin: 10% 0;
|
||||
font-size: 1.2em;
|
||||
}
|
||||
|
||||
.stats-names {
|
||||
#stats-names {
|
||||
font-family: 'Share Tech';
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.stats-values {
|
||||
#stats-values {
|
||||
text-align: right;
|
||||
font-family: 'Share Tech Mono';
|
||||
min-width: 90px;
|
||||
}
|
||||
|
||||
.matrix {
|
||||
#matrix {
|
||||
margin: 5% 2%;
|
||||
border: 0.5px solid grey;
|
||||
}
|
||||
|
||||
.next {
|
||||
#next {
|
||||
width: 120px;
|
||||
margin: 5% 2%;
|
||||
}
|
@ -233,8 +233,7 @@ function drawMino(context, pos, color1, color2=null, spotlight=[0, 0]) {
|
||||
gradient.addColorStop(0, color1)
|
||||
gradient.addColorStop(1, color2)
|
||||
context.fillStyle = gradient
|
||||
}
|
||||
else
|
||||
} else
|
||||
context.fillStyle = color1
|
||||
var topLeft = pos.mul(MINO_SIZE)
|
||||
context.fillRect(...topLeft, MINO_SIZE, MINO_SIZE)
|
||||
@ -314,8 +313,7 @@ class Stats {
|
||||
if (linesCleared) {
|
||||
patternName.push(SCORES[linesCleared].linesClearedName)
|
||||
this.combo++
|
||||
}
|
||||
else
|
||||
} else
|
||||
this.combo = -1
|
||||
|
||||
if (linesCleared || tSpin) {
|
||||
@ -525,8 +523,7 @@ function move(movement, testMinoesPos=matrix.piece.minoesPos) {
|
||||
scheduler.setTimeout(locksDown, stats.lockDelay)
|
||||
}
|
||||
return true
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
@ -615,8 +612,7 @@ function autorepeat() {
|
||||
scheduler.clearTimeout(autorepeat)
|
||||
scheduler.setInterval(autorepeat, AUTOREPEAT_PERIOD)
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
scheduler.clearTimeout(autorepeat)
|
||||
scheduler.clearInterval(autorepeat)
|
||||
}
|
||||
@ -633,9 +629,8 @@ function keyDownHandler(e) {
|
||||
actionsToRepeat.unshift(action)
|
||||
scheduler.clearTimeout(autorepeat)
|
||||
scheduler.clearInterval(autorepeat)
|
||||
if (action == softDrop) {
|
||||
if (action == softDrop)
|
||||
scheduler.setInterval(autorepeat, stats.fallDelay / 20)
|
||||
}
|
||||
else
|
||||
scheduler.setTimeout(autorepeat, AUTOREPEAT_DELAY)
|
||||
}
|
||||
|
12
webtris.html
12
webtris.html
@ -13,11 +13,11 @@
|
||||
<div class="flex-rows">
|
||||
<div class="flex-columns">
|
||||
<div class="flex-space"></div>
|
||||
<canvas id="hold" class="hold" width="120" height="120"></canvas>
|
||||
<canvas id="hold" width="120" height="120"></canvas>
|
||||
</div>
|
||||
<div class="flex-space"></div>
|
||||
<div class="stats">
|
||||
<div class="stats-names">
|
||||
<div id="stats">
|
||||
<div id="stats-names">
|
||||
SCORE<br/>
|
||||
RECORD<br/>
|
||||
TEMPS<br/>
|
||||
@ -25,13 +25,13 @@
|
||||
OBJECTIF<br/>
|
||||
LIGNES<br/>
|
||||
</div>
|
||||
<div id="stats-values" class="stats-values"></div>
|
||||
<div id="stats-values"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<canvas id="matrix" class="matrix" width="200" height="400">Votre navigateur ne supporte pas HTML5, veuillez le mettre à jour pour jouer.</canvas>
|
||||
<canvas id="matrix" width="200" height="400">Votre navigateur ne supporte pas HTML5, veuillez le mettre à jour pour jouer.</canvas>
|
||||
<div class="flex-rows">
|
||||
<canvas id="next" class="next" width="120" height="400"></canvas>
|
||||
<canvas id="next"width="120" height="400"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
Reference in New Issue
Block a user