Panel terminé + Refresh token auto

This commit is contained in:
Zachary Guénot
2023-05-11 00:37:16 +02:00
parent de01c981f8
commit 8846299424
18 changed files with 251 additions and 64 deletions

9
public/panel/arrow.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 39 KiB

BIN
public/panel/background.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

View File

@@ -1,16 +1,113 @@
p {
color: white;
text-align: center;
@import url('https://fonts.googleapis.com/css2?family=Annie+Use+Your+Telescope&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Advent+Pro&display=swap');
body {
/* background-color: #B9F1FD; */
background: url(https://angels-dev.fr/twitch/panel/background.png);
background-repeat: no-repeat;
/* border: 2px solid black; */
font-family: 'Advent Pro', sans-serif;
font-weight: 400;
color: black;
}
.div__title {
width: 205px;
height: 34px;
border-radius: 15px;
border-bottom: 1px solid #205E8B;
background-color: #5FB5F4;
justify-content: center;
margin: auto;
margin-bottom: 15px;
}
.title {
color: black;
text-align: center;
font-family: 'Annie Use Your Telescope', cursive;
font-size: 24px;
font-weight: 600;
}
.table {
margin: auto;
border-collapse : separate;
border-spacing: 4px;
}
.table__body {
overflow-y: scroll;
scrollbar-width: thin; /* "auto" or "thin" */
scrollbar-color: #24AEEA #7A7979; /* scroll thumb and track */
}
.table__rank {
background-color: #5FB6F4;
width: 30px;
height: 20px;
border-radius: 5px;
font-size: 12px;
font-weight: 600;
}
.table__pseudos {
background-color: #5FB6F4;
width: 200px;
height: 20px;
border-radius: 5px;
text-align: left;
padding-left: 5px;
font-size: 12px;
font-weight: 600;
}
.table__arrows {
background-color: #5FB6F4;
width: 54px;
height: 20px;
border-radius: 5px;
font-size: 12px;
font-weight: 600;
}
.row__rank {
background-color: #99CFEE;
width: 30px;
height: 20px;
border-radius: 5px;
font-size: 12px;
font-weight: 800;
}
.row__pseudos {
background-color: #99CFEE;
width: 200px;
height: 20px;
border-radius: 5px;
text-align: left;
padding-left: 5px;
font-size: 16px;
font-weight: 400;
}
.row__arrows {
background-color: #99CFEE;
width: 54px;
height: 20px;
border-radius: 5px;
font-size: 14px;
font-weight: 400;
}
.row__arrows::after {
content: url(https://angels-dev.fr/twitch/panel/arrow.svg);
margin-left: 7.5px;
}
th {
color: white;
text-align: center;
}
td {
color: white;
text-align: center;
}
table .center {
margin-left: auto;
margin-right: auto;
}

View File

@@ -1,16 +1,25 @@
<!DOCTYPE HTML>
<script src="https://extension-files.twitch.tv/helper/v1/twitch-ext.min.js"></script>
<script src="https://angels-dev.fr/twitch/panel/script.js"></script>
<link rel="stylesheet" href="https://angels-dev.fr/twitch/panel/panel.css">
<html lang="en">
<head>
<script src="https://extension-files.twitch.tv/helper/v1/twitch-ext.min.js"></script>
<script src="https://angels-dev.fr/twitch/panel/script.js"></script>
<link rel="stylesheet" href="https://angels-dev.fr/twitch/panel/panel.css">
<link rel="image/svg" href="https://angels-dev.fr/twitch/panel/arrow.svg">
<title>Panel Laytho</title>
<p>Classement des Daily Arrows</p>
<table id="table" class="center">
<thead>
<tr>
<th scope="col">Pseudo</th>
<th scope="col">Daily Arrows</th>
</tr>
</thead>
<tbody></tbody>
</table>
<title>Laytho Panel</title>
</head>
<body>
<div class="div__title">
<h2 class="title">Stand de tir à l'arc</h2>
</div>
<table id="table" class="table">
<thead>
<tr class="table__names">
<th scope="col" class="table__rank">Rank</th>
<th scope="col" class="table__pseudos">Pseudo</th>
<th scope="col" class="table__arrows">Carquois</th>
</tr>
</thead>
<tbody class="table__body"></tbody>
</table>
</html>

View File

@@ -8,10 +8,20 @@ xhr.onload = () => {
let tbodyRef = document.getElementById('table').getElementsByTagName('tbody')[0]
for (let entry of data.scoreboard) {
for (entry of data.scoreboard) {
let row = tbodyRef.insertRow()
row.insertCell().appendChild(document.createTextNode(data.scoreboard.indexOf(entry) + 1))
row.insertCell().appendChild(document.createTextNode(entry.user_name))
row.insertCell().appendChild(document.createTextNode(entry.count))
let i = 0
for (cell of row.cells) {
i++
if (i === 1) cell.className = "row__rank"
if (i === 2) cell.className = "row__pseudos"
if (i === 3) cell.className = "row__arrows"
}
}
} else console.error('Error:', xhr.statusText)
}