Skip to content

Commit

Permalink
Update script.js
Browse files Browse the repository at this point in the history
  • Loading branch information
JPtheDash authored Jun 1, 2024
1 parent e037125 commit 2048efd
Showing 1 changed file with 15 additions and 22 deletions.
37 changes: 15 additions & 22 deletions script.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
// Define a list of Odia letters
const odiaLetters = ['ଅ', 'ଆ', 'ଇ', 'ଈ', 'ଉ', 'ଊ', 'ଋ', 'ଏ', 'ଐ', 'ଓ', 'ଔ', 'କ', 'ଖ', 'ଗ', 'ଘ', 'ଙ', 'ଚ', 'ଛ', 'ଜ', 'ଝ', 'ଞ', 'ଟ', 'ଠ', 'ଡ', 'ଢ', 'ଣ', 'ତ', 'ଥ', 'ଦ', 'ଧ', 'ନ', 'ପ', 'ଫ', 'ବ', 'ଭ', 'ମ', 'ଯ', 'ୟ', 'ର', 'ଲ', 'ଳ', 'ଵ', 'ଶ', 'ଷ', 'ସ', 'ହ'];

// Function to generate a random Odia letter
function getRandomLetter() {
return odiaLetters[Math.floor(Math.random() * odiaLetters.length)];
}

// Function to initialize the game board
function initializeGameBoard() {
const gameBoard = document.getElementById('game-board');
for (let i = 0; i < 9; i++) {
const box = document.createElement('div');
box.classList.add('box');
box.innerText = getRandomLetter();
gameBoard.appendChild(box);
}
}

// Call initializeGameBoard when the DOM content is loaded
document.addEventListener('DOMContentLoaded', initializeGameBoard);

document.addEventListener("DOMContentLoaded", () => {
const paper = document.getElementById('paper');

paper.addEventListener('click', (event) => {
const rect = paper.getBoundingClientRect();
const x = event.clientX - rect.left;
const y = event.clientY - rect.top;

// Example: Simple diagonal fold when clicking top right corner
if (x > rect.width / 2 && y < rect.height / 2) {
paper.style.transform = 'rotate(45deg) scale(0.5)';
paper.style.transition = 'transform 0.5s';
}
});
});

0 comments on commit 2048efd

Please sign in to comment.