git.shiar.nl
/
sc2-widget
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
improve members styling on small screens
[sc2-widget]
/
widget.html
diff --git
a/widget.html
b/widget.html
index a9d615fa5f7cbaa418673229cda27ccdc8df3210..ddcff037e93f8d90228421ba5dadc00a05e5640e 100644
(file)
--- a/
widget.html
+++ b/
widget.html
@@
-12,14
+12,17
@@
<body>
<p id="clan">No clan data</p>
<script>
<body>
<p id="clan">No clan data</p>
<script>
- fetch('/schtarr/inno.json')
+ let request = window.location.pathname.split('/')
+ request.splice(2, 1) // strip page name
+ fetch(request.join('/') + '.json')
.then(res => res.json())
.then(clan => {
document.getElementById('clan').outerHTML = `
<h1>${clan.tag}</h1>
<ul class=ladders>
${clan.ladders.map(ladder => `
.then(res => res.json())
.then(clan => {
document.getElementById('clan').outerHTML = `
<h1>${clan.tag}</h1>
<ul class=ladders>
${clan.ladders.map(ladder => `
- <li title="Division ${ladder.division}" class="rank ${ladder.league}">
+ <li class="rank ${ladder.league}"
+ title="Division ${ladder.division} (${ladder.wins}:${ladder.losses})">
${ladder.league} <small>#${ladder.rank}</small>
</li>
`).join('')}
${ladder.league} <small>#${ladder.rank}</small>
</li>
`).join('')}