You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

113 lines
4.7 KiB

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Word Meaning Display</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 40px;
text-align: center;
}
#wordContainer {
font-size: 24px;
margin-bottom: 20px;
}
#meaning {
font-size: 20px;
color: #333;
margin-top: 20px;
display: none; /* Hide meaning initially */
}
</style>
</head>
<body>
<h1>Word Meaning Display</h1>
<div id="wordContainer">
<span id="word"></span>
</div>
<button onclick="showMeaning()">Show Meaning</button>
<button onclick="getNextWord()">Next</button>
<p></p>
<button><a href="/hungary/language/vocabulary/vocabulary.html">Vocabulary</a></button>
<button><a href="/hungary/language/homework/homework.html">Homework</a></button>
<button><a href="/hungary/hungary.html">Hungary</a></button>
<button><a href="/">Home</a></button>
<div id="meaning"></div>
<script>
// Simulating a database of words and meanings
const wordDatabase = [
{ word: "a hétvégét", meaning: "the weekend" },
{ word: "hogy", meaning: "how" },
{ word: "Hogy vagy?", meaning: "How are you?" },
{ word: "Hogy tetszik Magyarorszag?", meaning: "How do you like Hungary?" },
{ word: "Hogy tetszik Japán?", meaning: "How do you like Japan?" },
{ word: "amikor", meaning: "when" },
{ word: "Mikor fekszel le?", meaning: "When do you go to bed?" },
{ word: "Mikor kelsz fel?", meaning: "When do you get up?" },
{ word: "Mikor fekszel le?", meaning: "When do you go to bed?" },
{ word: "Mikor ébredsz fel reggel?", meaning: "When do you wake up in the morning?" },
{ word: " lal banámikor ébredsz fel reggel?", meaning: "When do you usually wake up in the morning?" },
{ word: "hol", meaning: "where" },
{ word: "hogy hova", meaning: "to where" },
{ word: "Hova mesz?", meaning: "Where are you going?" },
{ word: "Hol vagy?", meaning: "Where are you?" },
{ word: "Hol élsz?", meaning: "Where do you live?" },
{ word: "ki", meaning: "who" },
{ word: "Ki vagy te?", meaning: "Who are you?" },
{ word: "Ki ő?", meaning: "Who is he/she?" },
{ word: "Ki van ott?", meaning: "Who is there?" },
{ word: "Kit latsz?", meaning: "Who so you see?" },
{ word: "Kit szeretsz?", meaning: "Who do you like?" },
{ word: "Kit ismersz?", meaning: "Who do you know?" },
{ word: "Ki a kedvenc énekesed?", meaning: "Who is your favourite singer?" },
{ word: "mi", meaning: "what" },
{ word: "Mi az?", meaning: "What is it?" },
{ word: "Mi ez?", meaning: "What is that?" },
{ word: "Mi a kedvenc színed?", meaning: "What is your favourite colour?" },
{ word: "Mi a kedvenc ételed?", meaning: "What is your favourite food?" },
{ word: "Mi van a csirkelevesten?", meaning: "What is in chicken soup?" },
{ word: "Mi a végeredmeny a magyar meccsen?", meaning: "What is the score in the Hungary match?" },
{ word: "Mi az?", meaning: "What is it?" },
{ word: "milyen", meaning: "what kind" },
{ word: "Milyen nyelveket beszélsz?", meaning: "What languages do you speak?" },
{ word: "Milyen idő van ma?", meaning: "What is the weather like today?" },
{ word: "Mennyi az idő?", meaning: "What is the time?" },
];
// Function to pick a random word from the database
function getRandomWord() {
const randomIndex = Math.floor(Math.random() * wordDatabase.length);
return wordDatabase[randomIndex];
}
// Display the word on the page
var currentWord = getRandomWord();
document.getElementById("word").textContent = currentWord.word;
// Show the meaning when the button is clicked
function showMeaning() {
console.log("Running the showMeaning function");
document.getElementById("meaning").textContent = currentWord.meaning;
document.getElementById("meaning").style.display = "block"; // Display the meaning
}
// get the next word
function getNextWord() {
console.log("Running the getRandomWord function");
currentWord=getRandomWord();
document.getElementById("word").textContent = currentWord.word;
document.getElementById("meaning").style.display = "none"; // Display the meaning
}
</script>
</body>
</html>