body { font-family: Arial, sans-serif; text-align: center; } .header { margin-top: 20px; } h1 { font-size: 28px; } #emoji { font-size: 140px; display: block; margin: 20px auto; border-radius: 15px; box-shadow: 0 4px 8px rgba(0,0,0,0.2); width: 180px; height: 180px; line-height: 180px; display: flex; justify-content: center; align-items: center; } .option { display: block; width: 80%; max-width: 300px; margin: 10px auto; padding: 15px; font-size: 18px; background-color: #1e73be; color: #fff; border: none; border-radius: 10px; cursor: pointer; } .option:hover { opacity: 0.9; } #message { margin-top: 15px; font-size: 18px; font-weight: bold; } #score { font-size: 20px; margin: 10px 0; } #next-btn, #restart-btn { margin-top: 20px; padding: 10px 20px; font-size: 18px; border: none; border-radius: 10px; cursor: pointer; background-color: #444; color: white; } #next-btn { display: none; } #restart-btn { display: none; } احزر الإيموجي 😊 الإجابات الصحيحة: 0/0 السؤال التالي البداية const emojis = [ {name:"سعيد", emoji:"😊"}, {name:"حزين", emoji:"😢"}, {name:"غاضب", emoji:"😠"}, {name:"مندهش", emoji:"😲"}, {name:"مبتسم", emoji:"😃"}, {name:"ضاحك", emoji:"😂"}, {name:"متفاجئ", emoji:"😮"}, {name:"مرتبك", emoji:"😕"}, {name:"مغرم", emoji:"😍"}, {name:"محتار", emoji:"🤔"}, {name:"متهكم", emoji:"😏"}, {name:"مغمور", emoji:"😞"}, {name:"متعب", emoji:"😩"}, {name:"مبتهج", emoji:"😁"}, {name:"خائف", emoji:"😨"}, {name:"بشوش", emoji:"😄"}, {name:"مستاء", emoji:"😣"}, {name:"مصدوم", emoji:"😳"}, {name:"ساخر", emoji:"😜"}, {name:"مندهش", emoji:"😯"}, {name:"نائم", emoji:"😴"}, {name:"محب", emoji:"😘"}, {name:"مرتاح", emoji:"😌"}, {name:"مستغرب", emoji:"🤨"}, {name:"مضحك جدًا", emoji:"🤣"}, {name:"متأمل", emoji:"🧐"}, {name:"مستاء جدًا", emoji:"😭"}, {name:"غاضب جدًا", emoji:"😡"}, {name:"خجول", emoji:"😳"}, {name:"متعب جدًا", emoji:"😫"}, {name:"مبهور", emoji:"🤯"}, {name:"متفائل", emoji:"😎"}, {name:"حزين جدًا", emoji:"😿"}, {name:"متوترة", emoji:"😬"}, {name:"ساخرة جدًا", emoji:"😝"}, {name:"مبتسم جدًا", emoji:"😆"}, {name:"محب جدًا", emoji:"😍"}, {name:"مندهش جدًا", emoji:"😲"}, {name:"مرعوب", emoji:"😱"}, {name:"مستاء جدًا", emoji:"😓"}, {name:"متفاجئ جدًا", emoji:"😯"}, {name:"ساخر", emoji:"😛"}, {name:"فرحان", emoji:"😄"}, {name:"غاضب", emoji:"😤"}, {name:"مندهش جدًا", emoji:"🤪"}, {name:"مبتسم بخجل", emoji:"☺️"}, {name:"مغرم جدًا", emoji:"🥰"}, {name:"مندهش جدًا", emoji:"😲"}, {name:"مبتسم بخجل شديد", emoji:"😊"}, {name:"حزين جدًا", emoji:"😢"}, {name:"خائف جدًا", emoji:"😰"}, {name:"مندهش جدًا", emoji:"😯"} ]; let correctAnswer = null; let score = 0; let attempts = 0; const emojiDiv = document.getElementById("emoji"); const option1 = document.getElementById("option1"); const option2 = document.getElementById("option2"); const message = document.getElementById("message"); const nextBtn = document.getElementById("next-btn"); const restartBtn = document.getElementById("restart-btn"); const scoreDiv = document.getElementById("score"); function updateScore() { scoreDiv.textContent = `الإجابات الصحيحة: ${score}/${attempts}`; } function newQuestion() { message.textContent = ""; nextBtn.style.display = "none"; const choices = []; while (choices.length < 2) { const rand = emojis[Math.floor(Math.random() * emojis.length)]; if (!choices.includes(rand)) choices.push(rand); } correctAnswer = choices[Math.floor(Math.random() * choices.length)]; emojiDiv.textContent = correctAnswer.emoji; const shuffled = choices.sort(() => Math.random() - 0.5); option1.textContent = shuffled[0].name; option2.textContent = shuffled[1].name; } function checkAnswer(selected) { attempts++; if (selected === correctAnswer.name) { score++; message.textContent = "إجابتك صحيحة ✅"; nextBtn.style.display = "inline-block"; } else { message.textContent = "❌ حاول ثانية"; } updateScore(); } option1.onclick = () => checkAnswer(option1.textContent); option2.onclick = () => checkAnswer(option2.textContent); nextBtn.onclick = newQuestion; restartBtn.onclick = () => { score = 0; attempts = 0; updateScore(); restartBtn.style.display = "none"; newQuestion(); }; // بدء اللعبة updateScore(); newQuestion();