This commit is contained in:
2020-12-18 19:25:40 +01:00
parent fb7b0271b3
commit d7b6283ffe
4 changed files with 169 additions and 3 deletions

View File

@@ -227,7 +227,7 @@ public class VotingController {
index++;
}
tableAction.updateCandidatesubmit_status(name, voterRepository);
return "candidateAddingSuccessful.html";
return "voteSuccessful.html";
}
}

View File

@@ -0,0 +1,54 @@
body {
background-color: rgb(44, 49, 54);
font-family: Arial, Helvetica, sans-serif;
}
.center-screen {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
}
.centered {
background: transparent;
margin: 0 auto;
padding: 20px;
width: 100%;
overflow: auto;
}
h1 {
color: #FFF;
}
h2 {
color: #FFF;
}
h2.time_remain {
color: #6d6d78;
}
.submitButton {
padding: .25em 0;
border: 0;
outline: 0;
background: #bb1515;
color: rgba(255, 255, 255, 0.85);
font-size: 2rem;
width: 500px;
letter-spacing: .0625rem;
border-radius: 12px;
box-shadow: 0 3px 5px 1px rgba(0, 0, 0, 0.25);
text-shadow: 0 -2px 0 rgba(0, 0, 0, 0.25), 0 1px 0 rgba(255, 255, 255, 0.2);
}
html,
body {
width: 100%;
height: 100%;
background-image: linear-gradient(to bottom right, #111E25 0%, #111 100%);
font-family: 'Lato', sans-serif;
}

View File

@@ -1,10 +1,47 @@
<!DOCTYPE html>
<html lang="en">
<html lang="de" xmlns:th="http://thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link th:href="@{/styles/voteSuccessful.css}" rel="stylesheet" />
</head>
<body>
<body class="center-screen">
<div class="centered">
<h1>Deine Auswahl fließt nun in die Wahl ein!</h1>
<h2>Danke fürs abstimmen!</h2>
<h2 class="time_remain" id="time_remain">Nächste Abstimmung in: </h2>
<button id="backButton" class="submitButton">Zurück zum Anfang</button>
</div>
</body>
<script>
document.getElementById("backButton").onclick = function() {
location.href = "/";
};
const zeroPad = (num, places) => String(num).padStart(places, '0')
// We can set endTime to whatever we want here (e.g. Midnight today )
// Use moment().endOf('day') to do this.
var dateFuture = new Date(2020, 11, 28, 0, 0);
// Show time remaining now.
showTimeRemaining();
// Set a timer to update the displayed clock every 1000 milliseconds.
setInterval(showTimeRemaining, 1000);
function showTimeRemaining() {
var dateNow = Date.now();
var days = zeroPad(Math.floor((dateFuture - dateNow) / (1000 * 60 * 60 * 24)), 2);
var hours = zeroPad(Math.floor(((dateFuture - dateNow) - days * 1000 * 60 * 60 * 24) / (1000 * 60 * 60)), 2);
var mins = zeroPad(Math.floor(((dateFuture - dateNow) - days * 1000 * 60 * 60 * 24 - hours * 1000 * 60 * 60) / (1000 * 60)), 2);
var secs = zeroPad(Math.floor(((dateFuture - dateNow) - days * 1000 * 60 * 60 * 24 - hours * 1000 * 60 * 60 - mins * 1000 * 60) / 1000), 2);
document.getElementById("time_remain").innerHTML = "Nächste Abstimmung in: " + days + "D " + hours + ":" + mins + ":" + secs;
console.log("Nächste Abstimmung in: " + days + "D " + hours + ":" + mins + ":" + secs);
}
</script>
</html>