sidelined.chdevelopers sidelined.ch ↗

Widgets

A club's list of unavailable players on your site: two lines of HTML, no account, no key. The widget loads in the background, updates itself and can't break your page's layout.

Quickstart #

Put the element where the widget should appear, and the script once anywhere on the page:

<sidelined-widget team="zug"></sidelined-widget>
<script async src="https://embed.sidelined.ch/v1.js"></script>

That's it. The team is the club's slug from the table below.

Playground #

Options #

AttributeValuesDefault
teama club's slug (required)
variantlist (players, reason, expected return) or badge (the count and names)list
themelight, dark or auto (follows the reader's setting)auto
limithow many players the list shows before "+N more", 1–205

Change an attribute later (for example with JavaScript) and the widget redraws.

Clubs #

SlugClub
bielEHC Biel-Bienne
klotenEHC Kloten
zugEV Zug
fribourgFribourg-Gottéron
geneveGenève-Servette HC
ajoieHC Ajoie
ambriHC Ambrì-Piotta
davosHC Davos
luganoHC Lugano
lausanneLausanne HC
bernSC Bern
langnauSCL Tigers
rapperswilSCRJ Lakers
zscZSC Lions

GET https://api.sidelined.ch/v1/teams returns the same list.

Without JavaScript: the iframe #

Some content management systems remove scripts. The same widget works as an iframe:

<iframe src="https://embed.sidelined.ch/zug?variant=list&limit=5"
        title="EV Zug: who's out" width="100%" height="420" style="border:0"></iframe>

The iframe can't size itself to its content, so give it a height: about 80 px per player plus 120 px, or 140 px for the badge.

Content Security Policy #

If your site restricts where scripts and requests may go, allow embed.sidelined.ch:

script-src https://embed.sidelined.ch;
connect-src https://embed.sidelined.ch;
img-src https://sidelined.ch;
frame-src https://embed.sidelined.ch;   (only for the iframe)

Attribution #

Every widget shows the sources and "Data: sidelined.ch" with a link to the club's page. It's part of the widget and can't be switched off; hiding it breaks the terms of use.

Privacy #

The widget sets no cookies, loads nothing from third parties and doesn't track your readers. sidelined.ch counts how often widgets are shown per website (the site's host name only), to know where they're used.

How it works #

The script defines the <sidelined-widget> element. For each one, it loads the finished widget (HTML with its own styles) from embed.sidelined.ch/{team}.html into the element's Shadow DOM, so your page's CSS and the widget's can't interfere. The script is under 1 KB. Breaking changes get a new address (/v2.js); v1.js stays as it is.

Questions #

How fresh is it? The sources are read every 15 to 30 minutes; widgets are cached for a minute.

Can I style it? Choose light, dark or auto. For a fully custom design, use the API.

Is it free for commercial sites? Yes, with the attribution in place. See the terms.