mirror of
https://github.com/lucaspalomodevelop/Party.git
synced 2026-03-13 00:07:21 +00:00
name in sessionstorage
This commit is contained in:
parent
bd68c79469
commit
f71b40cc4b
@ -299,8 +299,8 @@ border: 1px solid #555;
|
||||
|
||||
.submit_button{
|
||||
position: fixed;
|
||||
width: 250px;
|
||||
height: 50px;
|
||||
width: 10%;
|
||||
height: 5%;
|
||||
background-color: #454443;
|
||||
border-radius: 10px;
|
||||
cursor: pointer;
|
||||
|
||||
@ -1,3 +1,11 @@
|
||||
window.addEventListener('DOMContentLoaded', function() {
|
||||
var name = sessionStorage.getItem('name'); // Den Namen aus dem SessionStorage abrufen
|
||||
|
||||
if (name) {
|
||||
document.getElementById('peter').textContent = name; // Den Namen bei dem Element mit der ID "peter" ausgeben
|
||||
}
|
||||
});
|
||||
|
||||
// Array zum Speichern der Div-Elemente
|
||||
var divs = document.querySelectorAll('.hidden-div');
|
||||
// Aktuell ausgewählter Button-Index
|
||||
|
||||
@ -7,10 +7,10 @@
|
||||
</head>
|
||||
<body>
|
||||
<h1>Party Controller</h1>
|
||||
<form action="/api/login">
|
||||
<form id="loginForm" action="/api/login">
|
||||
<div class="button-container">
|
||||
<input type="text" name="name" placeholder="Name" maxlength="20" minlength="1" required>
|
||||
<button class="button" type="submit">Login</button>
|
||||
<input id="nameInput" type="text" name="name" placeholder="Name" maxlength="20" minlength="1" required>
|
||||
<button id="loginButton" class="button" type="submit">Login</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@ -18,10 +18,19 @@
|
||||
<div>Partycontroller Version 0.1</div>
|
||||
<div>© Lostkids</div>
|
||||
</footer>
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
document.getElementById("loginForm").addEventListener("submit", function(event) {
|
||||
event.preventDefault(); // Verhindert das normale Absenden des Formulars
|
||||
|
||||
var nameInput = document.getElementById("nameInput");
|
||||
var name = nameInput.value;
|
||||
|
||||
sessionStorage.setItem("name", name);
|
||||
|
||||
// Das Formular manuell absenden
|
||||
this.submit();
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='../static/css/session.css') }}">
|
||||
</head>
|
||||
<body>
|
||||
{% block content %}
|
||||
<div class="top-bar"></div>
|
||||
|
||||
<div class="content">
|
||||
@ -25,7 +26,7 @@
|
||||
|
||||
<p class="eventinfo">Nächstes Event: </p>
|
||||
|
||||
<p class="peter" onclick="togglePopup()">Peter</p> <!-- Hinzugefügtes "onclick"-Attribut -->
|
||||
<p id="peter" class="peter" onclick="togglePopup()">Peter</p> <!-- Hinzugefügtes "onclick"-Attribut -->
|
||||
|
||||
<p class="songinfo">Song: </p>
|
||||
<div class="topnext" onclick=""></div>
|
||||
@ -111,6 +112,7 @@
|
||||
<div>Partycontroller Version 0.1</div>
|
||||
<div>© Lostkids</div>
|
||||
</footer>
|
||||
{% endblock %}
|
||||
<script src="{{url_for('static', filename='js/session.js')}}"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user