update music api to listenbrainz
Deploy website / deploy (push) Successful in 3m1s

This commit is contained in:
2026-06-15 21:56:41 +01:00
parent af5116d931
commit cb7ec029eb
12 changed files with 215 additions and 81 deletions
+13 -53
View File
@@ -76,72 +76,32 @@ let last15Chars = "";
document.addEventListener('keydown', function(event) {
last15Chars += event.key;
if (last15Chars.includes("furry")) {
if (last15Chars.includes("owo")) {
console.log("owo, whats this?");
document.getElementById('furry').style.display = 'block';
last15Chars = "";
}
if (last15Chars.includes("irken")) {
console.log("doom doom doom!");
if (last15Chars.includes("doom")) {
console.log("Im gonna sing the doom song now");
document.querySelector(":root").style.setProperty('--font-family', 'Irken');
document.querySelector(":root").style.setProperty('--ultrafont-font', 'Irken');
document.querySelector(":root").style.setProperty('--smileos2-font', 'Irken');
document.querySelector(":root").style.setProperty('--title-font', '1.5em');
document.querySelector(":root").style.setProperty('--line-height', 'default');
document.querySelector(":root").style.setProperty('--header-line-height', 'default');
last15Chars = "";
}
if (last15Chars.includes("scratch")) {
if (last15Chars.includes("kfc")) {
console.log("space chicken");
document.querySelector(":root").style.setProperty('--font-family', 'Scratch');
document.querySelector(":root").style.setProperty('--title-font', '1em');
document.querySelector(":root").style.setProperty('--line-height', '120%');
document.querySelector(":root").style.setProperty('--header-line-height', '150%');
document.querySelector(":root").style.setProperty('--ultrafont-font', 'Scratch');
document.querySelector(":root").style.setProperty('--smileos2-font', 'Scratch');
last15Chars = "";
}
while (last15Chars.length >= 15) {
last15Chars = last15Chars.slice(1);
}
});
// Spotify API (now lastfm)
function getSpotify() {
fetch('https://api.alfieking.dev/spotify/nowplaying/xz02oolstlvwxqu1pfcua9exz').then(response => {
return response.json();
}).then(data => {
if (data.item == null) {
document.getElementById('spotify').style.backgroundImage = "none";
document.getElementById('spotify-title').innerHTML = "Spotify is not playing anything";
document.getElementById('spotify-artist').innerHTML = ":(";
document.getElementById('spotify-link').href = "https://open.spotify.com/";
return;
}
document.getElementById('spotify').style.backgroundImage = "url(" + data.item.album.images[0].url + ")";
document.getElementById('spotify-title').innerHTML = data.item.name;
document.getElementById('spotify-artist').innerHTML = data.item.artists[0].name;
document.getElementById('spotify-link').href = data.item.external_urls.spotify;
});
}
if (document.getElementById('spotify')) {
getSpotify();
setInterval(getSpotify, 15000);
}
// load buttons
function loadButtons() {
fetch('/static/content/buttons/non_link_buttons.txt').then(response => {
return response.text();
}).then(data => {
container = document.getElementById('button-collection');
for (let line of data.split('\n')) {
if (line == "") {
continue;
}
let img = document.createElement('img');
img.src = line;
container.appendChild(img);
}
});
}
if (document.getElementById('button-collection')) {
loadButtons();
}
});