Skip to content

Commit 2110b63

Browse files
committed
Anniversary countdown added
1 parent ed383f5 commit 2110b63

File tree

9 files changed

+80
-51
lines changed

9 files changed

+80
-51
lines changed

budget-tracker/meta.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"lastUpdated": "Unknown"
3+
}

clicker-game/meta.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"lastUpdated": "Unknown"
3+
}

codriver/meta.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"lastUpdated": "Unknown"
3+
}

currency-converter/meta.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"lastUpdated": "Unknown"
3+
}

dodge-and-survive/meta.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"lastUpdated": "Unknown"
3+
}

e-table/meta.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"lastUpdated": "Unknown"
3+
}

index.html

Lines changed: 56 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -17,41 +17,10 @@ <h2>🎉 Happy New Year 2026!</h2>
1717
</p>
1818
</div>
1919

20-
<!-- LAST UPDATED CHECK SCRIPT -->
21-
<script>
22-
(async function () {
23-
const el = document.getElementById("last-updated");
24-
if (!el) return;
25-
26-
try {
27-
const response = await fetch(
28-
"https://api.github.com/repos/hellenicdev/hellenicdev/commits?per_page=1"
29-
);
30-
31-
const data = await response.json();
32-
const lastCommitDate = new Date(data[0].commit.committer.date);
33-
const now = new Date();
34-
35-
const diffDays = Math.floor(
36-
(now - lastCommitDate) / (1000 * 60 * 60 * 24)
37-
);
38-
39-
let text;
40-
if (diffDays === 0) {
41-
text = "Updated today";
42-
} else if (diffDays === 1) {
43-
text = "Updated yesterday";
44-
} else {
45-
text = `Updated ${diffDays} days ago`;
46-
}
20+
<script src="https://cdn.logwork.com/widget/countdown.js"></script>
21+
<a href="https://logwork.com/countdown-timer" class="countdown-timer" data-timezone="Europe/Athens" data-textcolor="#ffffff" data-date="2026-03-28 00:00" data-background="#19336e" data-digitscolor="#ffffff" data-unitscolor="#ffffff">Days until anniversary</a>
4722

48-
el.innerHTML = `🕒 <span>${text}</span>`;
49-
} catch (err) {
50-
el.textContent = "";
51-
}
52-
})();
53-
</script>
54-
<!-- SCRIPT END -->
23+
<!-- THE LAST UPDATED SCRIPT WAS HERE -->
5524

