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.
 
 
 
 

147 lines
6.4 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: "reggel", meaning: "morning" },
{ word: "felkelni", meaning: "to wake up/get up" },
{ word: "megfésülködni", meaning: "brush hair" },
{ word: "enni", meaning: "to eat" },
{ word: "inni", meaning: "to drink" },
{ word: "lenni", meaning: "to be" },
{ word: "menni", meaning: "to go" },
{ word: "tanulni", meaning: "to study" },
{ word: "dolgozni", meaning: "to work" },
{ word: "találkozni", meaning: "to meet" },
{ word: "beszélni", meaning: "to talk" },
{ word: "szeretni", meaning: "to like" },
{ word: "úszni", meaning: "to swim" },
{ word: "maradni", meaning: "to stay" },
{ word: "játszani", meaning: "to play" },
{ word: "énekelni", meaning: "to sing" },
{ word: "én vagyok", meaning: "I am" },
{ word: "én eszem", meaning: "I eat" },
{ word: "én iszom", meaning: "I drink" },
{ word: "én megyek", meaning: "I go" },
{ word: "én veszem", meaning: "I buy" },
{ word: "én viszek", meaning: "I take" },
{ word: "én tanulok", meaning: "I study" },
{ word: "én beszélek", meaning: "Italk" },
{ word: "én örülök", meaning: "I am happy" },
{ word: "te vagy", meaning: "you (sing.) are" },
{ word: "te eszel", meaning: "you (sing.) eat" },
{ word: "te iszol", meaning: "you (sing.) drink" },
{ word: "te mész", meaning: "you (sing.) go" },
{ word: "te veszel", meaning: "you (sing.) buy" },
{ word: "te viszel", meaning: "you (sing.) take" },
{ word: "te tanulsz", meaning: "you (sing.) study" },
{ word: "te beszélsz", meaning: "you (sing.) talk" },
{ word: "te örülsz", meaning: "you (sing.) are happy" },
{ word: "Ön or ő van", meaning: "he or she is" },
{ word: "Ön or ő eszik", meaning: "he or she eats" },
{ word: "Ön or ő iszik", meaning: "he or she drinks" },
{ word: "Ön or ő megy", meaning: "he or she goes" },
{ word: "Ön or ő veszik", meaning: "he or she buys" },
{ word: "Ön or ő vissik", meaning: "he or she takes" },
{ word: "Ön or ő tanul", meaning: "he or she studies" },
{ word: "Ön or ő beszél", meaning: "he or she talks" },
{ word: "Ön or ő örül ", meaning: "he or she is happy" },
{ word: "mi vagyunk", meaning: "we are" },
{ word: "mi eszünk", meaning: "we eat" },
{ word: "mi issztok", meaning: "we drink" },
{ word: "mi megyünk", meaning: "we go" },
{ word: "mi veszünk", meaning: "we buy" },
{ word: "mi visszunk", meaning: "we take" },
{ word: "mi tanulunk", meaning: "we study" },
{ word: "mi beszélünk", meaning: "we talk" },
{ word: "mi örülünk", meaning: "we are happy" },
{ word: "ti vagytok", meaning: "You (pl) are" },
{ word: "ti esznek", meaning: "You (pl) eat" },
{ word: "ti iszol", meaning: "You (pl) drink" },
{ word: "ti mentek", meaning: "You (pl) go" },
{ word: "ti vesztek", meaning: "You (pl) buy" },
{ word: "ti vissztok", meaning: "You (pl) take" },
{ word: "ti tanultok", meaning: "You (pl) study" },
{ word: "ti beszéltek", meaning: "You (pl) talk" },
{ word: "ti örültök", meaning: "You (pl) are happy" },
{ word: "Önök or ők vannak" , meaning: "they are" },
{ word: "Önök or ők esznek", meaning: "they eat" },
{ word: "Önök or ők issznak", meaning: "they drink" },
{ word: "Önök or ők mennek", meaning: "they go" },
{ word: "Önök or ők vesznek", meaning: "they buy" },
{ word: "Önök or ők vissznak", meaning: "they take" },
{ word: "Önök or ők tanulnak", meaning: "they study" },
{ word: "Önök or ők beszélnek", meaning: "they talk" },
{ word: "Önök or ők örülnek", meaning: "they are happy" },
];
// 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>