show disabled held piece
This commit is contained in:
parent
d75696fbc3
commit
ab023ec982
@ -106,6 +106,11 @@
|
|||||||
1px 1px 4px #FFF2;
|
1px 1px 4px #FFF2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.disabled.mino {
|
||||||
|
filter: brightness(50%) contrast(80%);
|
||||||
|
opacity: 70%;
|
||||||
|
}
|
||||||
|
|
||||||
@keyframes locked-animation {
|
@keyframes locked-animation {
|
||||||
from {
|
from {
|
||||||
filter: saturate(50%) brightness(400%);
|
filter: saturate(50%) brightness(400%);
|
||||||
|
@ -15,7 +15,7 @@ body[data-bs-theme="dark"] {
|
|||||||
background-color: rgba(37, 41, 45, 40%);
|
background-color: rgba(37, 41, 45, 40%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.mino:not(.ghost):not(.locking) {
|
.mino:not(.ghost):not(.locking):not(.disabled) {
|
||||||
padding: 1px;
|
padding: 1px;
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 0;
|
z-index: 0;
|
||||||
@ -71,6 +71,15 @@ body[data-bs-theme="dark"] {
|
|||||||
box-shadow: 0px 0px 10px rgba(242, 255, 255, 100%);
|
box-shadow: 0px 0px 10px rgba(242, 255, 255, 100%);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.disabled.mino {
|
||||||
|
opacity: 60%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.disabled.mino:before {
|
||||||
|
opacity: 50%;
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
|
||||||
@keyframes locked-animation {
|
@keyframes locked-animation {
|
||||||
from {
|
from {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
|
@ -88,6 +88,10 @@ tr.matrix td:not(.mino) {
|
|||||||
animation-duration: 0.2s;
|
animation-duration: 0.2s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.disabled.mino {
|
||||||
|
filter: brightness(50%) contrast(50%);
|
||||||
|
}
|
||||||
|
|
||||||
@keyframes locked-animation {
|
@keyframes locked-animation {
|
||||||
from {
|
from {
|
||||||
filter: saturate(50%) brightness(300%);
|
filter: saturate(50%) brightness(300%);
|
||||||
|
@ -92,6 +92,12 @@ tr.matrix td:not(.mino) {
|
|||||||
animation-duration: 0.2s;
|
animation-duration: 0.2s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.disabled.mino {
|
||||||
|
opacity: 50%;
|
||||||
|
outline: 0px;
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
|
||||||
tr.cleared-line-animation {
|
tr.cleared-line-animation {
|
||||||
animation: none;
|
animation: none;
|
||||||
}
|
}
|
||||||
|
@ -129,7 +129,8 @@ td {
|
|||||||
animation: blinker 0.08s step-start infinite;
|
animation: blinker 0.08s step-start infinite;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ghost.mino {
|
.ghost.mino,
|
||||||
|
.disabled.mino {
|
||||||
opacity: 50%;
|
opacity: 50%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
let scheduler = new Scheduler()
|
let scheduler = new Scheduler()
|
||||||
let settings = new Settings()
|
let settings = new Settings()
|
||||||
let stats = new Stats()
|
let stats = new Stats()
|
||||||
let holdQueue = new MinoesTable("holdTable")
|
let holdQueue = new HoldQueue()
|
||||||
let matrix = new Matrix()
|
let matrix = new Matrix()
|
||||||
let nextQueue = new NextQueue()
|
let nextQueue = new NextQueue()
|
||||||
let playing = false
|
let playing = false
|
||||||
@ -22,6 +22,7 @@ function restart() {
|
|||||||
stats.init()
|
stats.init()
|
||||||
matrix.init()
|
matrix.init()
|
||||||
nextQueue.init()
|
nextQueue.init()
|
||||||
|
nextQueue.redraw()
|
||||||
settings.init()
|
settings.init()
|
||||||
pauseSettings()
|
pauseSettings()
|
||||||
}
|
}
|
||||||
@ -96,6 +97,7 @@ function ticktack() {
|
|||||||
|
|
||||||
function generate(piece) {
|
function generate(piece) {
|
||||||
matrix.piece = piece || nextQueue.shift()
|
matrix.piece = piece || nextQueue.shift()
|
||||||
|
if (!piece && holdQueue.piece) holdQueue.drawPiece()
|
||||||
lastActionSucceded = true
|
lastActionSucceded = true
|
||||||
favicon.href = matrix.piece.favicon_href
|
favicon.href = matrix.piece.favicon_href
|
||||||
|
|
||||||
@ -131,12 +133,11 @@ let playerActions = {
|
|||||||
scheduler.clearInterval(fall)
|
scheduler.clearInterval(fall)
|
||||||
scheduler.clearTimeout(lockDown)
|
scheduler.clearTimeout(lockDown)
|
||||||
|
|
||||||
let heldPiece = holdQueue.piece
|
|
||||||
matrix.piece.facing = FACING.NORTH
|
matrix.piece.facing = FACING.NORTH
|
||||||
matrix.piece.locked = false
|
matrix.piece.locked = false
|
||||||
|
matrix.piece.holdEnabled = false
|
||||||
|
let heldPiece = holdQueue.piece
|
||||||
holdQueue.piece = matrix.piece
|
holdQueue.piece = matrix.piece
|
||||||
holdQueue.piece.holdEnabled = false
|
|
||||||
holdQueue.piece.locked = false
|
|
||||||
generate(heldPiece)
|
generate(heldPiece)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -171,6 +171,20 @@ class MinoesTable {
|
|||||||
MinoesTable.prototype.init_center = [2, 2]
|
MinoesTable.prototype.init_center = [2, 2]
|
||||||
|
|
||||||
|
|
||||||
|
class HoldQueue extends MinoesTable {
|
||||||
|
constructor() {
|
||||||
|
super("holdTable")
|
||||||
|
}
|
||||||
|
|
||||||
|
drawPiece(piece=this.piece, className=piece.className) {
|
||||||
|
if (!matrix.piece.holdEnabled) {
|
||||||
|
className += " disabled"
|
||||||
|
}
|
||||||
|
super.drawPiece(piece, className)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
class NextQueue extends MinoesTable {
|
class NextQueue extends MinoesTable {
|
||||||
constructor() {
|
constructor() {
|
||||||
super("nextTable")
|
super("nextTable")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user