jsulz HF Staff commited on
Commit
20d431a
·
1 Parent(s): b076276

about to refactor

Browse files
Files changed (3) hide show
  1. index.html +221 -5
  2. style.css +60 -0
  3. xet.png +0 -0
index.html CHANGED
@@ -29,7 +29,14 @@
29
  </div>
30
  </div>
31
  </div>
32
-
 
 
 
 
 
 
 
33
  <div class="charts-container">
34
  <div class="chart-card">
35
  <div class="card">
@@ -49,7 +56,6 @@
49
  </div>
50
  </div>
51
  </div>
52
-
53
 
54
  <script>
55
 
@@ -58,12 +64,15 @@
58
 
59
  const FILE_CSV_URL = 'https://huggingface.co/datasets/jsulz/ready-xet-go/resolve/main/file-progress.csv';
60
 
 
 
61
  (async () => {
62
  /*
63
  * Data fetching and parsing
64
  */
65
  const repo_rows = [];
66
- const file_rows = [];
 
67
 
68
  const repo_csv = await new Promise((resolve, reject) => {
69
  Papa.parse(REPO_CSV_URL, {
@@ -101,6 +110,23 @@
101
  }
102
  });
103
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
104
  /*
105
  * Progress Bar
106
  */
@@ -192,8 +218,8 @@
192
  //
193
 
194
  // Set up donut chart data
195
- lfs_file_count = file_rows[file_rows.length - 1].lfs_files;
196
- xet_file_count = file_rows[file_rows.length - 1].xet_files;
197
 
198
 
199
  // Initialize donut chart
@@ -226,7 +252,197 @@
226
  }
227
  }
228
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
229
  })();
 
 
230
  </script>
231
  </body>
232
  </html>
 
29
  </div>
30
  </div>
31
  </div>
32
+ <div class="container">
33
+ <div class="counter-wrapper">
34
+ <div class="counter-container" id="counter"></div>
35
+ <div class="counter-text" id="counterText" style="opacity: 0; transition: opacity 1s ease-in;">
36
+ in <img src="xet.png" alt="Xet" class="xet-logo">
37
+ </div>
38
+ </div>
39
+ </div>
40
  <div class="charts-container">
41
  <div class="chart-card">
42
  <div class="card">
 
56
  </div>
57
  </div>
58
  </div>
 
59
 
60
  <script>
61
 
 
64
 
65
  const FILE_CSV_URL = 'https://huggingface.co/datasets/jsulz/ready-xet-go/resolve/main/file-progress.csv';
66
 
67
+ const BYTES_CSV_URL = 'https://huggingface.co/datasets/jsulz/ready-xet-go/resolve/main/bytes-progress.csv';
68
+
69
  (async () => {
70
  /*
71
  * Data fetching and parsing
72
  */
73
  const repo_rows = [];
74
+ const file_rows = [];
75
+ const bytes_rows = [];
76
 
77
  const repo_csv = await new Promise((resolve, reject) => {
78
  Papa.parse(REPO_CSV_URL, {
 
110
  }
111
  });
112
 
113
+ const bytes_csv = await new Promise((resolve, reject) => {
114
+ Papa.parse(BYTES_CSV_URL, {
115
+ download: true,
116
+ header : true,
117
+ complete: resolve,
118
+ error : reject
119
+ });
120
+ });
121
+ bytes_csv.data.forEach(row => {
122
+ if (row.date && row.bytes) {
123
+ bytes_rows.push({
124
+ date: new Date(row.date),
125
+ bytes: parseInt(row.bytes, 10)
126
+ });
127
+ }
128
+ });
129
+
130
  /*
131
  * Progress Bar
132
  */
 
218
  //
219
 
220
  // Set up donut chart data
221
+ const lfs_file_count = file_rows[file_rows.length - 1].lfs_files;
222
+ const xet_file_count = file_rows[file_rows.length - 1].xet_files;
223
 
224
 
225
  // Initialize donut chart
 
252
  }
253
  }
254
  });