5625
<link rel="stylesheet" href="style.css" />
5726
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/css/all.min.css">
@@ -98,71 +67,71 @@ <h2>My Projects:</h2>
9867
<a href="./codriver/frontend/index.html">
9968
<h3>Codriver</h3>
10069
<p>An AI-powered assistant. It has games, jokes, riddles, and more.</p>
101-
<p id="last-updated" class="last-updated">
102-
Checking last update
70+
<p class="last-updated" data-meta="codriver/meta.json">
71+
Checking last update...
10372
</p>
10473
</a>
10574
</div>
10675
<div class="game-card">
10776
<a href="./clicker-game/index.html">
10877
<h3>Clicker Game</h3>
10978
<p>A simple incremental game where every click counts. Watch your score rise!</p>
110-
<p id="last-updated" class="last-updated">
111-
Checking last update
79+
<p class="last-updated" data-meta="clicker-game/meta.json">
80+
Checking last update...
11281
</p>
11382
</a>
11483
</div>
11584
<div class="game-card">
11685
<a href="./budget-tracker/index.html">
11786
<h3>Budget Tracker</h3>
118-
<p>Track your income and expenses with ease. Great for personal finance planning (data saved locally).</p>
119-
<p id="last-updated" class="last-updated">
120-
Checking last update
87+
<p>Track your income and expenses with ease. Great for personal finance planning (data saved in browser cookies).</p>
88+
<p class="last-updated" data-meta="budget-tracker/meta.json">
89+
Checking last update...
12190
</p>
12291
</a>
12392
</div>
12493
<div class="game-card">
12594
<a href="./the-quiz/index.html">
12695
<h3>The Quiz</h3>
12796
<p>Test your knowledge in various subjects. Fun and educational quiz app!</p>
128-
<p id="last-updated" class="last-updated">
129-
Checking last update
97+
<p class="last-updated" data-meta="the-quiz/meta.json">
98+
Checking last update...
13099
</p>
131100
</a>
132101
</div>
133102
<div class="game-card">
134103
<a href="./e-table/index.html">
135104
<h3>E-table</h3>
136105
<p>A mock app. Supposed to be a platform where you can reserve a table at a restaurant.</p>
137-
<p id="last-updated" class="last-updated">
138-
Checking last update
106+
<p class="last-updated" data-meta="e-table/meta.json">
107+
Checking last update...
139108
</p>
140109
</a>
141110
</div>
142111
<div class="game-card">
143112
<a href="./dodge-and-survive/index.html">
144113
<h3>Dodge & Survive</h3>
145114
<p>A fast-paced arcade game where you dodge enemies and try to survive as long as possible.</p>
146-
<p id="last-updated" class="last-updated">
147-
Checking last update
115+
<p class="last-updated" data-meta="dodge-and-survive/meta.json">
116+
Checking last update...
148117
</p>
149118
</a>
150119
</div>
151120
<div class="game-card">
152121
<a href="./the-sound-quiz/index.html">
153122
<h3>The Sound Quiz</h3>
154123
<p>A simple quiz. You hear sounds and you have to guess them.</p>
155-
<p id="last-updated" class="last-updated">
156-
Checking last update
124+
<p class="last-updated" data-meta="the-sound-quiz/meta.json">
125+
Checking last update...
157126
</p>
158127
</a>
159128
</div>
160129
<div class="game-card">
161130
<a href="https://currency-converter-7fmk.onrender.com">
162131
<h3>Currency Converter</h3>
163132
<p>A currency converter with all major currencies.</p>
164-
<p id="last-updated" class="last-updated">
165-
Checking last update
133+
<p class="last-updated" data-meta="currency-converter/meta.json">
134+
Checking last update...
166135
</p>
167136
</a>
168137
</div>
@@ -1181,6 +1150,42 @@ <h3> HOW TO VOTE: </h3>
11811150
<!-- END OF UPDATES -->
11821151
</footer>
11831152
<a href="privacy-policy.html">Privacy Policy</a>
1153+
1154+
<!-- LAST UPDATED CHECK SCRIPT -->
1155+
<script>
1156+
document.addEventListener("DOMContentLoaded", async () => {
1157+
const items = document.querySelectorAll(".last-updated");
1158+
1159+
for (const el of items) {
1160+
const path = el.dataset.meta;
1161+
if (!path) continue;
1162+
1163+
try {
1164+
const res = await fetch(path, { cache: "no-store" });
1165+
if (!res.ok) throw new Error();
1166+
1167+
const data = await res.json();
1168+
const last = new Date(data.lastUpdated);
1169+
const days = Math.floor(
1170+
(Date.now() - last) / (1000 * 60 * 60 * 24)
1171+
);
1172+
1173+
const text =
1174+
days === 0
1175+
? "Updated today"
1176+
: days === 1
1177+
? "Updated yesterday"
1178+
: `Updated ${days} days ago`;
1179+
1180+
el.textContent = `🕒 ${text}`;
1181+
} catch {
1182+
el.textContent = "";
1183+
}
1184+
}
1185+
});
1186+
</script>
1187+
1188+
<!-- SCRIPT END -->
11841189

11851190
</body>
11861191
</html>

the-quiz/meta.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"lastUpdated": "Unknown"
3+
}

the-sound-quiz/meta.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"lastUpdated": "Unknown"
3+
}

0 commit comments

Comments
 (0)