180 lines
4.9 KiB
HTML
180 lines
4.9 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Hausaufgaben-Robo</title>
|
|
<style>
|
|
body {
|
|
font-family: 'Arial', sans-serif;
|
|
margin: 0;
|
|
padding: 0;
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
height: 100dvh;
|
|
}
|
|
|
|
body {
|
|
background: linear-gradient(315deg, rgb(134, 65, 163) 0%, rgb(196, 99, 238) 100%);
|
|
}
|
|
|
|
form {
|
|
background-color: rgb(255, 255, 255);
|
|
padding: 20px;
|
|
border-radius: 8px;
|
|
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
|
width: 300px;
|
|
box-sizing: border-box;
|
|
transition: box-shadow 0.3s ease-in-out;
|
|
}
|
|
|
|
form:hover {
|
|
box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
|
|
}
|
|
|
|
label {
|
|
display: block;
|
|
margin-bottom: 8px;
|
|
color: rgb(102, 51, 153);
|
|
}
|
|
|
|
input {
|
|
width: 100%;
|
|
padding: 8px;
|
|
margin-bottom: 16px;
|
|
background-color: transparent !important;
|
|
box-sizing: border-box;
|
|
border: none;
|
|
border-bottom: 1px solid rgb(142, 68, 173, 0.25);
|
|
outline: none;
|
|
transition: border-bottom 0.3s ease-in-out;
|
|
position: relative;
|
|
}
|
|
|
|
input:focus,
|
|
input:hover {
|
|
border-bottom: 1px solid rgb(142, 68, 173, 1);
|
|
}
|
|
|
|
input+label {
|
|
position: absolute;
|
|
top: 8px;
|
|
left: 8px;
|
|
color: #8E44AD;
|
|
transition: top 0.3s ease-in-out, font-size 0.3s ease-in-out;
|
|
}
|
|
|
|
input:focus+label,
|
|
input:not(:placeholder-shown)+label {
|
|
top: -14px;
|
|
font-size: 12px;
|
|
}
|
|
|
|
button {
|
|
background-color: rgb(102, 51, 153);
|
|
/* Dunkel-lila Hintergrund */
|
|
color: white;
|
|
/* Weiße Schriftfarbe */
|
|
padding: 10px;
|
|
border: none;
|
|
border-radius: 4px;
|
|
cursor: pointer;
|
|
width: 100%;
|
|
transition: background-color 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
|
|
box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
|
|
/* Leicht erhabener Effekt */
|
|
}
|
|
|
|
/* Aktualisierte Stilregel für den Button im Hover-Zustand */
|
|
button:hover {
|
|
background-color: rgb(72, 61, 139);
|
|
/* Dunkleres Lila im Hover-Zustand */
|
|
box-shadow: 0px 6px 8px rgba(0, 0, 0, 0.2);
|
|
/* Stärkerer erhabener Effekt im Hover-Zustand */
|
|
}
|
|
|
|
p {
|
|
color: rgb(106, 90, 205);
|
|
text-align: center;
|
|
margin-top: 10px;
|
|
margin-bottom: 10px;
|
|
}
|
|
|
|
p.q-amount {
|
|
font-size: small;
|
|
color: rgb(180, 180, 180);
|
|
}
|
|
|
|
a {
|
|
color: rgb(106, 90, 205);
|
|
text-decoration: underline;
|
|
}
|
|
|
|
.alert-message {
|
|
padding: 10px;
|
|
border-radius: 5px;
|
|
font-weight: bold;
|
|
text-align: center;
|
|
}
|
|
|
|
.alert-success {
|
|
background-color: lightgreen;
|
|
color: green;
|
|
}
|
|
|
|
.alert-danger {
|
|
background-color: lightcoral;
|
|
color: red;
|
|
}
|
|
|
|
.image-container {
|
|
max-height: 50pt;
|
|
overflow: hidden;
|
|
text-align: center;
|
|
/* Zentriert das Bild horizontal */
|
|
}
|
|
|
|
.image-container img {
|
|
max-height: 50pt;
|
|
/* max-width: 100%; */
|
|
/* height: auto; */
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<form method="POST" action="/submit_quiz">
|
|
<p name="question">{{ frage.index }}. {{ frage.question }}</p>
|
|
<input type="text" name="answer" placeholder="Antwort eingeben..." required autofocus>
|
|
<button type="submit">Antwort abschicken</button>
|
|
<p class="q-amount">{{correct_sum}} von {{max_correct_sum}} nacheinander korrekt.</p>
|
|
<br />
|
|
{% if debugtxt %}
|
|
<p class="debug">{{debugtxt}}</p>
|
|
{% endif %}
|
|
{% if alerttxt %}
|
|
<div id="message" class="alert-message alert-danger">
|
|
{{alerttxt}}
|
|
</div>
|
|
{% endif %}
|
|
{% if successtxt %}
|
|
<div id="message" class="alert-message alert-success">
|
|
{{successtxt | safe}}
|
|
</div>
|
|
{% endif %}
|
|
{% if won %}
|
|
<br />
|
|
<br />
|
|
<div class="image-container">
|
|
<img src="{{ url_for('static', filename='pics/cake.jpg') }}" alt="Suessigkeit">
|
|
</div>
|
|
{% endif %}
|
|
|
|
</form>
|
|
|
|
</body>
|
|
|
|
</html> |