-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathwidget-demo.html
More file actions
375 lines (338 loc) · 9.78 KB
/
Copy pathwidget-demo.html
File metadata and controls
375 lines (338 loc) · 9.78 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
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Git History Widget Demo</title>
<style>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
background: #0d1117;
color: #f0f6fc;
padding: 2rem;
line-height: 1.6;
}
.container {
max-width: 1200px;
margin: 0 auto;
}
h1 {
font-size: 2rem;
margin-bottom: 0.5rem;
color: #58a6ff;
}
.subtitle {
color: #8b949e;
margin-bottom: 2rem;
font-size: 1.1rem;
}
.demo-section {
background: #161b22;
border: 1px solid #30363d;
border-radius: 8px;
padding: 1.5rem;
margin-bottom: 2rem;
}
.demo-section h2 {
font-size: 1.3rem;
margin-bottom: 1rem;
color: #f0f6fc;
}
.demo-section p {
color: #8b949e;
margin-bottom: 1rem;
}
.widget-wrapper {
background: #0d1117;
border-radius: 8px;
padding: 1rem;
margin: 1rem 0;
}
iframe {
border: none;
border-radius: 8px;
width: 100%;
display: block;
}
.code-block {
background: #0d1117;
border: 1px solid #30363d;
border-radius: 6px;
padding: 1rem;
margin: 1rem 0;
overflow-x: auto;
}
.code-block code {
font-family: 'SF Mono', Monaco, Menlo, Consolas, monospace;
font-size: 0.85rem;
color: #79c0ff;
white-space: pre;
}
.params-table {
width: 100%;
border-collapse: collapse;
margin: 1rem 0;
}
.params-table th,
.params-table td {
padding: 0.75rem;
text-align: left;
border-bottom: 1px solid #30363d;
}
.params-table th {
color: #f0f6fc;
font-weight: 600;
background: #0d1117;
}
.params-table td {
color: #8b949e;
}
.params-table code {
font-family: 'SF Mono', Monaco, Menlo, Consolas, monospace;
font-size: 0.85rem;
color: #79c0ff;
background: #0d1117;
padding: 0.2rem 0.4rem;
border-radius: 3px;
}
.grid-layout {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 1.5rem;
margin: 1.5rem 0;
}
.grid-item {
background: #0d1117;
border: 1px solid #30363d;
border-radius: 6px;
padding: 1rem;
}
.grid-item h3 {
font-size: 1rem;
margin-bottom: 0.75rem;
color: #f0f6fc;
}
@media (max-width: 768px) {
body {
padding: 1rem;
}
h1 {
font-size: 1.5rem;
}
.demo-section {
padding: 1rem;
}
.grid-layout {
grid-template-columns: 1fr;
}
}
</style>
</head>
<body>
<div class="container">
<h1>🎬 Git History Animation Widget</h1>
<p class="subtitle">A high-velocity animated visualization of 16 years of GitHub commits</p>
<!-- Main Demo -->
<div class="demo-section">
<h2>Default Configuration (30 seconds)</h2>
<p>This widget animates through the entire commit history in 30 seconds, showing a rolling 365-day window.</p>
<div class="widget-wrapper">
<iframe
src="../dist/widget.html?duration=30&theme=dark&autoplay=true"
height="300"
id="widget1">
</iframe>
</div>
<div class="code-block">
<code><iframe
src="../dist/widget.html?duration=30&theme=dark&autoplay=true"
width="100%"
height="300"
frameborder="0"
style="border: none; border-radius: 8px;">
</iframe></code>
</div>
</div>
<!-- Fast Demo -->
<div class="demo-section">
<h2>Fast Animation (10 seconds)</h2>
<p>Speed through the history in just 10 seconds for a quick overview.</p>
<div class="widget-wrapper">
<iframe
src="../dist/widget.html?duration=10&theme=dark&autoplay=true"
height="300"
id="widget2">
</iframe>
</div>
<div class="code-block">
<code><iframe
src="../dist/widget.html?duration=10&theme=dark&autoplay=true"
width="100%"
height="300">
</iframe></code>
</div>
</div>
<!-- Light Theme Demo -->
<div class="demo-section">
<h2>Light Theme (60 seconds)</h2>
<p>A slower, more detailed view with light theme for better visibility in bright environments.</p>
<div class="widget-wrapper">
<iframe
src="../dist/widget.html?duration=60&theme=light&autoplay=true"
height="300"
id="widget3">
</iframe>
</div>
<div class="code-block">
<code><iframe
src="../dist/widget.html?duration=60&theme=light&autoplay=true"
width="100%"
height="300">
</iframe></code>
</div>
</div>
<!-- Configuration Reference -->
<div class="demo-section">
<h2>URL Parameters</h2>
<p>Customize the widget behavior using URL parameters:</p>
<table class="params-table">
<thead>
<tr>
<th>Parameter</th>
<th>Description</th>
<th>Default</th>
<th>Example</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>duration</code></td>
<td>Animation duration in seconds</td>
<td><code>30</code></td>
<td><code>?duration=60</code></td>
</tr>
<tr>
<td><code>theme</code></td>
<td>Color theme</td>
<td><code>dark</code></td>
<td><code>?theme=light</code></td>
</tr>
<tr>
<td><code>autoplay</code></td>
<td>Start animation automatically</td>
<td><code>true</code></td>
<td><code>?autoplay=false</code></td>
</tr>
<tr>
<td><code>speed</code></td>
<td>Playback speed multiplier (0.1-10)</td>
<td><code>1.0</code></td>
<td><code>?speed=2.0</code></td>
</tr>
</tbody>
</table>
</div>
<!-- Responsive Demo -->
<div class="demo-section">
<h2>Responsive Design</h2>
<p>The widget adapts to different container sizes. Here are examples at various widths:</p>
<div class="grid-layout">
<div class="grid-item">
<h3>Small (Mobile)</h3>
<iframe
src="../dist/widget.html?duration=20&theme=dark&autoplay=true"
height="200"
style="max-width: 320px;">
</iframe>
</div>
<div class="grid-item">
<h3>Medium (Tablet)</h3>
<iframe
src="../dist/widget.html?duration=20&theme=dark&autoplay=true"
height="250"
style="max-width: 500px;">
</iframe>
</div>
</div>
</div>
<!-- Features -->
<div class="demo-section">
<h2>Features</h2>
<ul style="color: #8b949e; margin-left: 1.5rem; line-height: 1.8;">
<li>🚀 High-velocity animation through 16 years of commit history</li>
<li>📊 Rolling 365-day contribution matrix (52 weeks × 7 days)</li>
<li>🎨 GitHub-style contribution colors with dark/light themes</li>
<li>📱 Fully responsive design (320px to desktop)</li>
<li>⚡ 60fps smooth animation using requestAnimationFrame</li>
<li>📦 Self-contained HTML file (no external dependencies)</li>
<li>🔧 Configurable duration, theme, and autoplay</li>
<li>📅 Year indicator showing current date range</li>
<li>🔄 Loops continuously for endless viewing</li>
<li>💾 Only 257KB including all data</li>
</ul>
</div>
<!-- Technical Details -->
<div class="demo-section">
<h2>Technical Details</h2>
<div class="grid-layout">
<div class="grid-item">
<h3>Data</h3>
<p style="color: #8b949e;">
• 5,844 days of commit history<br>
• 38,376 total commits<br>
• 2,364 days with commits<br>
• Date range: 2011-2026
</p>
</div>
<div class="grid-item">
<h3>Performance</h3>
<p style="color: #8b949e;">
• 60 FPS animation<br>
• Efficient DOM updates<br>
• CSS custom properties<br>
• requestAnimationFrame API
</p>
</div>
<div class="grid-item">
<h3>Compatibility</h3>
<p style="color: #8b949e;">
• Modern browsers (ES6+)<br>
• Mobile & desktop optimized<br>
• iframe-ready<br>
• CSP-friendly
</p>
</div>
</div>
</div>
<!-- Usage Instructions -->
<div class="demo-section">
<h2>How to Use</h2>
<ol style="color: #8b949e; margin-left: 1.5rem; line-height: 1.8;">
<li>Copy the <code style="color: #79c0ff;">widget.html</code> file to your web server</li>
<li>Embed it using an iframe with your desired parameters</li>
<li>Customize the appearance using URL parameters</li>
<li>The widget will automatically resize to fit its container</li>
</ol>
</div>
</div>
<script>
// Auto-resize iframes based on messages from widgets
window.addEventListener('message', (event) => {
if (event.data.type === 'git-history-widget-resize') {
// Find all iframes and update their height
const iframes = document.querySelectorAll('iframe');
iframes.forEach(iframe => {
if (iframe.contentWindow === event.source) {
iframe.style.height = event.data.height + 'px';
}
});
}
});
</script>
</body>
</html>