From 2048efdf0363cc8cf34d3e5368b881fd3d2bff1b Mon Sep 17 00:00:00 2001 From: JPtheDash <137363790+JPtheDash@users.noreply.github.com> Date: Sat, 1 Jun 2024 16:18:50 +0530 Subject: [PATCH] Update script.js --- script.js | 37 +++++++++++++++---------------------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/script.js b/script.js index 35013f0..2341c53 100644 --- a/script.js +++ b/script.js @@ -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'; + } + }); +});