new themes

This commit is contained in:
Adrien MALINGREY 2019-11-03 13:27:49 +01:00
parent 2cd305fee0
commit 2494b0795d
8 changed files with 150 additions and 1457 deletions

View File

@ -51,7 +51,7 @@ fieldset {
grid-template-columns: 25vmin 17vmin 25vmin 17vmin;
grid-gap: 1vmin;
margin: 2vmin auto;
width: 85vmin;
width: 80vmin;
justify-items: right;
align-items: baseline;
}

View File

@ -0,0 +1,62 @@
.invisible-grid > .empty-cell {
background: transparent;
border: 1px solid transparent;
}
.visible-grid > .empty-cell {
background: transparent;
border: 1px inset rgba(128, 128, 128, 0.3);
}
.mino {
border: 1px solid white;
border-radius: 0vmin;
}
.I-mino {
background: rgb(153, 255, 230);
}
.J-mino {
background: rgb(153, 204, 255);
}
.L-mino {
background: rgb(255, 204, 153);
}
.O-mino {
background: rgb(255, 255, 153);
}
.S-mino {
background: rgb(153, 255, 153);
}
.T-mino {
background: rgb(204, 153, 255);
}
.Z-mino {
background: rgb(255, 153, 153);
}
.locked-mino {
background: white;
}
.cleared-line {
background: white;
}
.trail {
background: rgba(255, 255, 255, 0.2);
border: 1px solid rgba(255, 255, 255, 0.2);
border-radius: 0vmin;
}
.ghost {
background: rgba(255, 255, 255, 0.4);
border: 1px solid rgba(255, 255, 255, 0.4);
border-radius: 0vmin;
}

View File

@ -0,0 +1,70 @@
.invisible-grid > .empty-cell {
background: transparent;
border: 1px solid transparent;
}
.visible-grid > .empty-cell {
background: transparent;
border: 1px inset rgba(128, 128, 128, 0.3);
}
.mino {
border: 1px outset;
border-radius: 0vmin;
}
.I-mino {
background: cyan;
border-color: lightcyan;
}
.J-mino {
background: blue;
border-color: lightblue;
}
.L-mino {
background: orange;
border-color: lightgoldenrodyellow;
}
.O-mino {
background: yellow;
border-color: lightyellow;
}
.S-mino {
background: green;
border-color: lightgreen;
}
.T-mino {
background: magenta;
border-color: pink;
}
.Z-mino {
background: red;
border-color: lightpink;
}
.locked-mino {
background: white;
border-color: white;
}
.cleared-line {
background: white;
}
.trail {
background: rgba(255, 255, 255, 0.2);
border: 1px solid rgba(255, 255, 255, 0.2);
border-radius: 0vmin;
}
.ghost {
background: rgba(255, 255, 255, 0.4);
border: 1px solid rgba(255, 255, 255, 0.4);
border-radius: 0vmin;
}

View File

@ -9,40 +9,48 @@
}
.mino {
border: 1px solid white;
border-radius: 0vmin;
border: 1px solid;
border-radius: 0;
}
.I-mino {
background: cyan;
border-color: lightcyan;
}
.J-mino {
background: blue;
border-color: lightblue;
}
.L-mino {
background: orange;
border-color: lightgoldenrodyellow;
}
.O-mino {
background: yellow;
border-color: lightyellow;
}
.S-mino {
background: green;
border-color: lightgreen;
}
.T-mino {
background: magenta;
border-color: pink;
}
.Z-mino {
background: red;
border-color: lightpink;
}
.locked-mino {
background: white;
border-color: white;
}
.cleared-line {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 211 B

After

Width:  |  Height:  |  Size: 211 B

File diff suppressed because it is too large Load Diff

View File

@ -1,39 +0,0 @@
const actionsDefaultKeys = {
moveLeft: "ArrowLeft",
moveRight: "ArrowRight",
softDrop: "ArrowDown",
hardDrop: " ",
rotateCW: "ArrowUp",
rotateCCW: "z",
hold: "c",
pause: "Escape",
}
var selectedButton = null
var selectedAction = ""
function getKey(action) {
key = localStorage.getItem(action) || actionsDefaultKeys[action]
if (key == ' ') key = "Space"
document.open()
document.write(key)
document.close()
}
function changeKey(button, action) {
button.innerHTML = "Touche ?"
selectedButton = button
selectedAction = action
button.blur()
}
function keyUpHandler(e) {
if (selectedButton) {
localStorage.setItem(selectedAction, e.key)
selectedButton.innerHTML = (e.key == " ") ? "Space" : e.key
selectedButton = null
}
}
window.onload = function() {
addEventListener("keyup", keyUpHandler, false)
}

View File

@ -852,13 +852,19 @@ function hideSettings() {
applySettings()
switch(state) {
case STATE.WAITING:
case STATE.GAME_OVER:
document.getElementById("game").style.display = "none"
document.getElementById("settings").style.display = "none"
document.getElementById("start").style.display = "flex"
document.getElementById("settingsButton").style.display = "flex"
document.getElementById("leaderboardLink").style.display = "flex"
break
case STATE.GAME_OVER:
document.getElementById("game").style.display = "grid"
document.getElementById("settings").style.display = "none"
document.getElementById("start").style.display = "flex"
document.getElementById("settingsButton").style.display = "flex"
document.getElementById("leaderboardLink").style.display = "flex"
break
case STATE.PAUSED:
document.getElementById("game").style.display = "grid"
document.getElementById("settings").style.display = "none"