first simple bracket

This commit is contained in:
2017-03-16 10:41:51 +01:00
parent 8eea0119b1
commit 6233ae0927
3 changed files with 47 additions and 4 deletions

View File

@ -1,4 +1,3 @@
// @flow
'use strict';
// This is the backend client js
let iosocket: object = io.connect();
@ -9,7 +8,7 @@ iosocket.on('clientrefresh', () => {
});
iosocket.on('stateChange', () => {
location.reload();
});

View File

@ -20,3 +20,39 @@ iosocket.emit('loadState',context);
function createTeam(member1, member2){
}
var singleElimination = {
"teams": [ // Matchups
["Team 1", "Team 2"], // First match
["Team 3", "Team 4"] // Second match
],
"results": [ // List of brackets (single elimination, so only one bracket)
[ // List of rounds in bracket
[ // First round in this bracket
[1, 2], // Team 1 vs Team 2
[3, 4] // Team 3 vs Team 4
],
[ // Second (final) round in single elimination bracket
[5, 6], // Match for first place
[7, 8] // Match for 3rd place
]
]
]
}
var minimalData = {
teams : [
["Team 1", "Team 2"], /* first matchup */
["Team 3", "Team 4"] /* second matchup */
],
results : [
[[1,2]], /* first round */
[[4,6]] /* second round */
]
}
$( document ).ready(function() {
console.log('done')
$('#team-container').bracket({
init: minimalData /* data to initialize the bracket with */ })
});