ntdservices commited on
Commit
05fdb1b
·
verified ·
1 Parent(s): 04b0b69

Update static/embed.js

Browse files
Files changed (1) hide show
  1. static/embed.js +2 -43
static/embed.js CHANGED
@@ -37,49 +37,8 @@
37
 
38
  requestAnimationFrame(tick);
39
  })
40
- .catch(() => {
41
- el.textContent = "N/A";
42
- });
43
- }
44
-
45
- document.querySelectorAll("." + CLS).forEach(mount);
46
- })();
47
- function mount(el) {
48
- Object.assign(el.style, {
49
- font: "bold 2.5rem monospace",
50
- color: "#0f0",
51
- background: "#000a",
52
- padding: "12px 20px",
53
- borderRadius: "8px",
54
- boxShadow: "0 0 10px #0f0",
55
- whiteSpace: "nowrap",
56
- position: "absolute",
57
- top: "10%",
58
- left: "50%",
59
- transform: "translateX(-50%)",
60
- });
61
-
62
- fetch(API)
63
- .then((r) => r.json())
64
- .then((d) => {
65
- let debt = d.startingDebt;
66
- const rate = d.ratePerSecond;
67
- let last = performance.now();
68
-
69
- function tick(now) {
70
- const dt = (now - last) / 1000;
71
- last = now;
72
- debt += rate * dt;
73
- el.textContent = "$" + debt.toLocaleString(undefined, {
74
- minimumFractionDigits: 2,
75
- maximumFractionDigits: 2,
76
- });
77
- requestAnimationFrame(tick);
78
- }
79
-
80
- requestAnimationFrame(tick);
81
- })
82
- .catch(() => {
83
  el.textContent = "N/A";
84
  });
85
  }
 
37
 
38
  requestAnimationFrame(tick);
39
  })
40
+ .catch((err) => {
41
+ console.error("Failed to fetch debt:", err);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  el.textContent = "N/A";
43
  });
44
  }