-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
executable file
·156 lines (132 loc) · 5.83 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
<?php
include_once(__DIR__.'/model/Game.class.php');
?>
<!DOCTYPE HTML>
<html lang="en">
<head>
<title>CG Ranking</title>
<meta name="description" content="CG-Ranking is a tool that shows the evolution of ranking during CodinGame contests."/>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="stylesheet" type="text/css" href="styles.css?v=1">
</head>
<body>
<nav>
<div class="nav-wrapper deep-purple">
<a href="#" class="brand-logo center">CG Ranking</a>
<ul id="nav-mobile" class="hide-on-med-and-down right">
<li>
<a href="#" id="arrow-back" onclick="update()">
<i class="material-icons">refresh</i>
</a>
</li>
<li>
<a class="modal-trigger" href="#about">About</a>
</li>
</ul>
</div>
</nav>
<div class="container">
<div style="margin-top: 22px;">
<form class="row">
<div class="input-field col s12 l3">
<select id="game" onchange="update();">
<?php
foreach (getCurrentContests() as $game) {
echo '<option value="' . $game->getId() . '">' . $game->getName() . '</option>';
}
$game = getGlobal();
echo '<option value="' . $game->getId() . '">' . $game->getName() . '</option>';
$game = getClashOfCode();
echo '<option value="' . $game->getId() . '">' . $game->getName() . '</option>';
?>
<optgroup label="Multiplayer puzzles">
<?php
foreach (getMultis() as $game) {
echo '<option value="' . $game->getId() . '">' . $game->getName() . '</option>';
}
?>
</optgroup>
<optgroup label="Contests">
<?php
foreach (getContests() as $game) {
echo '<option value="' . $game->getId() . '">' . $game->getName() . '</option>';
}
?>
</optgroup>
</select>
<label>Game:</label>
</div>
<div class="input-field col s8 m10 l8">
<input id="pseudo" type="text" onkeydown="if (event.keyCode == 13) {addPlayer(this.value); return false;}">
<label for="pseudo">Player's pseudo</label>
</div>
<div class="input-field col s4 m2 l1">
<a class="waves-effect waves-light btn deep-purple accent-4 right"
onclick="addPlayer(document.getElementById('pseudo').value)">Search</a>
</div>
</form>
</div>
<canvas id="chart"></canvas>
</div>
<div class="fixed-action-btn">
<a class="btn-floating btn-large waves-effect modal-trigger deep-purple accent-4" href="#filters">
<i class="large material-icons">mode_edit</i>
</a>
</div>
<!-- Filters -->
<div class="modal" id="filters">
<div class="modal-content">
<h2>Filters</h2>
<form>
<!--<div class="input-field">
<select>
<option value="" selected>Everything</option>
<option value="">Last 3 hours</option>
<option value="">Last 6 hours</option>
<option value="">Last 12 hours</option>
<option value="">Last 24 hours</option>
<option value="">Last 3 days</option>
<option value="">Last 5 days</option>
</select>
<label>Show only:</label>
</div>-->
<p>
<label>
<input type="checkbox" id="hideInProgress"/>
<span>Hide submissions in progress</span>
</label>
</p>
<p>
<label>
<input type="checkbox" id="showAgentID"/>
<span>Show agents IDs</span>
</label>
</p>
</form>
</div>
<div class="modal-footer">
<a href="#" class="modal-action modal-close waves-effect waves-green btn-flat" onclick="update();">OK</a>
</div>
</div>
<!-- About -->
<div class="modal" id="about">
<div class="modal-content">
<h2>About CG-Ranking</h2>
<p>
CG-Ranking is an online tool displaying the evolution of players' ranking on CodinGame.<br/>
It is open-source (MIT license):
<a href="https://github.com/AdrienVannson/CG-Ranking">https://github.com/AdrienVannson/CG-Ranking</a>
</p>
<p>Developed by Adrien Vannson</p>
</div>
<div class="modal-footer">
<a href="#" class="modal-action modal-close waves-effect waves-red btn-flat">Close</a>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.2/Chart.bundle.min.js"></script>
<script src="script.js?v=4"></script>
</body>
</html>