git.shiar.nl
/
sc2-widget
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
list last three match results
[sc2-widget]
/
widget.html
diff --git
a/widget.html
b/widget.html
index 1184ab1c506ecd96774219d5f6e749cd4c1a1162..c2a351dc14951302d6881a810a87acb4f191dde8 100644
(file)
--- a/
widget.html
+++ b/
widget.html
@@
-25,6
+25,8
@@
})
.then(clan => {
let tiernum = (rank) => rank <= 8 ? 1 : rank <= 25 ? 2 : rank <= 50 ? 3 : 4;
})
.then(clan => {
let tiernum = (rank) => rank <= 8 ? 1 : rank <= 25 ? 2 : rank <= 50 ? 3 : 4;
+ let matchtime = (d) => d.getDate() + '/' + (d.getMonth() + 1) +
+ ' ' + d.getHours() + ":" + ('0' + d.getMinutes()).slice(-2);
outcont.outerHTML = `
<h1>${clan.tag || clan.members[0].name}</h1>
<ul class=ladders>
outcont.outerHTML = `
<h1>${clan.tag || clan.members[0].name}</h1>
<ul class=ladders>
@@
-48,6
+50,13
@@
</figure></a></li>
`).join('')}
</ul>
</figure></a></li>
`).join('')}
</ul>
+ <ul class=matches>
+ ${clan.matches.splice(0, 3).map(match => `
+ <li data-members="${match.players}" class=${match.decision.toLowerCase()}>
+ ${matchtime(new Date(match.date * 1000))} ${match.type}
+ </li>
+ `).join('')}
+ </ul>
`
document.querySelectorAll('[data-members]').forEach(li => {
`
document.querySelectorAll('[data-members]').forEach(li => {