This commit is contained in:
Adrien MALINGREY 2019-10-29 02:16:26 +01:00
parent ecfb08fb4d
commit 7a8978a4f6
3 changed files with 21 additions and 16 deletions

View File

@ -23,6 +23,7 @@
body { body {
background-image: url("images/bg.jpg"); background-image: url("images/bg.jpg");
background-size: cover; background-size: cover;
background-attachment: fixed;
} }
h1 { h1 {
@ -39,6 +40,16 @@ button {
a { a {
text-decoration: none; text-decoration: none;
font-size: 1em;
border-style: outset;
border-width: 5px;
border-radius: 5px;
color: black;
background-color: white;
}
a:active {
border-style: inset;
} }
#actions { #actions {
@ -46,16 +57,13 @@ a {
grid-template-columns: repeat(4, 1fr); grid-template-columns: repeat(4, 1fr);
grid-gap: 20px; grid-gap: 20px;
margin: 40px auto; margin: 40px auto;
width: 700px; width: 650px;
justify-items: left; justify-items: left;
} }
#play { #play {
color: LightCyan;
text-align: center; text-align: center;
font-weight: bold; font-weight: bold;
text-shadow: 2px 1px rgb(153, 145, 175);
font-size: 1.5em;
margin: 30px; margin: 30px;
} }
@ -70,7 +78,6 @@ a {
#hold { #hold {
grid-column: 1 / 3; grid-column: 1 / 3;
grid-row: 1; grid-row: 1;
width: 120px;
} }
#stats-names { #stats-names {
@ -78,15 +85,13 @@ a {
grid-row: 2; grid-row: 2;
font-family: 'Share Tech'; font-family: 'Share Tech';
text-align: left; text-align: left;
align-self: top;
} }
#stats-values { #stats-values {
grid-column: 2; grid-column: 2;
grid-row: 2; grid-row: 2;
text-align: right;
font-family: 'Share Tech Mono'; font-family: 'Share Tech Mono';
align-self: top; text-align: right;
} }
#matrix { #matrix {

View File

@ -12,12 +12,12 @@
<div id="actions"> <div id="actions">
<?php <?php
function addButton($action, $label) { function addButton($action, $label) {
echo " <div>$label</div>\n"; ?>
echo " <button type='button' onclick='changeKey(this, \"$action\")'>\n"; <div><?=$label?></div>
echo " <script>getKey(\"$action\")</script>\n"; <button type='button' onclick='changeKey(this, "<?=$action?>")'>
echo " </button>\n"; <script>getKey("<?=$action?>")</script>
} </button>
<?php }
addButton("moveLeft", "GAUCHE"); addButton("moveLeft", "GAUCHE");
addButton("moveRight", "DROITE"); addButton("moveRight", "DROITE");
addButton("softDrop", "CHUTE LENTE"); addButton("softDrop", "CHUTE LENTE");

View File

@ -213,7 +213,7 @@ class Tetromino {
context.shadowColor = this.ghostColor context.shadowColor = this.ghostColor
context.shadowOffsetX = 0 context.shadowOffsetX = 0
context.shadowOffsetY = ghostYOffset * MINO_SIZE context.shadowOffsetY = ghostYOffset * MINO_SIZE
context.shadowBlur = 3 context.shadowBlur = 4
this.minoesAbsPos.forEach(pos => drawMino(context, pos, color)) this.minoesAbsPos.forEach(pos => drawMino(context, pos, color))
context.restore() context.restore()
} }
@ -578,7 +578,7 @@ function gameOver() {
requestAnimationFrame(draw) requestAnimationFrame(draw)
if (stats.score == stats.highScore) { if (stats.score == stats.highScore) {
alert("Bravo ! Vous avez battu votre précédent record.") alert("Bravo !\nVous avez battu votre précédent record.")
localStorage.setItem('highScore', stats.highScore) localStorage.setItem('highScore', stats.highScore)
} }
} }