Toast angepasst

This commit is contained in:
2024-12-16 14:23:00 +01:00
committed by Eric Blommel
parent 5a4ec524da
commit 337e5360e4
3 changed files with 157 additions and 34 deletions

View File

@@ -32,7 +32,7 @@ if (!isset($topicData)) {
<script src="https://cdn.tailwindcss.com"></script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
<script src="assets/js/sidebar.js"></script>
<script src="assets/js/tasks.js"></script>
<script src="assets/js/tasks.js" defer></script>
</head>
@@ -144,16 +144,12 @@ if (!isset($topicData)) {
<label for="answer<?php echo $taskId . '_' . $variableIndex; ?>"></label>
<input id="answer<?php echo $taskId . '_' . $variableIndex; ?>" type="text"
placeholder="Ihre Antwort" data-correct-answer="<?php echo $correctAnswer; ?>"/>
<button class="check-answer bg-white text-[var(--primary-color)] border-2 border-[var(--primary-color)] w-40 h-10 flex items-center justify-center rounded-lg hover:bg-[var(--primary-color)] hover:text-white transition duration-300">
Antwort prüfen
<button class="check-answer bg-white text-[var(--primary-color)] border-2 border-[var(--primary-color)] w-10 h-10 flex items-center justify-center rounded-lg hover:bg-[var(--primary-color)] hover:text-white transition duration-300">
<i class="fa-solid fa-check"></i>
</button>
<button class="show-answer bg-white text-[var(--primary-color)] border-2 border-[var(--primary-color)] w-40 h-10 flex items-center justify-center rounded-lg hover:bg-[var(--primary-color)] hover:text-white transition duration-300">
Antwort anzeigen
<button class="show-answer bg-white text-[var(--primary-color)] border-2 border-[var(--primary-color)] w-10 h-10 flex items-center justify-center rounded-lg hover:bg-[var(--primary-color)] hover:text-white transition duration-300">
<i class="fa-solid fa-eye"></i>
</button>
<div class="feedback" style="color: green; display: none;"></div>
<div class="correct-answer" style="color: blue; display: none; margin-top: 0.5rem;">
Richtige Antwort: <span></span>
</div>
</div>
<?php
}
@@ -166,6 +162,11 @@ if (!isset($topicData)) {
?>
</div>
</div>
<!-- Toasts Container -->
<div id="toasts" class="fixed top-5 right-5 flex flex-col items-end space-y-4 z-50">
<!-- Einzelne Toasts werden hier dynamisch hinzugefügt -->
</div>
<?php
}
?>