-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstats.html
More file actions
246 lines (218 loc) · 6.62 KB
/
stats.html
File metadata and controls
246 lines (218 loc) · 6.62 KB
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Linkagram — Stats Dashboard</title>
<meta name="description" content="Aggregated completion stats for the Linkagram daily word puzzle.">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;600;700&display=swap" rel="stylesheet">
<style>
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
--bg-gradient: linear-gradient(135deg, #0a0a1a, #1a0a2e, #0d1b2a, #0a0a1a);
--glass-bg: rgba(255, 255, 255, 0.05);
--glass-bg-hover: rgba(255, 255, 255, 0.08);
--glass-border: rgba(255, 255, 255, 0.15);
--text-primary: rgba(255, 255, 255, 0.9);
--text-secondary: rgba(255, 255, 255, 0.6);
--text-dim: rgba(255, 255, 255, 0.4);
--glow-cyan: #00e5ff;
--glow-cyan-rgb: 0, 229, 255;
--glow-green: #4ade80;
--glow-green-rgb: 74, 222, 128;
--glow-yellow: #f0d56e;
--glow-yellow-rgb: 240, 213, 110;
--font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
--font-system: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}
body {
font-family: var(--font-system);
background: var(--bg-gradient);
background-attachment: fixed;
color: var(--text-primary);
min-height: 100vh;
-webkit-font-smoothing: antialiased;
}
.container {
max-width: 800px;
margin: 0 auto;
padding: 2rem 1rem 4rem;
}
header {
text-align: center;
margin-bottom: 2rem;
}
header h1 {
font-family: var(--font-display);
font-size: 1.75rem;
font-weight: 700;
margin-bottom: 0.25rem;
}
header h1 a {
color: var(--text-primary);
text-decoration: none;
}
header h1 a:hover {
color: var(--glow-cyan);
}
header p {
color: var(--text-secondary);
font-size: 0.875rem;
}
.section-title {
font-family: var(--font-display);
font-size: 1rem;
font-weight: 600;
color: var(--text-secondary);
text-transform: uppercase;
letter-spacing: 0.08em;
margin-bottom: 0.75rem;
}
.cards {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
gap: 0.75rem;
margin-bottom: 2rem;
}
.card {
background: var(--glass-bg);
border: 1px solid var(--glass-border);
border-radius: 12px;
padding: 1rem;
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
transition: background 0.2s;
}
.card:hover {
background: var(--glass-bg-hover);
}
.card .label {
font-size: 0.75rem;
color: var(--text-dim);
text-transform: uppercase;
letter-spacing: 0.06em;
margin-bottom: 0.25rem;
}
.card .value {
font-family: var(--font-display);
font-size: 1.5rem;
font-weight: 700;
}
.card .value.cyan { color: var(--glow-cyan); }
.card .value.green { color: var(--glow-green); }
.card .value.yellow { color: var(--glow-yellow); }
.chart-container {
background: var(--glass-bg);
border: 1px solid var(--glass-border);
border-radius: 12px;
padding: 1rem;
margin-bottom: 2rem;
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
}
.chart-container h3 {
font-family: var(--font-display);
font-size: 0.875rem;
font-weight: 600;
color: var(--text-secondary);
margin-bottom: 0.75rem;
}
.chart-container canvas {
width: 100% !important;
max-height: 280px;
}
#loading {
text-align: center;
padding: 4rem 1rem;
color: var(--text-secondary);
}
#error {
text-align: center;
padding: 2rem 1rem;
color: var(--glow-yellow);
display: none;
}
#dashboard {
display: none;
}
.back-link {
display: inline-block;
color: var(--text-dim);
text-decoration: none;
font-size: 0.875rem;
margin-bottom: 1rem;
}
.back-link:hover {
color: var(--glow-cyan);
}
</style>
</head>
<body>
<div class="container">
<a href="/" class="back-link">← Back to game</a>
<header>
<h1><a href="/">Linkagram</a></h1>
<p>Completion Stats</p>
</header>
<div id="loading">Loading stats…</div>
<div id="error">Unable to load stats. Try refreshing.</div>
<div id="dashboard">
<h2 class="section-title">Today's Puzzle</h2>
<div class="cards">
<div class="card">
<div class="label">Completions</div>
<div class="value cyan" id="today-completions">—</div>
</div>
<div class="card">
<div class="label">Median Time</div>
<div class="value green" id="today-median">—</div>
</div>
<div class="card">
<div class="label">90th Percentile</div>
<div class="value green" id="today-p90">—</div>
</div>
<div class="card">
<div class="label">Avg Hints Used</div>
<div class="value yellow" id="today-hints">—</div>
</div>
</div>
<h2 class="section-title">All Time</h2>
<div class="cards">
<div class="card">
<div class="label">Total Completions</div>
<div class="value cyan" id="all-completions">—</div>
</div>
<div class="card">
<div class="label">Median Time</div>
<div class="value green" id="all-median">—</div>
</div>
<div class="card">
<div class="label">90th Percentile</div>
<div class="value green" id="all-p90">—</div>
</div>
<div class="card">
<div class="label">Best Streak Reported</div>
<div class="value yellow" id="all-streak">—</div>
</div>
</div>
<h2 class="section-title">Last 30 Days</h2>
<div class="chart-container">
<h3>Daily Completions</h3>
<canvas id="chart-completions"></canvas>
</div>
<div class="chart-container">
<h3>Median Completion Time</h3>
<canvas id="chart-time"></canvas>
</div>
</div>
</div>
<script>
if (new URLSearchParams(window.location.search).get('native') === '1') {
document.querySelector('.back-link').style.display = 'none';
}
</script>
<script type="module" src="/src/stats.ts"></script>
</body>
</html>