first simple bracket
This commit is contained in:
parent
8eea0119b1
commit
6233ae0927
@ -1,4 +1,3 @@
|
|||||||
// @flow
|
|
||||||
'use strict';
|
'use strict';
|
||||||
// This is the backend client js
|
// This is the backend client js
|
||||||
let iosocket: object = io.connect();
|
let iosocket: object = io.connect();
|
||||||
@ -9,7 +8,7 @@ iosocket.on('clientrefresh', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
iosocket.on('stateChange', () => {
|
iosocket.on('stateChange', () => {
|
||||||
|
|
||||||
location.reload();
|
location.reload();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -20,3 +20,39 @@ iosocket.emit('loadState',context);
|
|||||||
function createTeam(member1, member2){
|
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 */ })
|
||||||
|
});
|
||||||
|
@ -3,9 +3,12 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>Spielstand</title>
|
<title>Spielstand</title>
|
||||||
<link rel='stylesheet' href='/css/style.css' />
|
<link rel='stylesheet' type="text/css" href='/css/style.css' />
|
||||||
<link rel='stylesheet' href='/css/bootstrap.min.css' />
|
<link rel='stylesheet' type="text/css" href='/css/bootstrap.min.css' />
|
||||||
|
<link rel="stylesheet" type="text/css" href="/css/jquery.bracket.min.css" />
|
||||||
|
|
||||||
<script type='text/javascript' src='/js/jquery-3.1.1.min.js'></script>
|
<script type='text/javascript' src='/js/jquery-3.1.1.min.js'></script>
|
||||||
|
<script type='text/javascript' src='/js/jquery.bracket.min.js'></script>
|
||||||
<script type='text/javascript' src='/js/bootstrap.min.js'></script>
|
<script type='text/javascript' src='/js/bootstrap.min.js'></script>
|
||||||
<script type='text/javascript' src='/socket.io/socket.io.js'></script>
|
<script type='text/javascript' src='/socket.io/socket.io.js'></script>
|
||||||
|
|
||||||
@ -13,6 +16,11 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>Aktueller Spielstand</h1>
|
<h1>Aktueller Spielstand</h1>
|
||||||
|
|
||||||
|
<div id="team-container">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="team-box">
|
<div class="team-box">
|
||||||
<h3>Team1</h3>
|
<h3>Team1</h3>
|
||||||
<div class="playername1">
|
<div class="playername1">
|
||||||
|
Loading…
Reference in New Issue
Block a user