Skip to content

Commit

Permalink
fix maze buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
bogdaniculae committed Nov 6, 2024
1 parent 8748a76 commit 34f9017
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
21 changes: 14 additions & 7 deletions src/Experience/Games/MazeGame.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,17 @@ export default class MazeGame {
<div class="task-game_rounds">${_s.miniGames.level} ${this.options.currentLevel} / ${this.options.minLevels}</div>
<div class="task-game_popup">
<h1>${_s.miniGames.completed.title}</h1>
<button class="button button-rectangle-wide" id="new-level">${_s.miniGames.nextRound}</button>
<button class="button-grid" id="new-level">
<div class="corner top-left"></div>
<div class="edge top"></div>
<div class="corner top-right"></div>
<div class="edge left"></div>
<div class="content">${_s.miniGames.nextRound}</div>
<div class="edge right"></div>
<div class="corner bottom-left"></div>
<div class="edge bottom"></div>
<div class="corner bottom-right"></div>
</button>
</div>
</section>`)

Expand Down Expand Up @@ -568,18 +578,15 @@ export default class MazeGame {
if (this.options.gameState == 'congrats') {
this.options.currentLevel++
document.querySelector('.task-game_popup h1').textContent = _s.miniGames.completed.title
document.querySelector('.task-game_popup button').textContent = _s.miniGames.nextRound
document.querySelector('.task-game_popup .button-grid .content').textContent = _s.miniGames.nextRound
} else if (this.options.gameState == 'repeat') {
document.querySelector('.task-game_popup h1').textContent = _s.miniGames.oops
document.querySelector('.task-game_popup button').textContent = _s.miniGames.playAgain
document.querySelector('.task-game_popup .button-grid .content').textContent = _s.miniGames.playAgain
} else if (this.options.gameState == 'end game') {
this.options.currentLevel++

document.querySelector('.task-game_popup h1').textContent = _s.miniGames.completed.title
document.querySelector('.task-game_popup button').textContent = _s.miniGames.nextRound

if (document.querySelector('#new-level'))
document.querySelector('#new-level').className = 'button button-rectangle-wide'
document.querySelector('.task-game_popup .button-grid .content').textContent = _s.miniGames.nextRound

if (this.options.currentLevel == mazeArr.length - 1) this.options.currentLevel = 1
}
Expand Down
4 changes: 4 additions & 0 deletions src/scss/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1633,6 +1633,10 @@ body.not-logged-in {
margin-block: rem(32);
}

&-game_popup {
pointer-events: all;
}

@media (width >= rem(1280)) and (height >= rem(720)) {
// 1280x720
}
Expand Down

0 comments on commit 34f9017

Please sign in to comment.