add fullscreen button

master
Ondřej Hruška 5 years ago
parent 6891eb293d
commit 2cc247f929
Signed by: MightyPork
GPG Key ID: 2C5FD5035250423D
  1. 12
      script.js
  2. 1
      style.css

@ -661,8 +661,9 @@ class Board {
this.buttons.optFancy = this.addButton(x0, cfgy0, 'Effects:', 'config'); this.buttons.optFancy = this.addButton(x0, cfgy0, 'Effects:', 'config');
this.buttons.optBlockedEffect = this.addButton(x0, cfgy0+ysp2, 'Dim Blocked:', 'config'); this.buttons.optBlockedEffect = this.addButton(x0, cfgy0+ysp2, 'Dim Blocked:', 'config');
this.buttons.optSloppy = this.addButton(x0, cfgy0+ysp2*2, 'Sloppy Mode:', 'config'); this.buttons.optSloppy = this.addButton(x0, cfgy0+ysp2*2, 'Sloppy Mode:', 'config');
this.buttons.toggleFullscreen = this.addButton(x0, cfgy0+ysp2*-1.5, 'Fullscreen', 'config');
this.buttons.btnAbout = this.addButton(x0, cfgy0+ysp2*-1.5, 'Help', 'config'); this.buttons.btnAbout = this.addButton(x0, cfgy0+ysp2*-2.5, 'Help', 'config');
} }
updateSettingsGUI(cfg) { updateSettingsGUI(cfg) {
@ -1646,6 +1647,15 @@ class Game {
allowTemplateAugmenting: !this.cfg.allowTemplateAugmenting, allowTemplateAugmenting: !this.cfg.allowTemplateAugmenting,
}) })
}); });
this.board.buttons.toggleFullscreen.addEventListener('click', () => {
this.info("Toggle Fullscreen");
if (document.fullscreenElement) {
document.exitFullscreen();
} else {
this.board.$svg.requestFullscreen();
}
});
} }
/** /**

@ -16,6 +16,7 @@ html, body {
#board { #board {
height: 100%; height: 100%;
width: 100%; width: 100%;
background: #201717;
} }
.disabled .orb { .disabled .orb {

Loading…
Cancel
Save