Skip to content

Commit df54007

Browse files
committed
added clock
1 parent ca9879f commit df54007

File tree

10 files changed

+195
-51
lines changed

10 files changed

+195
-51
lines changed

data/lastfm-12month.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
"topArtists": [
33
{
44
"name": "d4vd",
5-
"playcount": "8613",
6-
"image": "https://i.scdn.co/image/ab6761610000e5ebee632cde061121a5fe48c1d6"
5+
"playcount": "8612",
6+
"image": "https://i.scdn.co/image/ab6761610000e5ebad447187a35f422307e88ad3"
77
},
88
{
99
"name": "Juice WRLD",
10-
"playcount": "4424",
11-
"image": "https://i.scdn.co/image/ab6761610000e5eb1908e1a8b79abf71d5598944"
10+
"playcount": "4420",
11+
"image": "https://i.scdn.co/image/ab6761610000e5eb01ab50f1479f24a42804efd8"
1212
},
1313
{
1414
"name": "Kanye West",
15-
"playcount": "2690",
15+
"playcount": "2688",
1616
"image": "https://i.scdn.co/image/ab6761610000e5eb6e835a500e791bf9c27a422a"
1717
},
1818
{
@@ -22,7 +22,7 @@
2222
},
2323
{
2424
"name": "T-Low",
25-
"playcount": "1009",
25+
"playcount": "1008",
2626
"image": "https://i.scdn.co/image/ab6761610000e5eb277b7bfff953612e29721019"
2727
}
2828
],
@@ -86,9 +86,9 @@
8686
{
8787
"name": "Goodbye & Good Riddance",
8888
"artist": "Juice WRLD",
89-
"playcount": "644",
89+
"playcount": "643",
9090
"image": "https://lastfm.freetls.fastly.net/i/u/300x300/cb8e41ecc96f769575babd440b81e795.jpg"
9191
}
9292
],
93-
"lastUpdated": "2025-03-08T18:09:51.450Z"
93+
"lastUpdated": "2025-03-09T10:35:21.116Z"
9494
}

data/lastfm-1month.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,35 @@
22
"topArtists": [
33
{
44
"name": "d4vd",
5-
"playcount": "371",
5+
"playcount": "325",
66
"image": "https://i.scdn.co/image/ab6761610000e5ebee632cde061121a5fe48c1d6"
77
},
88
{
99
"name": "Paris Texas",
1010
"playcount": "171",
11-
"image": "https://i.scdn.co/image/ab6761610000e5ebf569e0b8305898f5492bf1c5"
11+
"image": "https://i.scdn.co/image/ab6761610000e5ebcd4785b475935db2fdb9915d"
1212
},
1313
{
1414
"name": "Kanye West",
15-
"playcount": "133",
15+
"playcount": "126",
1616
"image": "https://i.scdn.co/image/ab6761610000e5eb6e835a500e791bf9c27a422a"
1717
},
18-
{
19-
"name": "Juice WRLD",
20-
"playcount": "112",
21-
"image": "https://i.scdn.co/image/ab6761610000e5eb01ab50f1479f24a42804efd8"
22-
},
2318
{
2419
"name": "JPEGMAFIA",
25-
"playcount": "111",
20+
"playcount": "114",
2621
"image": "https://i.scdn.co/image/ab6761610000e5eb2341a6c97594cb2d675f4e89"
22+
},
23+
{
24+
"name": "Juice WRLD",
25+
"playcount": "109",
26+
"image": "https://i.scdn.co/image/ab6761610000e5eb01ab50f1479f24a42804efd8"
2727
}
2828
],
2929
"topTracks": [
3030
{
3131
"name": "One More Dance",
3232
"artist": "d4vd",
33-
"playcount": "197",
33+
"playcount": "154",
3434
"image": "https://i.scdn.co/image/ab67616d0000b273a7423a5541412c6387959523"
3535
},
3636
{
@@ -62,7 +62,7 @@
6262
{
6363
"name": "One More Dance",
6464
"artist": "d4vd",
65-
"playcount": "197",
65+
"playcount": "154",
6666
"image": "https://lastfm.freetls.fastly.net/i/u/300x300/1b1d95c32cf8508b25eb44072be69ad7.jpg"
6767
},
6868
{
@@ -90,5 +90,5 @@
9090
"image": "https://lastfm.freetls.fastly.net/i/u/300x300/de0fbf0601a554a6e1c61226c22f7909.jpg"
9191
}
9292
],
93-
"lastUpdated": "2025-03-08T18:09:41.681Z"
93+
"lastUpdated": "2025-03-09T10:35:11.626Z"
9494
}

