PDF-Generierung + Druckfunktion hinzufügt
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
.vs/
|
||||||
@@ -11,9 +11,9 @@
|
|||||||
<h1>Flashcards Generator</h1>
|
<h1>Flashcards Generator</h1>
|
||||||
</header>
|
</header>
|
||||||
<div class="main-wrapper">
|
<div class="main-wrapper">
|
||||||
<div class="section-title">
|
<div class="section-title" id="title">
|
||||||
<div class="content">
|
<div class="content" ">
|
||||||
<label for="inputText" class="inputText">Sende deine Wortliste an ChatGPT mit folgender Anweisung:</label>
|
<label for="inputText" class="inputText">Sende deine Wortliste an ChatGPT mit folgender Anweisung:</label>
|
||||||
</div>
|
</div>
|
||||||
<div id="aufgabe_fuer_gpt">
|
<div id="aufgabe_fuer_gpt">
|
||||||
<pre id="formatText">
|
<pre id="formatText">
|
||||||
@@ -28,26 +28,31 @@
|
|||||||
</pre>
|
</pre>
|
||||||
<button id="copyButton" style="position: absolute; top: 5px; right: 5px; cursor: pointer;">📋</button>
|
<button id="copyButton" style="position: absolute; top: 5px; right: 5px; cursor: pointer;">📋</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="content">
|
<div id="inputHinweis">
|
||||||
<label for="inputText" class="section-title">Füge deinen Text hier ein</label>
|
<div class="content">
|
||||||
<textarea id="inputText" placeholder="Hier Text einfügen..."></textarea>
|
<label for="inputText" class="section-title">Füge deinen Text hier ein</label>
|
||||||
|
<textarea id="inputText" placeholder="Hier Text einfügen..."></textarea>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button id="kartenErstellen">Karten erstellen</button>
|
<div class="button-wrapper">
|
||||||
|
<button id="kartenErstellen">Karten erstellen</button>
|
||||||
|
</div>
|
||||||
|
<div id="modusAuswahlSeite" style="display:none; text-align:center; margin-top:20px;">
|
||||||
|
<h2>Wählt einen Modus:</h2>
|
||||||
|
<button class="modus-btn" data-modus="druck">📄 PDF erstellen</button>
|
||||||
|
<button class="modus-btn" data-modus="training_einfach">🃏 Online-Training</button>
|
||||||
|
|
||||||
|
<button class="modus-btn" data-modus="statistik">📊 Statistik</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div id="kartenContainer"></div>
|
<div id="kartenContainer"></div>
|
||||||
|
|
||||||
<div id="flashcards-container"></div>
|
<div id="flashcards-container"></div>
|
||||||
<script src="js/eigenerCode.js"></script>
|
<div class="button-wrapper">
|
||||||
</div>
|
<button id="druckenBtn" style="display:none;">Drucken</button>
|
||||||
<<<<<<< HEAD:WoerterLernen.html
|
</div>
|
||||||
=======
|
<script src="eigenerCode.js"></script>
|
||||||
<textarea id="inputText" rows="10" cols="50" placeholder="Hier Text einfügen..."></textarea>
|
</div>
|
||||||
<div id="kartenContainer"></div>
|
|
||||||
<button id="kartenErstellen">Karten erstellen</button>
|
|
||||||
|
|
||||||
<div id="flashcards-container"></div>
|
|
||||||
<script src="eigenerCode.js"></script>
|
|
||||||
>>>>>>> a18b892e86a6b427b23c2eb100b9986d3c15121c:MainPage/stas/WoerterLernen.html
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
BIN
MainPage/stas/drucker.jfif
Normal file
BIN
MainPage/stas/drucker.jfif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.1 KiB |
@@ -78,6 +78,37 @@ button.addEventListener("click", () => {
|
|||||||
const inputText = document.getElementById("inputText").value;
|
const inputText = document.getElementById("inputText").value;
|
||||||
parsedArray = parseWordText(inputText);
|
parsedArray = parseWordText(inputText);
|
||||||
|
|
||||||
|
if(parsedArray.length === 0) {
|
||||||
|
alert("Kein gültiges Format erkannt. Bitte überprüfe deine Eingabe.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
alert("Karten erfolgreich erstellt!");
|
||||||
|
|
||||||
|
document.getElementById("title").style.display = "none";
|
||||||
|
button.style.display = "none";
|
||||||
|
|
||||||
|
|
||||||
|
document.getElementById("modusAuswahlSeite").style.display = "block";
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
document.querySelectorAll(".modus-btn").forEach(button => {
|
||||||
|
button.addEventListener("click", () => {
|
||||||
|
const modus = button.dataset.modus;
|
||||||
|
|
||||||
|
if (modus === "druck") {
|
||||||
|
createPDFPages(parsedArray);
|
||||||
|
} else {
|
||||||
|
console.log("Gewählter Modus:", modus);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
function createPDFPages(wordArray) {
|
||||||
|
const kartenContainer = document.getElementById("kartenContainer");
|
||||||
|
|
||||||
kartenContainer.innerHTML = "";
|
kartenContainer.innerHTML = "";
|
||||||
kartenContainer.style.display = "flex";
|
kartenContainer.style.display = "flex";
|
||||||
kartenContainer.style.flexDirection = "column";
|
kartenContainer.style.flexDirection = "column";
|
||||||
@@ -108,5 +139,13 @@ button.addEventListener("click", () => {
|
|||||||
|
|
||||||
kartenContainer.appendChild(frontPage);
|
kartenContainer.appendChild(frontPage);
|
||||||
kartenContainer.appendChild(backPage);
|
kartenContainer.appendChild(backPage);
|
||||||
|
document.getElementById("druckenBtn").style.display = "block";
|
||||||
}
|
}
|
||||||
|
alert("PDF-Seiten wurden erstellt! Du kannst sie jetzt druken.");
|
||||||
|
}
|
||||||
|
|
||||||
|
document.getElementById("druckenBtn").addEventListener("click", () => {
|
||||||
|
window.print();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
BIN
MainPage/stas/flashcards.webp
Normal file
BIN
MainPage/stas/flashcards.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 314 KiB |
@@ -16,7 +16,7 @@ h1 {
|
|||||||
position: relative;
|
position: relative;
|
||||||
top: 0;
|
top: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background-color: #005b5b;
|
background-color: #880b75;
|
||||||
color: white;
|
color: white;
|
||||||
padding: 18px 0;
|
padding: 18px 0;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@@ -36,7 +36,7 @@ h1 {
|
|||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
background-color: #ffffff;
|
background-color: #d9cfe0;
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
box-shadow: 0 10px 30px rgba(0,0,0,0.08);
|
box-shadow: 0 10px 30px rgba(0,0,0,0.08);
|
||||||
}
|
}
|
||||||
@@ -116,16 +116,15 @@ h1 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.page {
|
.page {
|
||||||
width: 210mm;
|
width: 190mm;
|
||||||
height: 297mm;
|
height: 277mm;
|
||||||
/* border: px solid #005b5b; */
|
|
||||||
padding: 0;
|
padding: 0;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
background: white;
|
background: white;
|
||||||
|
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(2, 1fr);
|
grid-template-columns: repeat(2, 1fr);
|
||||||
grid-template-rows: repeat(4, 1fr);
|
grid-template-rows: repeat(4, 1fr);
|
||||||
|
page-break-after: always;
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-back {
|
.page-back {
|
||||||
@@ -182,7 +181,6 @@ h1 {
|
|||||||
.card .ipa {
|
.card .ipa {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
color: #666;
|
color: #666;
|
||||||
/* margin-bottom: 80px; */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.card .example {
|
.card .example {
|
||||||
@@ -190,3 +188,95 @@ h1 {
|
|||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
color: #333;
|
color: #333;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.button-wrapper {
|
||||||
|
max-width: 900px;
|
||||||
|
margin: 20px auto;
|
||||||
|
padding: 10px 20px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
#kartenErstellen {
|
||||||
|
width: 100%;
|
||||||
|
height: 100px;
|
||||||
|
font-size: 46px;
|
||||||
|
font-weight: 600;
|
||||||
|
font-family: -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
|
||||||
|
color: #dc6743;
|
||||||
|
border: none;
|
||||||
|
border-radius: 8px;
|
||||||
|
cursor: pointer;
|
||||||
|
box-sizing: border-box;
|
||||||
|
background: linear-gradient(rgba(255,255,255,0.7), rgba(255,255,255,0.9)), url("flashcards.webp");
|
||||||
|
background-size: cover;
|
||||||
|
background-position: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
#druckenBtn {
|
||||||
|
width: 500px;
|
||||||
|
height: 100px;
|
||||||
|
font-size: 46px;
|
||||||
|
font-weight: 600;
|
||||||
|
font-family: -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
|
||||||
|
color: #dc6743;
|
||||||
|
border: none;
|
||||||
|
border-radius: 8px;
|
||||||
|
cursor: pointer;
|
||||||
|
box-sizing: border-box;
|
||||||
|
background: linear-gradient(rgba(255,255,255,0.7), rgba(255,255,255,0.9)), url("drucker.jfif");
|
||||||
|
background-repeat: repeat;
|
||||||
|
background-size: 80px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.erfolgsmeldung,
|
||||||
|
.modus-auswahl {
|
||||||
|
display: none;
|
||||||
|
max-width: 600px;
|
||||||
|
margin: 20px auto;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.erfolgsmeldung {
|
||||||
|
background-color: #e6f4f1;
|
||||||
|
color: #005b5b;
|
||||||
|
padding: 12px;
|
||||||
|
border-radius: 6px;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modus-auswahl p {
|
||||||
|
margin-bottom: 12px;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modus-btn {
|
||||||
|
margin: 6px;
|
||||||
|
padding: 10px 16px;
|
||||||
|
border: none;
|
||||||
|
border-radius: 6px;
|
||||||
|
background-color: #005b5b;
|
||||||
|
color: white;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modus-btn:hover {
|
||||||
|
background-color: #007070;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media print {
|
||||||
|
body * {
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
|
#kartenContainer, #kartenContainer * {
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
#kartenContainer {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
width: 100%;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user