diff --git a/html/test_13.02.20/IT2, 2-timarsprøve_ Påskerenn 13 februar 2020.pdf b/html/test_13.02.20/IT2, 2-timarsprøve_ Påskerenn 13 februar 2020.pdf new file mode 100644 index 0000000..3d0e337 Binary files /dev/null and b/html/test_13.02.20/IT2, 2-timarsprøve_ Påskerenn 13 februar 2020.pdf differ diff --git a/html/test_13.02.20/index.html b/html/test_13.02.20/index.html new file mode 100644 index 0000000..040759f --- /dev/null +++ b/html/test_13.02.20/index.html @@ -0,0 +1,21 @@ + + + + + + + Test + + + + + + +

Test

+ +
+
+
+ + + \ No newline at end of file diff --git a/html/test_13.02.20/oppgaver/.keep b/html/test_13.02.20/oppgaver/.keep new file mode 100644 index 0000000..e69de29 diff --git a/html/test_13.02.20/oppgaver/oppgave1/images/easter-154509.svg b/html/test_13.02.20/oppgaver/oppgave1/images/easter-154509.svg new file mode 100644 index 0000000..03ce8b2 --- /dev/null +++ b/html/test_13.02.20/oppgaver/oppgave1/images/easter-154509.svg @@ -0,0 +1,1866 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/html/test_13.02.20/oppgaver/oppgave1/oppgave.html b/html/test_13.02.20/oppgaver/oppgave1/oppgave.html new file mode 100644 index 0000000..1afcf4d --- /dev/null +++ b/html/test_13.02.20/oppgaver/oppgave1/oppgave.html @@ -0,0 +1,67 @@ + + + + + + + Oppgave 1 + + + + + +

Påskerennet 2020 - Olastøl, Hardanger

+ +
+ +
+ +
+ +

Legg til deltaker

