diff --git a/WoerterLernen.html b/WoerterLernen.html new file mode 100644 index 0000000..7eb97bf --- /dev/null +++ b/WoerterLernen.html @@ -0,0 +1,35 @@ + + + + + + Meine Website + + + +

Flashcards Generator

+ + + +
+
+    Bitte formatiere meine Wortliste exakt nach folgendem Schema.
+    Jeder Eintrag muss durch eine Leerzeile getrennt sein.
+
+    Englisches Wort
+    [IPA-Transkription]
+    Beispielsatz auf Englisch
+    Deutsche Übersetzung des Wortes
+    Beispielsatz auf Deutsch
+
+    
+ +
+ +
+ + +
+ + + \ No newline at end of file diff --git a/css/style.css b/css/style.css new file mode 100644 index 0000000..a8138c5 --- /dev/null +++ b/css/style.css @@ -0,0 +1,31 @@ +#aufgabe_fuer_gpt { + position: relative; + border: 1px solid #ccc; + padding: 10px; + border-radius: 5px; + width: 500px; + background: #f9f9f9; +} + +#kartenContainer { + display: flex; + gap: 15px; + flex-wrap: wrap; + justify-content: center; +} + +.karte { + width: 120px; + height: 180px; + border: 2px solid #333; + border-radius: 10px; + background-color: white; + box-shadow: 2px 2px 8px rgba(0,0,0,0.1); + display: flex; + align-items: center; + justify-content: center; + font-size: 24px; + cursor: pointer; + user-select: none; + transition: transform 0.2s; +} diff --git a/img/shared image (5).jfif b/img/shared image (5).jfif new file mode 100644 index 0000000..bd61148 Binary files /dev/null and b/img/shared image (5).jfif differ diff --git a/img/shared image (6).jfif b/img/shared image (6).jfif new file mode 100644 index 0000000..d28ee81 Binary files /dev/null and b/img/shared image (6).jfif differ diff --git a/js/eigenerCode.js b/js/eigenerCode.js new file mode 100644 index 0000000..cb37ed4 --- /dev/null +++ b/js/eigenerCode.js @@ -0,0 +1,65 @@ +document.getElementById('copyButton').addEventListener('click', () => { + const text = document.getElementById('formatText').innerText; + + navigator.clipboard.writeText(text).then(() => { + alert('Format wurde in die Zwischenablage kopiert!'); + }).catch(err => { + console.error('Konnte nicht kopieren: ', err); + }); +}); + +const inputText = document.getElementById("inputText").value; +const cards = parseWordText(inputText); +function parseWordText(inputText) { + const wortBlocks = inputText.trim().split("\n\n"); + const wortListe = []; + + for (let block of wortBlocks) { + const lines = block.trim().split("\n").map(line => line.trim()); + + if (lines.length !== 5) { + console.warn("Block übersprungen (falsches Format):", block); + continue; + } + + const wortObj = { + englisch: lines[0], + ipa: lines[1], + beispielEN: lines[2], + deutsch: lines[3], + beispielDE: lines[4] + }; + + wortListe.push(wortObj); + console.log(wortObj); + } + + return wortListe; +} + +const button = document.getElementById("kartenErstellen"); +const container = document.getElementById("kartenContainer"); + +button.addEventListener("click", () => { + container.innerHTML = ""; + parsedArray.forEach((karte, index) => { + const karteDiv = document.createElement("div"); + karteDiv.classList.add("karte"); + + karteDiv.innerHTML = ` +
+
+

${karte.englisch}

+

${karte.ipa}

+

Beispiel: ${karte.beispielEN}

+
+
+

${karte.deutsch}

+

Beispiel: ${karte.beispielDE}

+
+
+ `; + container.appendChild(karteDiv); + + }); +});