data/lastfm-3month.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,27 @@
22
"topArtists": [
33
{
44
"name": "d4vd",
5-
"playcount": "2352",
6-
"image": "https://i.scdn.co/image/ab6761610000e5ebad447187a35f422307e88ad3"
5+
"playcount": "2346",
6+
"image": "https://i.scdn.co/image/ab6761610000e5ebee632cde061121a5fe48c1d6"
77
},
88
{
99
"name": "Kanye West",
10-
"playcount": "419",
10+
"playcount": "416",
1111
"image": "https://i.scdn.co/image/ab6761610000e5eb6e835a500e791bf9c27a422a"
1212
},
1313
{
1414
"name": "Juice WRLD",
15-
"playcount": "301",
15+
"playcount": "298",
1616
"image": "https://i.scdn.co/image/ab6761610000e5eb01ab50f1479f24a42804efd8"
1717
},
1818
{
1919
"name": "JPEGMAFIA",
20-
"playcount": "268",
20+
"playcount": "267",
2121
"image": "https://i.scdn.co/image/ab6761610000e5eb2341a6c97594cb2d675f4e89"
2222
},
2323
{
2424
"name": "Paris Texas",
25-
"playcount": "259",
25+
"playcount": "258",
2626
"image": "https://i.scdn.co/image/ab6761610000e5ebcd4785b475935db2fdb9915d"
2727
}
2828
],
@@ -36,7 +36,7 @@
3636
{
3737
"name": "Leave Her",
3838
"artist": "d4vd",
39-
"playcount": "449",
39+
"playcount": "448",
4040
"image": "https://i.scdn.co/image/ab67616d0000b2739a48777a54e25db0a037db48"
4141
},
4242
{
@@ -68,7 +68,7 @@
6868
{
6969
"name": "Withering",
7070
"artist": "d4vd",
71-
"playcount": "453",
71+
"playcount": "452",
7272
"image": "https://lastfm.freetls.fastly.net/i/u/300x300/059d02b476b049d21a62dff01462b80f.jpg"
7373
},
7474
{
@@ -80,15 +80,15 @@
8080
{
8181
"name": "I LAY DOWN MY LIFE FOR YOU",
8282
"artist": "JPEGMAFIA",
83-
"playcount": "122",
83+
"playcount": "120",
8484
"image": "https://lastfm.freetls.fastly.net/i/u/300x300/de0fbf0601a554a6e1c61226c22f7909.jpg"
8585
},
8686
{
8787
"name": "WASTELAND",
8888
"artist": "Brent Faiyaz",
89-
"playcount": "87",
89+
"playcount": "88",
9090
"image": "https://lastfm.freetls.fastly.net/i/u/300x300/74c7c0622904c1fdf629bc307952ccc4.jpg"
9191
}
9292
],
93-
"lastUpdated": "2025-03-08T18:09:46.323Z"
93+
"lastUpdated": "2025-03-09T10:35:16.812Z"
9494
}

data/lastfm-7day.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@
1212
},
1313
{
1414
"name": "The Kid LAROI",
15-
"playcount": "51",
15+
"playcount": "49",
1616
"image": "https://i.scdn.co/image/ab6761610000e5ebebf5c408f4d003817161e061"
1717
},
1818
{
1919
"name": "re6ce",
20-
"playcount": "32",
20+
"playcount": "30",
2121
"image": "https://i.scdn.co/image/ab6761610000e5eb201f3b61faba242c30f75fd6"
2222
},
2323
{
24-
"name": "d4vd",
25-
"playcount": "30",
26-
"image": "https://i.scdn.co/image/ab6761610000e5ebee632cde061121a5fe48c1d6"
24+
"name": "JPEGMAFIA",
25+
"playcount": "28",
26+
"image": "https://i.scdn.co/image/ab6761610000e5eb2341a6c97594cb2d675f4e89"
2727
}
2828
],
2929
"topTracks": [
@@ -90,5 +90,5 @@
9090
"image": "https://lastfm.freetls.fastly.net/i/u/300x300/9373642d1f9fc218700f8ff915974988.jpg"
9191
}
9292
],
93-
"lastUpdated": "2025-03-08T18:09:37.334Z"
93+
"lastUpdated": "2025-03-09T10:35:06.797Z"
9494
}

data/lastfm-overall.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"topArtists": [
33
{
44
"name": "Juice WRLD",
5-
"playcount": "34667",
5+
"playcount": "34668",
66
"image": "https://i.scdn.co/image/ab6761610000e5eb01ab50f1479f24a42804efd8"
77
},
88
{
@@ -12,7 +12,7 @@
1212
},
1313
{
1414
"name": "Kanye West",
15-
"playcount": "4287",
15+
"playcount": "4288",
1616
"image": "https://i.scdn.co/image/ab6761610000e5eb6e835a500e791bf9c27a422a"
1717
},
1818
{
@@ -90,5 +90,5 @@
9090
"image": "https://lastfm.freetls.fastly.net/i/u/300x300/914613d0191a7d442be4238f3fef6e89.jpg"
9191
}
9292
],
93-
"lastUpdated": "2025-03-08T18:09:57.057Z"
93+
"lastUpdated": "2025-03-09T10:35:25.783Z"
9494
}

index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
</head>
1111
<body>
1212
<div class="custom-cursor"></div>
13+
<pre id="ascii-clock" class="ascii-clock"></pre>
1314
<div id="content">
1415
<div id="box-projects" class="box" onclick="scrollToSection('projects-section')">
1516
<h1>Projects</h1>

