dol-match-bracket
Version:
- Javascript Library to make tree structured tournament brackets. - using Recursion to generate tournament bracket based on match JSON not team JSON(example below)
85 lines (83 loc) • 1.86 kB
HTML
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<link rel="stylesheet" href="./css/bracket.min.css" />
</head>
<body>
<div id="dol-bracket"></div>
<script src="./js/bracket.min.js"></script>
<script>
let arr = [
{
id: 1,
date: 8.18,
stadium: '목동',
time: '9:00',
school1: 'a',
score1: 9,
score2: 4,
school2: 'b',
state: '경기종료',
live: '진행',
next: 3,
},
{
id: 2,
date: 8.18,
stadium: '목동',
time: '11:30',
school1: 'c',
score1: 10,
score2: 5,
school2: 'd',
state: '경기종료',
live: '진행',
next: 4,
},
{
id: 3,
date: 8.18,
stadium: '목동',
time: '16:30',
school1: 'e',
score1: 13,
score2: 2,
school2: '1',
state: '경기전',
live: '진행',
next: 5,
},
{
id: 4,
date: 8.18,
stadium: '목동',
time: '16:30',
school1: 'f',
score1: 13,
score2: 2,
school2: '2',
state: '경기전',
live: '진행',
next: 5,
},
{
id: 5,
date: 8.18,
stadium: '목동',
time: '16:30',
school1: '3',
score1: 13,
score2: 2,
school2: '4',
state: '경기전',
live: '진행',
next: null,
},
];
MakeDolBracket('#dol-bracket', arr, {});
</script>
</body>
</html>