aufräumen

This commit is contained in:
fingadumbledore 2023-05-10 12:28:11 +02:00
parent 22931b0a6d
commit 87bd4f36ef
3 changed files with 0 additions and 145 deletions

View File

@ -361,12 +361,6 @@ def server():
log_server("called /get_spiel", "INFO")
return render_template("spiel.html")
# Dies kommt wenn man auf Passwort vergessen klickt
@app.route("/password")
def password():
log_server("called /password", "INFO")
return render_template("passwort_ver.html")
# Diese seite mahnt den User sich anzumelden um den Inhalt zu sehen
@app.route("/passwd")
def passwd():

View File

@ -1,126 +0,0 @@
<html>
<head>
<style>
body {
display: flex;
flex-direction: column;
align-items: center;
font-family: Arial, sans-serif;
background-image: linear-gradient(to right, rgb(38, 134, 62), rgb(89, 89, 175))
}
#messages {
width: 50%;
height: 50%;
overflow-y: scroll;
border: 1px solid gray;
padding: 10px;
margin-bottom: 10px;
background-color: white;
border-radius: 10px;
}
.message {
margin-bottom: 10px;
animation: fadein 0.5s;
}
@keyframes fadein {
from { opacity: 0; }
to { opacity: 1; }
}
.username {
font-weight: bold;
color: blue;
}
.timestamp {
font-size: 12px;
color: gray;
}
input[type="text"] {
width: 50%;
padding: 10px;
margin-bottom: 10px;
font-size: 16px;
border-radius: 10px;
border: none;
}
button {
padding: 10px 20px;
font-size: 16px;
background-color: lightgray;
border: none;
border-radius: 10px;
cursor: pointer;
}
</style>
<script>
let unread = 0;
function updateTitle() {
document.title = "Chat (" + unread + ")";
}
function addMessage(username, message, timestamp) {
let messagesDiv = document.getElementById("messages");
let messageDiv = document.createElement("div");
messageDiv.classList.add("message");
let usernameSpan = document.createElement("span");
usernameSpan.classList.add("username");
usernameSpan.innerText = username;
let messageSpan = document.createElement("span");
messageSpan.innerText = message.substring(0, 80);
let timestampSpan = document.createElement("span");
timestampSpan.classList.add("timestamp");
timestampSpan.innerText = timestamp;
messageDiv.appendChild(usernameSpan);
messageDiv.appendChild(document.createTextNode(": "));
messageDiv.appendChild(messageSpan);
messageDiv.appendChild(document.createElement("br"));
messageDiv.appendChild(timestampSpan);
messagesDiv.appendChild(messageDiv);
messagesDiv.scrollTop = messagesDiv.scrollHeight;
unread += 1;
updateTitle();
}
let inputField = document.getElementById("input");
inputField.addEventListener("input", function() {
let value = inputField.value;
if (value.length > 80) {
inputField.value = value.substring(0, 80);
}
});
function getMessages() {
var xhr = new XMLHttpRequest();
xhr.open("GET", "/get");
xhr.onload = function() {
document.getElementById("messages").innerHTML = xhr.responseText;
};
xhr.send();
}
function sendMessage() {
var message = document.getElementById("message").value;
var username = document.getElementById("username").value;
var xhr = new XMLHttpRequest();
xhr.open("POST", "/send");
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.send("message=" + message + "&username=" + username);
}
</script>
</head>
<body onload="getMessages(); setInterval(getMessages, 1000);">
<div id="messages"></div>
<input type="hidden" id="username" placeholder="Username">
<input type="text" id="message" placeholder="Message">
<button onclick="sendMessage();">Send</button>
</body>
</html>

View File

@ -1,13 +0,0 @@
<html>
<head>
<title>Passwort vergessen</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" href="{{ url_for('static', filename='../static/css/style.css') }}">
</head>
<body>
<center><h1>Please Contact the Session Admin</h1>
<a href="javascript:history.back()">Go back</a></center>
</body>
</html>