Have to go to bed now need to write
This commit is contained in:
11
src/main/resources/Mottos.txt
Normal file
11
src/main/resources/Mottos.txt
Normal file
@@ -0,0 +1,11 @@
|
||||
CannABIs - wir haben es durchgezogen!
|
||||
ABI 2,010 ‰ - Meist dichter als Denker
|
||||
KABItän Blaubär - Immer blau und trotzdem schlau
|
||||
HABI Potter - Wir verlassen die Kammer des Schreckens
|
||||
A BItch - Für einen Punkt tue ich alles!
|
||||
ABIthur - Wenn das Elite von die Gymnahsium gehen tut
|
||||
LABIrinth - Planlos zum Ziel
|
||||
ABIcrombie & Fitch - Models gehen, Elche bleiben (Abercrombie & Fitch)
|
||||
SemipermeABIlität - Nur die Besten kommen durch
|
||||
KohlrABI - Wir machen uns vom Acker
|
||||
ABIgasmus - Aber das war nur das Vorspiel
|
||||
66
src/main/resources/static/styles/mottoVoting.css
Normal file
66
src/main/resources/static/styles/mottoVoting.css
Normal file
@@ -0,0 +1,66 @@
|
||||
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;
|
||||
font-size: 75px;
|
||||
}
|
||||
|
||||
h2.mottoHeader {
|
||||
color: #FFF;
|
||||
font-size: 50px;
|
||||
}
|
||||
|
||||
button {
|
||||
background: transparent;
|
||||
border: none;
|
||||
color: #FFF;
|
||||
font-size: 35px;
|
||||
font-weight: normal;
|
||||
letter-spacing: .125rem;
|
||||
text-transform: uppercase;
|
||||
text-align: center;
|
||||
transition: opacity .25s .5s;
|
||||
margin: 0.5%;
|
||||
}
|
||||
|
||||
.submitButton {
|
||||
margin-top: 5%;
|
||||
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;
|
||||
}
|
||||
65
src/main/resources/templates/mottoVoting.html
Normal file
65
src/main/resources/templates/mottoVoting.html
Normal file
@@ -0,0 +1,65 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" xmlns:th="https://www.thymeleaf.org/">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
<link th:href="@{/styles/mottoVoting.css}" rel="stylesheet" />
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
|
||||
</head>
|
||||
|
||||
|
||||
<body class="center-screen">
|
||||
|
||||
<div class="centered">
|
||||
<h1>Wähle das Abimotto:</h1>
|
||||
<div id="votingButtons">
|
||||
<div th:each="motto : ${mottos}" class="voteDiv">
|
||||
<button class="inputButton" th:id="|motto${motto.id}|" th:text="${motto.name}" th:onclick="|setColor(motto${motto.id})|"></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form action="#" th:action="@{/saveMotto}" method="post" id="mottoForm">
|
||||
<input id="voteValue" type="hidden" name="voteValue" value="" />
|
||||
<input id="voterName" type="hidden" name="name" th:value="${name}" />
|
||||
<button class="submitButton" id="btnNext" onclick=getVotes()>Auswahl bestätigen</button>
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
function setColor(button) {
|
||||
console.log(button);
|
||||
groupButtons = document.querySelectorAll('[id^=motto]');
|
||||
groupButtons.forEach(button => {
|
||||
button.style.background = 'transparent';
|
||||
button.style.fontWeight = 'normal';
|
||||
});
|
||||
button.style.background = "#bb1515";
|
||||
button.style.fontWeight = 'bold';
|
||||
}
|
||||
|
||||
function rgbToHex(rgb) {
|
||||
rgb = rgb.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i);
|
||||
var color = (rgb && rgb.length === 4) ? "#" +
|
||||
("0" + parseInt(rgb[1], 10).toString(16)).slice(-2) +
|
||||
("0" + parseInt(rgb[2], 10).toString(16)).slice(-2) +
|
||||
("0" + parseInt(rgb[3], 10).toString(16)).slice(-2) : '';
|
||||
|
||||
return color;
|
||||
}
|
||||
|
||||
function getVotes() {
|
||||
groupButtons = document.querySelectorAll(".inputButton");
|
||||
var voteID;
|
||||
groupButtons.forEach(button => {
|
||||
if (button.style.fontWeight == 'bold') {
|
||||
voteID = 5;
|
||||
}
|
||||
});
|
||||
input = document.getElementById("voteValue");
|
||||
input.value = voteID;
|
||||
document.getElementById("mottoForm").submit();
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user