ntdservices commited on
Commit
64ae3af
·
verified ·
1 Parent(s): a632ac6

Update static/embed.js

Browse files
Files changed (1) hide show
  1. static/embed.js +18 -15
static/embed.js CHANGED
@@ -1,21 +1,21 @@
1
  (() => {
2
- const API = "https://ntdservices-debt-clock.hf.space/api/debt";
3
  const CLS = "ntd-debt-clock";
4
 
5
  function mount(el) {
6
- Object.assign(el.style, {
7
- font: "900 6rem monospace", // increased size
8
- color: "#fff", // white text
9
- background: "transparent",
10
- padding: "0",
11
- borderRadius: "0",
12
- boxShadow: "none",
13
- whiteSpace: "nowrap",
14
- position: "absolute",
15
- top: "42%", // Y-position inside the sign
16
- left: "41%", // X-position inside the sign
17
- transform: "translate(-50%, -50%)",
18
- });
19
 
20
  fetch(API)
21
  .then((r) => r.json())
@@ -28,7 +28,10 @@ Object.assign(el.style, {
28
  const dt = (now - last) / 1000;
29
  last = now;
30
  debt += rate * dt;
31
- el.textContent = "$" + Math.round(debt).toLocaleString();
 
 
 
32
  requestAnimationFrame(tick);
33
  }
34
 
 
1
  (() => {
2
+ const API = "/api/debt";
3
  const CLS = "ntd-debt-clock";
4
 
5
  function mount(el) {
6
+ Object.assign(el.style, {
7
+ font: "bold 2.5rem monospace",
8
+ color: "#0f0",
9
+ background: "#000a",
10
+ padding: "12px 20px",
11
+ borderRadius: "8px",
12
+ boxShadow: "0 0 10px #0f0",
13
+ whiteSpace: "nowrap",
14
+ position: "absolute",
15
+ top: "10%",
16
+ left: "50%",
17
+ transform: "translateX(-50%)",
18
+ });
19
 
20
  fetch(API)
21
  .then((r) => r.json())
 
28
  const dt = (now - last) / 1000;
29
  last = now;
30
  debt += rate * dt;
31
+ el.textContent = "$" + debt.toLocaleString(undefined, {
32
+ minimumFractionDigits: 2,
33
+ maximumFractionDigits: 2,
34
+ });
35
  requestAnimationFrame(tick);
36
  }
37