|
|
@ -7,6 +7,33 @@ export default class Style{ |
|
|
|
this.game.currentPlayerInstanz.drawCard(1); |
|
|
|
this.refreshDebug(); |
|
|
|
}); |
|
|
|
|
|
|
|
let firstDraw = $('#first-draw'); |
|
|
|
|
|
|
|
firstDraw.on('mouseenter', ()=>{ |
|
|
|
firstDraw.css('transition', 'min-width 0.3s, top 0.5s'); |
|
|
|
firstDraw.css('min-width', '27vh'); |
|
|
|
firstDraw.css('top', '50vh'); |
|
|
|
}); |
|
|
|
firstDraw.on('mouseleave', ()=>{ |
|
|
|
firstDraw.css('transition', 'min-width 1s, top 0.5s'); |
|
|
|
firstDraw.css('top', '47vh'); |
|
|
|
firstDraw.css('min-width', '20vh'); |
|
|
|
}); |
|
|
|
firstDraw.on('click', ()=>{ |
|
|
|
|
|
|
|
this.game.currentPlayerInstanz.drawCard(1); |
|
|
|
this.refreshDebug(); |
|
|
|
this.refreshHtml(); |
|
|
|
|
|
|
|
firstDraw.css('transition', 'min-width 1s, top 0.5s'); |
|
|
|
firstDraw.css('top', '47vh'); |
|
|
|
firstDraw.css('min-width', '20vh'); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
refreshHtml(){ |
|
|
|
$('#first-put').attr('src', './img/stackCards/' + this.game.cardOnDeck.color + '/' + this.game.cardOnDeck.name + '.png'); |
|
|
|
} |
|
|
|
|
|
|
|
refreshDebug(){ |
|
|
@ -20,6 +47,7 @@ export default class Style{ |
|
|
|
$('#button' + i).on('click', () =>{ |
|
|
|
this.game.currentPlayerInstanz.putCard(i); |
|
|
|
this.refreshDebug(); |
|
|
|
this.refreshHtml(); |
|
|
|
}); |
|
|
|
if (this.game.currentPlayerInstanz.hand[i].canPut) |
|
|
|
$('#button' + i).css('background-color', 'green'); |
|
|
|