Skip to content

A simple library to display tournament brackets (round-robin, single elimination, double elimination).

License

Notifications You must be signed in to change notification settings

starcomsys/brackets-viewer.js

 
 

Repository files navigation

brackets-viewer.js

A simple library to display tournament brackets (round-robin, single elimination, double elimination)

It contains all the logic needed to display tournaments.

  • Supports translation (i18next)
  • Full vanilla JS (no framework)
  • A full working example of creating and displaying brackets (see ./demo/with-ui.html)
  • Themes supported, with CSS variables (see ./demo/themes)

npm Downloads jsDelivr Package Quality

Screenshot

How to use?

Import the library from npm using jsDelivr (you can replace @latest to lock a specific version):

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/brackets-viewer@latest/dist/brackets-viewer.min.css" />
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/brackets-viewer@latest/dist/brackets-viewer.min.js"></script>

Or from GitHub with (you can replace @master by any branch name, tag name or commit id):

<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/Drarig29/brackets-viewer.js@master/dist/brackets-viewer.min.css" />
<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/Drarig29/brackets-viewer.js@master/dist/brackets-viewer.min.js"></script>

Now, you can use it with data generated using brackets-manager or with crafted data following the brackets-model.

Demos

To quickly test, you can also try the demos by visiting ./demo/index.html.

To use json-server, you can:

  • Run the npm script named db to serve the static database file ./demo/db.json

    npm run db
  • Or use directly the db.json file generated by unit tests in the brackets-manager project

    npx json-server --watch path/to/brackets-manager/db.json

Credits

This library has been created to be used by the Nantarena.

It has been inspired by:

About

A simple library to display tournament brackets (round-robin, single elimination, double elimination).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 86.7%
  • SCSS 9.6%
  • JavaScript 3.7%