Skip to content

Commit

Permalink
standard push
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Schwartz committed Feb 2, 2024
1 parent 1fc9b20 commit 9072885
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion games.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,8 @@ document.addEventListener('DOMContentLoaded', function() {
var languageDropdown = document.getElementById('language-dropdown');
var hamburger = document.querySelector('.hamburger-menu');
var navUL = document.querySelector('nav ul');

var startGameButton = document.getElementById('start-game');

// Only show modal if cookie consent hasn't been given
console.log("Checking cookie consent status");
if (!getCookie('cookieConsent')) {
Expand Down Expand Up @@ -330,6 +331,12 @@ document.addEventListener('DOMContentLoaded', function() {
hamburger.addEventListener('click', function() {
navUL.classList.toggle('active');
});

// Start Game button
if (startGameButton) {
startGameButton.addEventListener('click', startGame);
}

// Setup event listeners for letter buttons
letters.forEach(function(letter) {
var button = document.getElementById('button-' + letter);
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ <h2>Languapps</h2>
<img id="hangman-image" src="/images/hang/h0.png" alt="hangman">
</div>
<div id="word-display"></div>
<button onclick="startGame()">Start New Game</button>
<button id="start-game">New Game</button>
<div id="letter-buttons">
<button id="button-a">a</button>
<button id="button-b">b</button>
Expand Down

0 comments on commit 9072885

Please sign in to comment.