255
+
256
+
257
+
258
+
259
+ /*
260
+ * Counter
261
+ */
262
+
263
+ // 5x7 pixel patterns for each character (1=pixel on, 0=pixel off)
264
+ const patterns = {
265
+ '1': [
266
+ '00100',
267
+ '01100',
268
+ '00100',
269
+ '00100',
270
+ '00100',
271
+ '00100',
272
+ '01110'
273
+ ],
274
+ '2': [
275
+ '01110',
276
+ '10001',
277
+ '00001',
278
+ '00010',
279
+ '00100',
280
+ '01000',
281
+ '11111'
282
+ ],
283
+ '3': [
284
+ '01110',
285
+ '10001',
286
+ '00001',
287
+ '00110',
288
+ '00001',
289
+ '10001',
290
+ '01110'
291
+ ],
292
+ '4': [
293
+ '00010',
294
+ '00110',
295
+ '01010',
296
+ '10010',
297
+ '11111',
298
+ '00010',
299
+ '00010'
300
+ ],
301
+ '5': [
302
+ '11111',
303
+ '10000',
304
+ '10000',
305
+ '11110',
306
+ '00001',
307
+ '10001',
308
+ '01110'
309
+ ],
310
+ '6': [
311
+ '01110',
312
+ '10001',
313
+ '10000',
314
+ '11110',
315
+ '10001',
316
+ '10001',
317
+ '01110'
318
+ ],
319
+ '7': [
320
+ '11111',
321
+ '00001',
322
+ '00010',
323
+ '00100',
324
+ '01000',
325
+ '01000',
326
+ '01000'
327
+ ],
328
+ '8': [
329
+ '01110',
330
+ '10001',
331
+ '10001',
332
+ '01110',
333
+ '10001',
334
+ '10001',
335
+ '01110'
336
+ ],
337
+ '9': [
338
+ '01110',
339
+ '10001',
340
+ '10001',
341
+ '01111',
342
+ '00001',
343
+ '10001',
344
+ '01110'
345
+ ],
346
+ '0': [
347
+ '01110',
348
+ '10001',
349
+ '10001',
350
+ '10001',
351
+ '10001',
352
+ '10001',
353
+ '01110'
354
+ ],
355
+ '.': [
356
+ '00000',
357
+ '00000',
358
+ '00000',
359
+ '00000',
360
+ '00000',
361
+ '00100',
362
+ '01110'
363
+ ],
364
+ 'P': [
365
+ '11110',
366
+ '10001',
367
+ '10001',
368
+ '11110',
369
+ '10000',
370
+ '10000',
371
+ '10000'
372
+ ],
373
+ 'B': [
374
+ '11110',
375
+ '10001',
376
+ '10001',
377
+ '11110',
378
+ '10001',
379
+ '10001',
380
+ '11110'
381
+ ]
382
+ };
383
+
384
+ console.log(bytes_rows[bytes_rows.length - 1].bytes)
385
+ // Convert bytes to PB and format as string
386
+ const bytesInPB = 1024 ** 5;
387
+ // Calculate the number of PBs and round to 2 decimal places
388
+ const text = (bytes_rows[bytes_rows.length - 1].bytes / bytesInPB).toFixed(2) + 'PB';
389
+ console.log(text)
390
+ const container = document.getElementById('counter');
391
+ const pixelSize = 5; // Match CSS variable
392
+ const pixelGap = 1;
393
+ let allPixels = [];
394
+
395
+ // Create characters and their pixels
396
+ text.split('').forEach((char, charIndex) => {
397
+ const charDiv = document.createElement('div');
398
+ charDiv.className = 'character';
399
+
400
+ const pattern = patterns[char];
401
+ if (!pattern) return;
402
+
403
+ // Generate pixels based on pattern
404
+ pattern.forEach((row, rowIndex) => {
405
+ row.split('').forEach((cell, colIndex) => {
406
+ if (cell === '1') {
407
+ const pixel = document.createElement('div');
408
+ pixel.className = 'pixel';
409
+
410
+ // Calculate final position within character grid
411
+ const finalX = colIndex * (pixelSize + pixelGap);
412
+ const finalY = rowIndex * (pixelSize + pixelGap);
413
+
414
+ pixel.style.left = `${finalX}px`;
415
+ pixel.style.top = `${finalY}px`;
416
+
417
+ charDiv.appendChild(pixel);
418
+ allPixels.push(pixel);
419
+ }
420
+ });
421
+ });
422
+
423
+ container.appendChild(charDiv);
424
+ });
425
+
426
+ console.log(allPixels)
427
+
428
+ // Animate pixels falling into their final positions
429
+ allPixels.forEach((pixel, index) => {
430
+ // Stagger the landing times for a cascading effect
431
+ const delay = Math.random() * 50 + (index * 50);
432
+
433
+ setTimeout(() => {
434
+ pixel.classList.add('landed');
435
+ }, delay);
436
+ });
437
+ const maxDelay = Math.max(...allPixels.map((_, index) => Math.random() * 50 + (index * 50)));
438
+ setTimeout(() => {
439
+ const textDiv = document.getElementById('counterText');
440
+ textDiv.style.opacity = '1';
441
+ }, maxDelay + 500);
442
+
443
  })();
444
+
445
+
446
  </script>
447
  </body>
448
  </html>
style.css CHANGED
@@ -268,4 +268,64 @@ canvas {
268
  flex-direction: column;
269
  gap: 24px;
270
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
271
  }
 
268
  flex-direction: column;
269
  gap: 24px;
270
  }
271
+ }
272
+
273
+ :root {
274
+ --pixel-size: 5px;
275
+ --pixel-color: oklch(.585 .233 277.117);
276
+ --bg-color: #000;
277
+ }
278
+
279
+ .counter-container {
280
+ display: flex;
281
+ gap: calc(var(--pixel-size) * 3);
282
+ position: relative;
283
+ max-width: 350px;
284
+ max-height: 150px;
285
+ overflow: hidden;
286
+ margin: 0 auto;
287
+ justify-content: center;
288
+ }
289
+
290
+ .character {
291
+ width: calc(var(--pixel-size) * 5 + 4px);
292
+ height: calc(var(--pixel-size) * 7 + 6px);
293
+ position: relative;
294
+ }
295
+
296
+ .pixel {
297
+ width: var(--pixel-size);
298
+ height: var(--pixel-size);
299
+ background: var(--pixel-color);
300
+ position: absolute;
301
+ transition: transform 1.2s cubic-bezier(0.4, 0, 0.2, 1);
302
+ transform: translateY(-200px);
303
+ opacity: 1;
304
+ box-shadow: 0 0 2px var(--pixel-color);
305
+ }
306
+
307
+ .pixel.landed {
308
+ transform: translateY(0);
309
+ }
310
+
311
+ .counter-wrapper {
312
+ display: flex;
313
+ flex-direction: column;
314
+ align-items: center;
315
+ gap: 1rem; /* Adjust spacing as needed */
316
+ }
317
+
318
+ .counter-text {
319
+ display: flex;
320
+ align-items: center; /* or center */
321
+ gap: 0.5rem;
322
+ justify-content: center;
323
+ line-height: 2em;
324
+ }
325
+
326
+ .xet-logo {
327
+ height: 2.5em; /* Match text size exactly */
328
+ width: auto;
329
+ display: inline-block;
330
+ vertical-align: baseline;
331
  }
xet.png ADDED