ntdservices commited on
Commit
85405d8
·
verified ·
1 Parent(s): c46d31f

Update templates/index.html

Browse files
Files changed (1) hide show
  1. templates/index.html +15 -68
templates/index.html CHANGED
@@ -1,70 +1,17 @@
1
- <!DOCTYPE html>
2
  <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
- <title>US Debt Clock</title>
6
- <style>
7
- body {
8
- background: #111;
9
- color: #0f0;
10
- font-family: monospace;
11
- display: flex;
12
- flex-direction: column;
13
- justify-content: center;
14
- align-items: center;
15
- height: 100vh;
16
- margin: 0;
17
- }
18
- h1 {
19
- font-size: 2rem;
20
- color: #aaa;
21
- margin-bottom: 10px;
22
- }
23
- #debt {
24
- font-size: 3rem;
25
- white-space: nowrap;
26
- }
27
- </style>
28
- </head>
29
- <body>
30
- <h1>U.S. National Debt (Real-Time Estimate)</h1>
31
- <div id="debt">Loading...</div>
32
-
33
- <script>
34
- let startingDebt = 0;
35
- let ratePerSecond = 0;
36
- let startTime = Date.now();
37
- let currentDisplayDebt = 0;
38
-
39
- function animateDebt() {
40
- const now = Date.now();
41
- const elapsed = (now - startTime) / 1000;
42
- const targetDebt = startingDebt + (ratePerSecond * elapsed);
43
-
44
- // Easing toward target
45
- currentDisplayDebt += (targetDebt - currentDisplayDebt) * 0.05;
46
-
47
- document.getElementById('debt').textContent = '$' + currentDisplayDebt.toLocaleString(undefined, {
48
- minimumFractionDigits: 2,
49
- maximumFractionDigits: 2
50
- });
51
-
52
- requestAnimationFrame(animateDebt);
53
- }
54
-
55
- fetch('/api/debt')
56
- .then(res => res.json())
57
- .then(data => {
58
- startingDebt = data.startingDebt;
59
- ratePerSecond = data.ratePerSecond;
60
- startTime = Date.now();
61
- currentDisplayDebt = startingDebt;
62
- animateDebt();
63
- })
64
- .catch(err => {
65
- document.getElementById('debt').textContent = 'Error loading data';
66
- console.error(err);
67
- });
68
- </script>
69
- </body>
70
  </html>
 
1
+ <!doctype html>
2
  <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>U.S. Debt Clock – Demo</title>
6
+ <meta name="viewport" content="width=device-width, initial-scale=1">
7
+ <style>
8
+ body{font-family:system-ui,Roboto,Arial,sans-serif;
9
+ display:flex;justify-content:center;align-items:center;
10
+ min-height:100vh;margin:0;background:#f5f7fa}
11
+ </style>
12
+ </head>
13
+ <body>
14
+ <div class="ntd-debt-clock"></div>
15
+ <script src="/embed.js" defer></script>
16
+ </body>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  </html>