You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

71 lines
3.4 KiB

<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8">
<link href="styles.css" rel="stylesheet">
<title>UEM Elo Tracker</title>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
</head>
<body>
<?php
require_once "Tracker.php";
$tracker = new Tracker();
$latest_patch = json_decode(file_get_contents("https://ddragon.leagueoflegends.com/api/versions.json"))[0];
echo "<h1>UEM LoL Elo-Challenge</h1>";
echo "<div class='uem-logo-header'><img class='uem-logo' src='./../img/uem-logo.png' alt=''></div>";
echo "<div class='leaderboard'>";
echo "<canvas id=\"progress-chart-combined\" style=\"width:100%;max-width:700px\"></canvas>";
echo "<div class='leaderboard-list'>";
$placement_counter = 1;
foreach ($tracker->getProgressions() as $puuid => $progress){
echo "<div class='leaderboard-element place-$placement_counter'>";
$entries = $tracker->entries[$puuid];
$account = $tracker->accounts[$puuid];
$start_elo = reset($entries);
if ($start_elo->tier == "MASTER" || $start_elo->tier == "GRANDMASTER" || $start_elo->tier == "CHALLENGER") $start_elo->rank = "";
$current_elo = end($entries);
if ($current_elo->tier == "MASTER" || $current_elo->tier == "GRANDMASTER" || $current_elo->tier == "CHALLENGER") $current_elo->rank = "";
$progress = ($progress>=0) ? "+$progress" : $progress;
$tier_lowercase = strtolower($current_elo->tier);
$start_tier_lowercase = strtolower($start_elo->tier);
$tier_ucfirst = ucfirst($tier_lowercase);
$start_tier_ucfirst = ucfirst($start_tier_lowercase);
$gained_lp_sign = ($progress > 0) ? " plus-lp" : (($progress < 0) ? " minus-lp" : "no-lp");
echo "<span class='placement'>$placement_counter.</span>";
echo "<div class='player-info'>
<img src='https://ddragon.leagueoflegends.com/cdn/$latest_patch/img/profileicon/$account->profileIconId.png' alt='' style='height: 64px; aspect-ratio: 1 / 1;'>
<h2 class='playername'>$account->gameName<span class='riot-tag'>#$account->tagLine</span></h2>
<h3 class='lp-gained $gained_lp_sign'>$progress LP</h3>
</div>";
echo "<div class='ranked-emblem'><img class='current-rank' src='https://raw.communitydragon.org/latest/plugins/rcp-fe-lol-shared-components/global/default/$tier_lowercase.png' alt=''></div>";
echo "<div class='elo-gained'>
<div class='rank rank-start'>
<img class='ranked-mini-crest' src='https://raw.communitydragon.org/latest/plugins/rcp-fe-lol-static-assets/global/default/ranked-mini-crests/$start_tier_lowercase.svg' alt=''>
<span class='rank-desc'><span class='rank-tier'>{$start_tier_ucfirst} {$start_elo->rank}</span> <br> <span class='rank-LP'>{$start_elo->points} LP</span></span>
</div>
&rarr;
<div class='rank rank-start'>
<img class='ranked-mini-crest' src='https://raw.communitydragon.org/latest/plugins/rcp-fe-lol-static-assets/global/default/ranked-mini-crests/$tier_lowercase.svg' alt=''>
<span class='rank-desc'><span class='rank-tier'>{$tier_ucfirst} {$current_elo->rank}</span> <br> <span class='rank-LP'>{$current_elo->points} LP</span></span>
</div>
</div>";
echo "</div>";
echo "<canvas id=\"progress-chart-$puuid\" class='progress-chart' style=\"width:100%;max-width:700px\"></canvas>";
$placement_counter++;
}
echo "</div>";
echo "</div>";
?>
<script src="chart-integration.js"></script>
</body>
</html>