-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
299 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const config = { | ||
wtosLoginUrl: "https://wtos.nl/wrslogin.php" | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>WTOS Uitslagen 2022</title> | ||
<link | ||
rel="stylesheet" | ||
href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.6.1/css/bulma.min.css" | ||
/> | ||
<link rel="stylesheet" href="/static/wrs.css" /> | ||
<link rel="stylesheet" href="/static/elm-datepicker.css" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
|
||
<script | ||
defer | ||
src="https://use.fontawesome.com/releases/v5.0.6/js/all.js" | ||
></script> | ||
</head> | ||
<body> | ||
<div id="main"></div> | ||
|
||
<script src="wrs.js"></script> | ||
<script src="config.js"></script> | ||
<script src="races.js"></script> | ||
<script src="riders.js"></script> | ||
<script src="results.js"></script> | ||
<script src="index.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
"use strict"; | ||
|
||
function hasParam(name) { | ||
var regex = new RegExp("[\\?&]" + name); | ||
var results = regex.exec(location.search); | ||
return results !== null; | ||
} | ||
|
||
var url = new URL(window.location.href); | ||
var token = url.searchParams.get("token"); | ||
|
||
if (token !== null) { | ||
window.history.replaceState(null, null, window.location.href.split("?")[0]); | ||
} | ||
|
||
const { wtosLoginUrl } = config; | ||
|
||
const app = Elm.Main.init({ | ||
node: document.getElementById("main"), | ||
flags: { | ||
wtosLoginUrl | ||
} | ||
}); | ||
|
||
loadRiders(); | ||
loadRaces(); | ||
loadResults(); | ||
|
||
function loadRiders() { | ||
const arr = Object.keys(riders).map(function(key) { | ||
return Object.assign( | ||
{ | ||
key: key | ||
}, | ||
riders[key] | ||
); | ||
}); | ||
|
||
app.ports.infoForElm.send({ | ||
tag: "RidersLoaded", | ||
data: arr | ||
}); | ||
} | ||
|
||
function loadRaces() { | ||
const arr = Object.keys(races) | ||
.map(function(key) { | ||
return Object.assign( | ||
{ | ||
key: key | ||
}, | ||
races[key] | ||
); | ||
}) | ||
.map(race => { | ||
race.date = new Date(race.date.split(" ")[0]).toISOString(); | ||
return race; | ||
}); | ||
|
||
app.ports.infoForElm.send({ | ||
tag: "RacesLoaded", | ||
data: arr | ||
}); | ||
} | ||
|
||
function loadResults() { | ||
const arr = Object.keys(results).map(function(key) { | ||
return Object.assign( | ||
{ | ||
key: key | ||
}, | ||
results[key] | ||
); | ||
}); | ||
app.ports.infoForElm.send({ | ||
tag: "ResultsLoaded", | ||
data: arr | ||
}); | ||
} | ||
|
||
function addRace() {} | ||
|
||
function addRider() {} | ||
|
||
function addResult() {} | ||
|
||
function editResult() {} | ||
|
||
function userSignedIn() {} | ||
|
||
function userSignOut() {} | ||
|
||
app.ports.infoForOutside.subscribe(function(msg) { | ||
if (msg.tag === "RiderAdd") { | ||
addRider(msg.data); | ||
} else if (msg.tag === "RaceAdd") { | ||
addRace(msg.data); | ||
} else if (msg.tag === "ResultAdd") { | ||
addResult(msg.data); | ||
} else if (msg.tag === "ResultEdit") { | ||
editResult(msg.data); | ||
} else if (msg.tag === "UserSignOut") { | ||
userSignOut(); | ||
} else { | ||
console.log("msg", msg); | ||
document.getElementsByTagName("body")[0].innerHTML = | ||
"Something went wrong. Please try again in Chrome or see console for detailed error message."; | ||
} | ||
}); |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
.elm-datepicker--container { | ||
position: relative; } | ||
|
||
.elm-datepicker--input:focus { | ||
outline: 0; } | ||
|
||
.elm-datepicker--picker { | ||
position: absolute; | ||
border: 1px solid #CCC; | ||
z-index: 10; | ||
background-color: white; } | ||
|
||
.elm-datepicker--picker-header, | ||
.elm-datepicker--weekdays { | ||
background: #F2F2F2; } | ||
|
||
.elm-datepicker--picker-header { | ||
display: flex; | ||
align-items: center; } | ||
|
||
.elm-datepicker--prev-container, | ||
.elm-datepicker--next-container { | ||
flex: 0 1 auto; | ||
cursor: pointer; } | ||
|
||
.elm-datepicker--month-container { | ||
flex: 1 1 auto; | ||
padding: 0.5em; | ||
display: flex; | ||
flex-direction: column; } | ||
|
||
.elm-datepicker--month, | ||
.elm-datepicker--year { | ||
flex: 1 1 auto; | ||
cursor: default; | ||
text-align: center; } | ||
|
||
.elm-datepicker--year { | ||
font-size: 0.6em; | ||
font-weight: 700; } | ||
|
||
.elm-datepicker--prev, | ||
.elm-datepicker--next { | ||
border: 6px solid transparent; | ||
background-color: inherit; | ||
display: block; | ||
width: 0; | ||
height: 0; | ||
padding: 0 0.2em; } | ||
|
||
.elm-datepicker--prev { | ||
border-right-color: #AAA; } | ||
.elm-datepicker--prev:hover { | ||
border-right-color: #BBB; } | ||
|
||
.elm-datepicker--next { | ||
border-left-color: #AAA; } | ||
.elm-datepicker--next:hover { | ||
border-left-color: #BBB; } | ||
|
||
.elm-datepicker--table { | ||
border-spacing: 0; | ||
border-collapse: collapse; | ||
font-size: 0.8em; } | ||
.elm-datepicker--table td { | ||
width: 2em; | ||
height: 2em; | ||
text-align: center; } | ||
|
||
.elm-datepicker--row { | ||
border-top: 1px solid #F2F2F2; } | ||
|
||
.elm-datepicker--dow { | ||
border-bottom: 1px solid #CCC; | ||
cursor: default; } | ||
|
||
.elm-datepicker--day { | ||
cursor: pointer; } | ||
.elm-datepicker--day:hover { | ||
background: #F2F2F2; } | ||
|
||
.elm-datepicker--disabled { | ||
cursor: default; | ||
color: #DDD; } | ||
.elm-datepicker--disabled:hover { | ||
background: inherit; } | ||
|
||
.elm-datepicker--picked { | ||
color: white; | ||
background: darkblue; } | ||
.elm-datepicker--picked:hover { | ||
background: darkblue; } | ||
|
||
.elm-datepicker--today { | ||
font-weight: bold; } | ||
|
||
.elm-datepicker--other-month { | ||
color: #AAA; } | ||
.elm-datepicker--other-month.elm-datepicker--disabled { | ||
color: #EEE; } | ||
.elm-datepicker--other-month.elm-datepicker--picked { | ||
color: white; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
.spinner { | ||
width: 70px; | ||
text-align: center; | ||
} | ||
|
||
.spinner > div { | ||
width: 18px; | ||
height: 18px; | ||
background-color: #333; | ||
|
||
border-radius: 100%; | ||
display: inline-block; | ||
-webkit-animation: sk-bouncedelay 1.4s infinite ease-in-out both; | ||
animation: sk-bouncedelay 1.4s infinite ease-in-out both; | ||
} | ||
|
||
.spinner .bounce1 { | ||
-webkit-animation-delay: -0.32s; | ||
animation-delay: -0.32s; | ||
} | ||
|
||
.spinner .bounce2 { | ||
-webkit-animation-delay: -0.16s; | ||
animation-delay: -0.16s; | ||
} | ||
|
||
@-webkit-keyframes sk-bouncedelay { | ||
0%, 80%, 100% { -webkit-transform: scale(0) } | ||
40% { -webkit-transform: scale(1.0) } | ||
} | ||
|
||
@keyframes sk-bouncedelay { | ||
0%, 80%, 100% { | ||
-webkit-transform: scale(0); | ||
transform: scale(0); | ||
} 40% { | ||
-webkit-transform: scale(1.0); | ||
transform: scale(1.0); | ||
} | ||
} | ||
|
||
label { | ||
padding-left: 5px; | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters