|
|
|
<!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: "hétvégén", meaning: "at the weekend" },
|
|
|
|
{ word: "egy műsort", meaning: "a show" },
|
|
|
|
{ word: "színház", meaning: "theatre" },
|
|
|
|
{ word: "menni", meaning: "to go" },
|
|
|
|
{ word: "megyek", meaning: "I go" },
|
|
|
|
{ word: "elentem", meaning: "I went" },
|
|
|
|
{ word: "hétvégén színházba mentem", meaning: "I went to the theatre at the weekend" },
|
|
|
|
{ word: "tánc", meaning: "dance" },
|
|
|
|
{ word: "zene", meaning: "music" },
|
|
|
|
{ word: "zenei", meaning: "musical" },
|
|
|
|
{ word: "mit csináltál a hétvégén?", meaning: "What did you do at the weekend?" },
|
|
|
|
{ word: "Milyen idő van ma?", meaning: "What is thew weather like today?" },
|
|
|
|
{ word: "milyen", meaning: "what kind" },
|
|
|
|
{ word: "idő", meaning: "time" },
|
|
|
|
{ word: "Kicsit hideg van!", meaning: "It's a bit cold!" },
|
|
|
|
{ word: "szójegyzék", meaning: "glossary" },
|
|
|
|
{ word: "weboldal", meaning: "web page" },
|
|
|
|
{ word: "építeni", meaning: "to build" },
|
|
|
|
{ word: "építkezem", meaning: "I am building" },
|
|
|
|
{ word: "építkezéshez", meaning: "for building" },
|
|
|
|
{ word: "szókincs építésére", meaning: "for building vocabulary" },
|
|
|
|
{ word: "magyar", meaning: "Hungarian" },
|
|
|
|
{ word: "Hungarian vocabulary", meaning: "Hungarian vocabulary" },
|
|
|
|
{ word: "létrehozni", meaning: "to create" },
|
|
|
|
{ word: "teremtek", meaning: "I create" },
|
|
|
|
{ word: "teremtettem", meaning: "I created" },
|
|
|
|
{ word: "létrehoztam egy weboldalt a magyar szókincs gyarapítására", meaning: "I created a webpage for building Hungarian vocabulary" },
|
|
|
|
{ word: "létrehoztam", meaning: "I created it" },
|
|
|
|
{ word: "szókincs", meaning: "vocabulary" },
|
|
|
|
{ word: "gyarapítására", meaning: "to increase" },
|
|
|
|
{ word: "én vagyok", meaning: "I am" },
|
|
|
|
{ word: "érzés", meaning: "feeling" },
|
|
|
|
{ word: "érzem", meaning: "I am feeling" },
|
|
|
|
{ word: "nagyon", meaning: "very" },
|
|
|
|
{ word: "fáradt", meaning: "tired" },
|
|
|
|
{ word: "Ma nagyon fáradtnak érzem magam", meaning: "I am feeling very tired today" },
|
|
|
|
{ word: "nagyon fáradtnak érzem magam ezen a héten", meaning: "I am feeling very tired this week" },
|
|
|
|
{ word: "magam", meaning: "myself" },
|
|
|
|
{ word: "szeretem", meaning: "I love" },
|
|
|
|
{ word: "nézni", meaning: "to watch" },
|
|
|
|
{ word: "olvasni", meaning: "to read" },
|
|
|
|
{ word: "manga", meaning: "manga" },
|
|
|
|
{ word: "anime", meaning: "anime" },
|
|
|
|
{ word: "szeretek animét nézni és mangát olvasni", meaning: "I love to watch anime and read manga" },
|
|
|
|
{ word: "képregények", meaning: "comics" },
|
|
|
|
{ word: "rajzfilmek", meaning: "cartoons" },
|
|
|
|
{ word: "japán", meaning: "japanese" },
|
|
|
|
{ word: "A manga és az anime egyaránt japán művészeti formák", meaning: "manga and anime are both japanese art forms" },
|
|
|
|
{ word: "mindkét", meaning: "both" },
|
|
|
|
{ word: "művészet", meaning: "art" },
|
|
|
|
{ word: "formák", meaning: "forms" },
|
|
|
|
{ word: "egyaránt", meaning: "both" },
|
|
|
|
];
|
|
|
|
|
|
|
|
// 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>
|