๐
KUIS
KOSAKATA
BAHASA ARAB
Tebak kosakata Bahasa Arab dari emoji.
✅ 10 soal acak
✅ Nilai maksimal 100
๐
Apa bahasa Arab dari gambar ini?
๐ฏ
Permainan Selesai
100
/* ==========================================================
BAGIAN 2 : CSS MODERN BLOGGER
========================================================== */
/* ==========================================================
BAGIAN 3A : BANK SOAL (1-50)
========================================================== */
const vocabBank = [
/* Hewan */
{word:"َْููุจٌ",emoji:"๐ถ"},
{word:"ِูุทَّุฉٌ",emoji:"๐ฑ"},
{word:"ุทَุงุฆِุฑٌ",emoji:"๐ฆ"},
{word:"ุณَู
ََูุฉٌ",emoji:"๐"},
{word:"َูู
ِุฑٌ",emoji:"๐ฏ"},
{word:"ุฃَุณَุฏٌ",emoji:"๐ฆ"},
{word:"ٌِููู",emoji:"๐"},
{word:"ุญِุตَุงٌู",emoji:"๐ด"},
{word:"ุจََูุฑَุฉٌ",emoji:"๐ฎ"},
{word:"ุฎَุฑٌُูู",emoji:"๐"},
{word:"ุฏَุฌَุงุฌَุฉٌ",emoji:"๐"},
{word:"ุจَุทَّุฉٌ",emoji:"๐ฆ"},
{word:"ุซُุนْุจَุงٌู",emoji:"๐"},
{word:"ุถِْูุฏَุนٌ",emoji:"๐ธ"},
{word:"ِูุฑْุฏٌ",emoji:"๐ต"},
{word:"ุจَุงْูุฏَุง",emoji:"๐ผ"},
{word:"ุฏُุจٌّ",emoji:"๐ป"},
{word:"ุฃَุฑَْูุจٌ",emoji:"๐ฐ"},
{word:"َูุฃْุฑٌ",emoji:"๐ญ"},
{word:"ุฏٌُِْูููู",emoji:"๐ฌ"},
{word:"ุญُูุชٌ",emoji:"๐ณ"},
{word:"ِูุฑْุดٌ",emoji:"๐ฆ"},
{word:"ุชِู
ْุณَุงุญٌ",emoji:"๐"},
{word:"ุณَُูุญَْูุงุฉٌ",emoji:"๐ข"},
{word:"ุนََْููุจُูุชٌ",emoji:"๐ท️"},
{word:"َูู
َْูุฉٌ",emoji:"๐"},
{word:"َูุญَْูุฉٌ",emoji:"๐"},
{word:"َูุฑَุงุดَุฉٌ",emoji:"๐ฆ"},
{word:"ุญََูุฒٌُูู",emoji:"๐"},
{word:"ุฌَู
ٌَู",emoji:"๐ซ"},
/* Alam */
{word:"ุดَู
ْุณٌ",emoji:"☀️"},
{word:"َูู
َุฑٌ",emoji:"๐"},
{word:"َูุฌْู
ٌ",emoji:"⭐"},
{word:"ุณَุญَุงุจَุฉٌ",emoji:"☁️"},
{word:"ู
َุทَุฑٌ",emoji:"๐ง️"},
{word:"ุจَุฑٌْู",emoji:"⚡"},
{word:"ุซَْูุฌٌ",emoji:"❄️"},
{word:"َูุงุฑٌ",emoji:"๐ฅ"},
{word:"ู
َุงุกٌ",emoji:"๐ง"},
{word:"ุฌَุจٌَู",emoji:"⛰️"},
{word:"ุดَุฌَุฑَุฉٌ",emoji:"๐ณ"},
{word:"ุฒَْูุฑَุฉٌ",emoji:"๐ธ"},
{word:"َูุฑََูุฉٌ",emoji:"๐"},
{word:"ุฃَุฑْุถٌ",emoji:"๐"},
{word:"ุจَุญْุฑٌ",emoji:"๐"},
{word:"ุดَุงุทِุฆٌ",emoji:"๐️"},
{word:"ุจَْูุชٌ",emoji:"๐ "},
{word:"ู
َุฏْุฑَุณَุฉٌ",emoji:"๐ซ"},
{word:"ู
ُุณْุชَุดَْูู",emoji:"๐ฅ"},
{word:"ู
َุณْุฌِุฏٌ",emoji:"๐"}
];
,
/* ==========================================================
MAKANAN & MINUMAN (51–80)
========================================================== */
{word:"ุชَُّูุงุญَุฉٌ",emoji:"๐"},
{word:"ู
َْูุฒٌ",emoji:"๐"},
{word:"ุจُุฑْุชَُูุงٌู",emoji:"๐"},
{word:"ุจِุทِّูุฎٌ",emoji:"๐"},
{word:"ุนَِูุจٌ",emoji:"๐"},
{word:"َูุฑَุงَِููุฉٌ",emoji:"๐"},
{word:"َูุฑَุฒٌ",emoji:"๐"},
{word:"ุฃََูุงَูุงุณٌ",emoji:"๐"},
{word:"ู
َุงْูุฌُู",emoji:"๐ฅญ"},
{word:"ุฌَْูุฒُ ุงِْْูููุฏِ",emoji:"๐ฅฅ"},
{word:"ุทَู
َุงุทِู
ٌ",emoji:"๐
"},
{word:"ุจَุงุฐِْูุฌَุงٌู",emoji:"๐"},
{word:"ุจَุทَุงุทِุณٌ",emoji:"๐ฅ"},
{word:"ุฌَุฒَุฑٌ",emoji:"๐ฅ"},
{word:"ุฐُุฑَุฉٌ",emoji:"๐ฝ"},
{word:"ุฎُุจْุฒٌ",emoji:"๐"},
{word:"ุฌُุจٌْู",emoji:"๐ง"},
{word:"ุจَْูุถَุฉٌ",emoji:"๐ฅ"},
{word:"َูุญْู
ٌ",emoji:"๐ฅฉ"},
{word:"ุฏَุฌَุงุฌٌ",emoji:"๐"},
{word:"ุฑُุฒٌّ",emoji:"๐"},
{word:"َูู
ْุจُุฑْุบَุฑ",emoji:"๐"},
{word:"ู
ُุซََّูุฌَุงุชٌ",emoji:"๐จ"},
{word:"َูุนَْูุฉٌ",emoji:"๐ฐ"},
{word:"ุดَُُููููุงุชَุฉٌ",emoji:"๐ซ"},
{word:"ุญََْููู",emoji:"๐ฌ"},
{word:"ََْูููุฉٌ",emoji:"☕"},
{word:"ุดَุงٌู",emoji:"๐ต"},
{word:"ุญَِููุจٌ",emoji:"๐ฅ"},
{word:"ุนَุตِูุฑٌ",emoji:"๐ง"},
/* ==========================================================
BENDA & TRANSPORTASI (81–100)
========================================================== */
{word:"ุณََّูุงุฑَุฉٌ",emoji:"๐"},
{word:"ุญَุงَِููุฉٌ",emoji:"๐"},
{word:"ِูุทَุงุฑٌ",emoji:"๐"},
{word:"ุทَุงุฆِุฑَุฉٌ",emoji:"✈️"},
{word:"ุณََِูููุฉٌ",emoji:"๐ข"},
{word:"ุฏَุฑَّุงุฌَุฉٌ",emoji:"๐ฒ"},
{word:"ุฏَุฑَّุงุฌَุฉٌ َูุงุฑَِّูุฉٌ",emoji:"๐️"},
{word:"ุณَุงุนَุฉٌ",emoji:"⌚"},
{word:"َูุธَّุงุฑَุฉٌ",emoji:"๐"},
{word:"ุญِุฐَุงุกٌ",emoji:"๐"},
{word:"َูู
ِูุตٌ",emoji:"๐"},
{word:"ุจِْูุทَุงٌู",emoji:"๐"},
{word:"ُูุจَّุนَุฉٌ",emoji:"๐งข"},
{word:"ุญَِููุจَุฉٌ",emoji:"๐"},
{word:"ู
ِุธََّูุฉٌ",emoji:"☂️"},
{word:"ِูุชَุงุจٌ",emoji:"๐"},
{word:"ََููู
ٌ",emoji:"✏️"},
{word:"ุญَุงุณُูุจٌ",emoji:"๐ป"},
{word:"َูุงุชٌِู",emoji:"๐ฑ"},
{word:"ุณَุฑِูุฑٌ",emoji:"๐️"}
];
/* ==========================================================
BAGIAN 4A
MESIN KUIS
========================================================== */
// ----------------------------
// Variabel Global
// ----------------------------
let currentQuestions = [];
let currentQuestion = 0;
let score = 0;
let isAnswered = false;
// ----------------------------
// Ambil Elemen HTML
// ----------------------------
const loadingScreen = document.getElementById("quizLoading");
const startScreen = document.getElementById("startScreen");
const quizScreen = document.getElementById("quizScreen");
const resultScreen = document.getElementById("resultScreen");
const startBtn = document.getElementById("startBtn");
const playAgainBtn = document.getElementById("playAgainBtn");
const emojiDisplay = document.getElementById("emojiDisplay");
const optionContainer = document.getElementById("optionContainer");
const questionNumber = document.getElementById("questionNumber");
const currentScore = document.getElementById("currentScore");
const progressFill = document.getElementById("progressFill");
const finalScore = document.getElementById("finalScore");
const resultMessage = document.getElementById("resultMessage");
const resultIcon = document.getElementById("resultIcon");
// ----------------------------
// Loading
// ----------------------------
window.addEventListener("load", function () {
setTimeout(function () {
loadingScreen.style.display = "none";
startScreen.style.display = "block";
},600);
});
// ----------------------------
// Acak Array (Fisher-Yates)
// ----------------------------
function shuffle(array){
let currentIndex = array.length;
while(currentIndex !== 0){
let randomIndex = Math.floor(Math.random()*currentIndex);
currentIndex--;
[
array[currentIndex],
array[randomIndex]
] = [
array[randomIndex],
array[currentIndex]
];
}
return array;
}
// ----------------------------
// Mulai Permainan
// ----------------------------
function startGame(){
score = 0;
currentQuestion = 0;
isAnswered = false;
currentScore.textContent = "0";
progressFill.style.width = "10%";
resultScreen.style.display = "none";
startScreen.style.display = "none";
quizScreen.style.display = "block";
// Mengacak seluruh bank soal
const bank = shuffle([...vocabBank]);
// Ambil 10 soal pertama
currentQuestions = bank.slice(0,10);
// Muat soal pertama
loadQuestion();
}
// ----------------------------
// Event Listener
// ----------------------------
startBtn.addEventListener("click",startGame);
playAgainBtn.addEventListener("click",startGame);
/* ==========================================================
BAGIAN 4B
LOAD QUESTION
========================================================== */
function loadQuestion(){
isAnswered = false;
// Bersihkan pilihan lama
optionContainer.innerHTML = "";
// Ambil soal aktif
const question = currentQuestions[currentQuestion];
// Nomor soal
questionNumber.textContent = currentQuestion + 1;
// Progress bar
progressFill.style.width =
((currentQuestion + 1) / 10 * 100) + "%";
// Emoji
emojiDisplay.textContent = question.emoji;
// Animasi emoji
emojiDisplay.classList.remove("pop");
void emojiDisplay.offsetWidth;
emojiDisplay.classList.add("pop");
// ====================================
// Membuat Pilihan Jawaban
// ====================================
let options = [];
// Jawaban benar
options.push(question.word);
// Ambil jawaban salah
const wrongAnswers = shuffle(
vocabBank.filter(function(item){
return item.word !== question.word;
})
);
options.push(wrongAnswers[0].word);
options.push(wrongAnswers[1].word);
options.push(wrongAnswers[2].word);
// Acak urutan pilihan
options = shuffle(options);
// ====================================
// Tampilkan Tombol
// ====================================
options.forEach(function(answer){
const button =
document.createElement("button");
button.className = "optionBtn";
button.textContent = answer;
button.dataset.answer = answer;
button.addEventListener(
"click",
function(){
checkAnswer(
answer,
question.word,
button
);
}
);
optionContainer.appendChild(button);
});
}
/* ==========================================================
BAGIAN 4C-1
CHECK ANSWER
========================================================== */
function checkAnswer(selectedAnswer, correctAnswer, clickedButton){
// Mencegah klik dua kali
if(isAnswered) return;
isAnswered = true;
const allButtons =
document.querySelectorAll(".optionBtn");
// ----------------------------
// Jawaban Benar
// ----------------------------
if(selectedAnswer === correctAnswer){
score += 10;
currentScore.textContent = score;
clickedButton.classList.add("correct");
if(typeof playCorrectSound === "function"){
playCorrectSound();
}
}
// ----------------------------
// Jawaban Salah
// ----------------------------
else{
clickedButton.classList.add("wrong");
clickedButton.classList.add("shake");
if(typeof playWrongSound === "function"){
playWrongSound();
}
// Tandai jawaban benar
allButtons.forEach(function(btn){
if(btn.textContent === correctAnswer){
btn.classList.add("correct");
}
});
}
// ----------------------------
// Nonaktifkan semua tombol
// ----------------------------
allButtons.forEach(function(btn){
btn.disabled = true;
btn.style.pointerEvents = "none";
});
// ----------------------------
// Lanjut ke soal berikutnya
// ----------------------------
setTimeout(function(){
currentQuestion++;
if(currentQuestion < 10){
loadQuestion();
}else{
showResult();
}
},1200);
}
/* ==========================================================
BAGIAN 4C-2
HASIL AKHIR
========================================================== */
function showResult(){
// Sembunyikan layar kuis
quizScreen.style.display = "none";
// Tampilkan hasil
resultScreen.style.display = "block";
// Nilai akhir
finalScore.textContent = score;
// Reset icon
resultIcon.classList.remove("pop");
// -----------------------------
// Pesan sesuai nilai
// -----------------------------
if(score === 100){
resultIcon.textContent = "๐";
resultMessage.innerHTML =
"
Luar Biasa!Kamu menjawab semua soal dengan benar.";
if(typeof playHooraySound === "function"){
playHooraySound();
}
}
else if(score >= 80){
resultIcon.textContent = "๐ฅ";
resultMessage.innerHTML =
"
Hebat!Sedikit lagi mendapatkan nilai sempurna.";
if(typeof playCorrectSound === "function"){
playCorrectSound();
}
}
else if(score >= 60){
resultIcon.textContent = "๐";
resultMessage.innerHTML =
"
Bagus!Terus berlatih agar semakin mahir.";
if(typeof playCorrectSound === "function"){
playCorrectSound();
}
}
else if(score >= 40){
resultIcon.textContent = "๐";
resultMessage.innerHTML =
"
Cukup BaikMasih perlu latihan lagi.";
}
else{
resultIcon.textContent = "๐ช";
resultMessage.innerHTML =
"
Jangan Menyerah!Coba main lagi agar nilainya lebih tinggi.";
}
// Animasi icon
setTimeout(function(){
resultIcon.classList.add("pop");
},100);
}
Tidak ada komentar:
Posting Komentar