monthly_stats.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
"topTrack": {
33
"name": "One More Dance",
44
"artist": "d4vd",
5-
"plays": 197,
5+
"plays": 154,
66
"image": "https://lastfm.freetls.fastly.net/i/u/174s/1b1d95c32cf8508b25eb44072be69ad7.jpg"
77
},
88
"topArtist": {
99
"name": "d4vd",
10-
"plays": 370,
10+
"plays": 325,
1111
"image": "https://lastfm.freetls.fastly.net/i/u/174s/04abd50f999854510c83b9a8c88f92a5.png"
1212
},
1313
"topAlbum": {
1414
"name": "One More Dance",
1515
"artist": "d4vd",
16-
"plays": 197,
16+
"plays": 154,
1717
"image": "https://lastfm.freetls.fastly.net/i/u/174s/1b1d95c32cf8508b25eb44072be69ad7.jpg"
1818
}
1919
}

script.js

Lines changed: 84 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,4 +415,87 @@ async function updateChart() {
415415
// Call all functions when the page loads
416416
displayMusicStats();
417417
displayRandomRecommendation();
418-
updateChart();
418+
updateChart();
419+
420+
// ASCII Clock implementation - exact working code
421+
document.addEventListener('DOMContentLoaded', function() {
422+
const digits = [
423+
[" 000 ", "0 0", "0 0", "0 0", " 000 "],
424+
[" 1 ", " 11 ", " 1 ", " 1 ", " 111 "],
425+
[" 222 ", "2 2", " 22 ", " 2 ", " 2222"],
426+
[" 333 ", " 3", " 33 ", " 3", " 333 "],
427+
[" 4 4", "4 4 ", " 4444", " 4", " 4"],
428+
[" 5555", " 5 ", " 555 ", " 5", " 555 "],
429+
[" 666 ", " 6 ", " 666 ", " 6 6", " 666 "],
430+
[" 7777", " 7", " 7 ", " 7 ", " 7 "],
431+
[" 888 ", "8 8", " 888 ", "8 8", " 888 "],
432+
[" 999 ", "9 9", " 999 ", " 9", " 999 "],
433+
[" ", " * ", " ", " * ", " "] // Colon
434+
];
435+
436+
function getAsciiTime() {
437+
// Create date for Berlin timezone (CEST)
438+
const now = new Date();
439+
const berlinTime = new Date(now.toLocaleString('en-US', { timeZone: 'Europe/Berlin' }));
440+
441+
const h = berlinTime.getHours().toString().padStart(2, '0');
442+
const m = berlinTime.getMinutes().toString().padStart(2, '0');
443+
const s = berlinTime.getSeconds().toString().padStart(2, '0');
444+
const timeStr = h + ':' + m + ':' + s;
445+
let asciiTime = "";
446+
447+
for (let row = 0; row < 5; row++) {
448+
for (let char of timeStr) {
449+
asciiTime += digits[char === ':' ? 10 : parseInt(char)][row] + " ";
450+
}
451+
asciiTime += "\n";
452+
}
453+
454+
return asciiTime;
455+
}
456+
457+
function updateClock() {
458+
const clockElement = document.getElementById('ascii-clock');
459+
if (clockElement) {
460+
clockElement.textContent = getAsciiTime();
461+
}
462+
}
463+
464+
// Update every second
465+
setInterval(updateClock, 1000);
466+
updateClock();
467+
468+
// Add hover information for the timezone
469+
const clockElement = document.getElementById('ascii-clock');
470+
clockElement.setAttribute('data-timezone', 'CEST / BERLIN');
471+
clockElement.classList.add('has-info');
472+
473+
console.log('ASCII clock initialized with Berlin time');
474+
});
475+
476+
// Update cursor for clock hover with random city
477+
document.addEventListener('DOMContentLoaded', function() {
478+
const cestCities = [
479+
"BERLIN", "PARIS", "ROME", "MADRID", "VIENNA",
480+
"AMSTERDAM", "BRUSSELS", "COPENHAGEN", "WARSAW", "PRAGUE",
481+
"BUDAPEST", "MUNICH", "MILAN", "BARCELONA", "ZURICH",
482+
"GENEVA", "FRANKFURT", "HAMBURG", "LYON", "STOCKHOLM",
483+
"OSLO", "VIENNA", "ZAGREB", "LJUBLJANA", "BRATISLAVA",
484+
"BELGRADE", "BERN", "LUXEMBOURG", "MONACO", "VADUZ"
485+
];
486+
487+
const clockElement = document.querySelector('#ascii-clock');
488+
if (clockElement) {
489+
clockElement.addEventListener('mouseenter', () => {
490+
// Get random city
491+
const randomCity = cestCities[Math.floor(Math.random() * cestCities.length)];
492+
cursor.classList.add('active', 'clock-hover');
493+
cursor.innerHTML = `CEST / ${randomCity}`;
494+
});
495+
496+
clockElement.addEventListener('mouseleave', () => {
497+
cursor.classList.remove('active', 'clock-hover');
498+
cursor.innerHTML = '';
499+
});
500+
}
501+
});

0 commit comments

Comments
 (0)