diff --git a/public/js/back_client.js b/public/js/back_client.js index dedd962..5f5f3a0 100644 --- a/public/js/back_client.js +++ b/public/js/back_client.js @@ -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(); }); diff --git a/public/js/front_client.js b/public/js/front_client.js index 2abf6ba..27fffe0 100644 --- a/public/js/front_client.js +++ b/public/js/front_client.js @@ -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 */ }) + }); diff --git a/views/index.hbs b/views/index.hbs index 1680077..60b4668 100644 --- a/views/index.hbs +++ b/views/index.hbs @@ -3,9 +3,12 @@ Spielstand - - + + + + + @@ -13,6 +16,11 @@

Aktueller Spielstand

+ +
+ +
+

Team1