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.
149 lines
7.0 KiB
149 lines
7.0 KiB
3 months ago
|
<!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: "nap", meaning: "day" },
|
||
|
{ word: "reggel", meaning: "morning" },
|
||
|
{ word: "felkelni", meaning: "to wake up/get up" },
|
||
|
{ word: "és", meaning: "and" },
|
||
|
{ word: "-ba/ne", meaning: "into" },
|
||
|
{ word: "konyha", meaning: "kitchen" },
|
||
|
{ word: "is", meaning: "also" },
|
||
|
{ word: "cukor", meaning: "sugar" },
|
||
|
{ word: "reggeli", meaning: "breakfast" },
|
||
|
{ word: "nyelv", meaning: "language" },
|
||
|
{ word: "fürdőszoba ", meaning: "bathroom" },
|
||
|
{ word: "megfésülködni", meaning: "brush hair" },
|
||
|
{ word: "fogat mosni", meaning: "brush teeth" },
|
||
|
{ word: "egyetem", meaning: "university" },
|
||
|
{ word: "szorgalmas", meaning: "hardworking" },
|
||
|
{ word: "könnyű", meaning: "easy" },
|
||
|
{ word: "elmegy", meaning: "(he or she) goes" },
|
||
|
{ word: "minden", meaning: "every/each" },
|
||
|
{ word: "kettő cukorral", meaning: "two with sugar - with two sugars?" },
|
||
|
{ word: "után", meaning: "after" },
|
||
|
{ word: "reggeli után", meaning: "after breakfast" },
|
||
|
{ word: "tanulni", meaning: "to study" },
|
||
|
{ word: "ma", meaning: "today" },
|
||
|
{ word: "Ma kettő órája van.", meaning: "She has two lessons today" },
|
||
|
{ word: "órája van", meaning: "she has a watch?" },
|
||
|
{ word: "Az egyetem nem könnyű, de Anna szorgalmas, ezért sokat tanul", meaning: "The University is not easy but Anna is dilligent (works hard) so she studies a lot" },
|
||
|
{ word: "ezért", meaning: "therefore or so" },
|
||
|
{ word: "sokat", meaning: "a lot (verb)" },
|
||
|
{ word: "sokat tanul", meaning: "she studies a lot" },
|
||
|
{ word: "kávézóba,", meaning: "to a cafe" },
|
||
|
{ word: "ahol magyarul tanul", meaning: "where she studies Hungarian" },
|
||
|
{ word: "ahol", meaning: "where" },
|
||
|
{ word: "este", meaning: "evening" },
|
||
|
{ word: "este Pawellel találkozik egy bárban", meaning: "in the evening she meets Pael at a bar" },
|
||
|
{ word: "Pavell", meaning: "Paul" },
|
||
|
{ word: "Pawellel", meaning: "with Paul" },
|
||
|
{ word: "Anna koktélt iszik", meaning: "Anna drinks a cocktail" },
|
||
|
{ word: "koktél", meaning: "cocktail" },
|
||
|
{ word: "iszik", meaning: "(he or she) drinks" },
|
||
|
{ word: "mert", meaning: "because" },
|
||
|
{ word: "ő olasz.", meaning: "(he or she) is Italian" },
|
||
|
{ word: "Pawel sört iszik, mert ő lengye", meaning: "Paul drinks beer because he is Polish" },
|
||
|
{ word: "ő lengye", meaning: "he is Polish" },
|
||
|
{ word: "Poland", meaning: "Lengyelország" },
|
||
|
{ word: "Olaszország", meaning: "" },
|
||
|
{ word: "A bárban sokat beszélgetnek az életről és Magyarországról.", meaning: "They talk a lot about life and Hungary at the bar." },
|
||
|
{ word: "beszélgetnek", meaning: "they talk" },
|
||
|
{ word: "életről", meaning: "about life" },
|
||
|
{ word: "Magyarországról", meaning: "about life" },
|
||
|
{ word: "ról", meaning: "about" },
|
||
|
{ word: "élet", meaning: "life" },
|
||
|
{ word: "jó az élet", meaning: "life is good" },
|
||
|
{ word: "érdekes,", meaning: "interesting" },
|
||
|
{ word: "Anna szerint érdekes, hogy Pawel nem tanult egyetemen, hanem elutazott Mexikóba.", meaning: "Anna finds it interesting that Pawel didn't go to university, but traveled to Mexico." },
|
||
|
{ word: "szerint", meaning: "according to" },
|
||
|
{ word: "Anna szerint érdekes", meaning: "interesting according to Anna or Anna finds it interesting" },
|
||
|
{ word: "nem tanult egyetemen", meaning: "did not study at (go to) university" },
|
||
|
{ word: "egyetemen", meaning: "at university" },
|
||
|
{ word: "hanem", meaning: "but" },
|
||
|
{ word: "elutazott", meaning: "travelled" },
|
||
|
{ word: "utazni", meaning: "to travel" },
|
||
|
{ word: "megismert", meaning: "met" },
|
||
|
{ word: "Mexikóban", meaning: "in Mexico" },
|
||
|
{ word: "egy magyar lányt", meaning: "a Hungarian girl" },
|
||
|
{ word: "Rékát és szerelmes lett", meaning: "he fell in love with Reka" },
|
||
|
{ word: "szerelmes lett", meaning: "feel in love (he came to love)" },
|
||
|
{ word: "szerelmes", meaning: "in love" },
|
||
|
{ word: "letni", meaning: "to come" },
|
||
|
{ word: "Pawel Mexikóban megismert egy magyar lányt, Rékát és szerelmes lett", meaning: "In Mexico, Paul met a Hungarian girl, Reka and fell in love" },
|
||
|
{ word: "ezért él ma Pawel Budapesten", meaning: "" },
|
||
|
{ word: "él", meaning: "(he) lives" },
|
||
|
{ word: "Budapesten", meaning: "in Budapest" },
|
||
|
];
|
||
|
|
||
|
// 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>
|