+ +
+
+ + + + + +
+
+ +
+
+ + + + + + + + + +
+
+
+ +
+ + + + + + + + + +
NavnAlderResultat 1Resultat 2Resultat 3Resultatsum
+
+ +
+ +
+
+ + + \ No newline at end of file diff --git a/html/test_13.02.20/oppgaver/oppgave1/oppgave.js b/html/test_13.02.20/oppgaver/oppgave1/oppgave.js new file mode 100644 index 0000000..9de5647 --- /dev/null +++ b/html/test_13.02.20/oppgaver/oppgave1/oppgave.js @@ -0,0 +1,152 @@ + +/* Hardcoded participant list */ +let participants = [ + { + name: "Harald", + age: "33", + results: [undefined, undefined, undefined], + resultSum: 0 + }, { + name: "Borghild", + age: "25", + results: [undefined, undefined, undefined], + resultSum: 0 + }, { + name: "Ola", + age: "12", + results: [undefined, undefined, undefined], + resultSum: 0 + }, { + name: "Knut", + age: "62", + results: [undefined, undefined, undefined], + resultSum: 0 + }, { + name: "Lise", + age: "46", + results: [undefined, undefined, undefined], + resultSum: 0 + } +] + +/* Add HTML DOM reference variables */ +const graphicsBox = document.getElementById("graphics"); + +const addParticipantForm = document.getElementById("addParticipantForm"); +const nameRegistrationInput = document.getElementById("nameRegistration"); +const ageRegistrationInput = document.getElementById("ageRegistration"); +const addParticipantButton = document.getElementById("addParticipant"); + +const updateResultsForm = document.getElementById("updateResultsForm"); +const nameSelector = document.getElementById("nameSelector"); +const activity1Input = document.getElementById("activity1"); +const activity2Input = document.getElementById("activity2"); +const activity3Input = document.getElementById("activity3"); +const updateResultsButton = document.getElementById("updateResults"); + +const participantTable = document.getElementById("participants"); +const participantTableHeaders = participantTable.innerHTML; + +const printResultsButton = document.getElementById("printResultsButton"); +const resultTable = document.getElementById("results"); + +/* Add event listeners */ +addParticipantButton.addEventListener("click", addParticipant, false); +updateResultsButton.addEventListener("click", updateResults, false); +printResultsButton.addEventListener("click", printResults, false); +nameSelector.addEventListener("onchange", updateSelector, false); + + +/* Init HTML */ +updateParticipants(); + +/* Oppdaterer HTML og selector med ny deltakerliste og score */ +function updateParticipants() { + + /* Reset inner HTML data */ + participantTable.innerHTML = participantTableHeaders; + nameSelector.innerHTML = ""; + + for (participant in participants) { + + + /* Update HTML */ + participantTable.innerHTML+= + `` + + `${participants[participant].name}` + + `${participants[participant].age}`; + + for (result in participants[participant].results) { + if (participants[participant].results[result] != undefined) { + participantTable.innerHTML += `${participants[participant].results[result]}`; + } + } + + participantTable.innerHTML += ``; + + /* Update selector */ + nameSelector.innerHTML += `` + + } +} + +/* Legger til deltaker og kjører updateParticipants */ +function addParticipant(evt) { + evt.preventDefault(); + + participants = [...participants, { + name: nameRegistrationInput.value, + age: ageRegistrationInput.value, + results: [undefined, undefined, undefined], + resultSum: 0 + }] + + updateParticipants(); + +} + +/* Redigerer poenglisten og kjører updateParticipants */ +function updateResults(evt) { + evt.preventDefault(); + + const participantNum = nameSelector.value; + participants[participantNum].results[0] = activity1Input.value; + participants[participantNum].results[1] = activity2Input.value; + participants[participantNum].results[2] = activity3Input.value; + + updateParticipants(); + +} + +/* Oppdaterer poengvelgerne etter valgt deltaker */ +function updateSelector() { + const participant = participants[nameSelector.value]; + if (participant.results[0] != undefined) { + activity1Input.value = participant.results[0]; + } + if (participant.results[1] != undefined) { + activity2Input.value = participant.results[1]; + } + if (participant.results[2] != undefined) { + activity3Input.value = participant.results[2]; + } +} + +/* Printer ut resultater */ +function printResults() { + + /* Remove participants without full score */ + // const resultParticipants = participants.map(() =>) + + /* Sort participants by result */ + + resultTable.innerHTML = "" + + "Plassering" + + "Navn" + + "Aktivitet 1" + + "Aktivitet 2" + + "Aktivitet 3" + + "Total Poengsum" + + "" + +} \ No newline at end of file diff --git a/html/test_13.02.20/resources/css/.keep b/html/test_13.02.20/resources/css/.keep new file mode 100644 index 0000000..e69de29 diff --git a/html/test_13.02.20/resources/css/main.css b/html/test_13.02.20/resources/css/main.css new file mode 100644 index 0000000..5e3a25d --- /dev/null +++ b/html/test_13.02.20/resources/css/main.css @@ -0,0 +1,131 @@ +body { + background-color: #282828; + color: white; + margin: 0px; + padding: 0px; + margin-right: 2%; + margin-left: 8%; + margin-top: 5%; + font-family: museo-sans-rounded, sans-serif; + font-weight: 300; + font-style: normal; +} + +button { + background-color: #787878; + padding: 15px; + display: inline-block; + border: 2px solid white; + border-radius: 15px; + color: white; + font-size: 16pt; +} +button:hover { + background-color: #505050; +} +button:focus { + outline: 0; +} + +h1 { + color: #2883d0; + text-align: center; + background-color: #3c3c3c; + padding: 15px; + margin-left: 10%; + margin-right: 10%; + border-radius: 15px; +} + +h2 { + color: #91e22c; +} + +a { + color: #66D9EF; +} +a:hover { + color: #A6E22E; +} + +input[type=color] { + width: 4em; + height: 2em; + background-color: #787878; +} + +table { + width: 100%; +} + +td, th { + border: 1px solid white; + padding: 8px; +} + +th { + text-align: left; + background-color: #4CAF50; +} + +tr:nth-child(even) { + background-color: #00000033; +} +tr:hover { + background-color: rgba(255, 255, 255, 0.281); +} + +.center { + background-color: #505050; + margin: auto; + margin-bottom: 10%; + width: 70%; + padding: 5%; + height: max-content; + border-radius: 15px; +} +.center * { + margin: auto; +} + +.inline { + margin: 15px; +} +.inline * { + display: inline-block; +} + +.leftalign * { + margin: 15px; + text-align: left; +} + +.textboxGrid { + display: grid; + justify-content: space-evenly; + align-content: space-evenly; + grid-template-columns: repeat(3, 1fr); + grid-column-gap: auto; + grid-row-gap: 20px; +} +.textboxGrid * { + size: 100%; + padding: 40px 80px; + background-color: #787878; +} +.textboxGrid .linkElement { + border: 1px solid black; +} +.textboxGrid .linkElement:hover { + background-color: #505050; + cursor: pointer; +} +.textboxGrid .linkElement a:hover { + text-decoration: underline; + color: #66D9EF; +} +.textboxGrid .linkElement * { + margin: 0px; + padding: 0px; + background-color: transparent; +} diff --git a/html/test_13.02.20/resources/js/linkConnector.js b/html/test_13.02.20/resources/js/linkConnector.js new file mode 100644 index 0000000..5e37d04 --- /dev/null +++ b/html/test_13.02.20/resources/js/linkConnector.js @@ -0,0 +1,28 @@ +const taskArray = tasks.tasks; +const grid = document.getElementsByClassName("textboxGrid")[0]; + +for (i=0; i -

Test

+

Test - 13. Februar 2020