Browse Source

refactoring: Bei neuskalierung des Fensters anpassen

main
Nicolas Fritz 2 years ago
parent
commit
8f3ec8dc9f
  1. 13
      uno/web/Style.js
  2. 5
      uno/web/uno.js

13
uno/web/Style.js

@ -36,6 +36,14 @@ export default class Style {
}
refreshHtml() {
this.refreshCardOnDeck();
this.showPlayerDeck(this.game.currentPlayerInstanz, true);
this.refreshDebug();
}
refreshCardOnDeck(){
if (this._cardOnDeck !== this.game.cardOnDeck) {
console.log(" ewfw")
this.putCardAnim();
@ -44,10 +52,6 @@ export default class Style {
this.firstPut.attr('src', './img/stackCards/' + this.game.cardOnDeck.color + '/' + this.game.cardOnDeck.name + '.png');
this.firstPutAnim.attr('src', './img/stackCards/' + this.game.cardOnDeck.color + '/' + this.game.cardOnDeck.name + '.png');
}
this.showPlayerDeck(this.game.currentPlayerInstanz, true);
this.refreshDebug();
}
refreshDebug() {
@ -136,6 +140,7 @@ export default class Style {
player.putCard(i);
card.css('top', yPos - height * 0.2);
card.css('opacity', 0);
this.refreshCardOnDeck();
setTimeout(() => {
this.refreshHtml();

5
uno/web/uno.js

@ -18,6 +18,11 @@ $(()=>{
style.showDebug();
style.refreshHtml();
$(window).on('resize', function () {
style.refreshHtml();
})
});

Loading…
Cancel
Save