2024-09-05 19:36:09 -05:00
|
|
|
# Music
|
|
|
|
My favorite songs, albums, and artists
|
|
|
|
## albums
|
2024-09-06 01:33:57 -05:00
|
|
|
|
|
|
|
<script id="albums">
|
|
|
|
const thisScript = document.getElementById("albums");
|
|
|
|
fetch("/music/albums.json")
|
|
|
|
.then((response) => response.json())
|
|
|
|
.then((json) => {
|
|
|
|
let html = "";
|
|
|
|
for (let i = 0; i < json.length; i++) {
|
|
|
|
let album = json[i];
|
|
|
|
let link = "/res/albums/" + album.link + ".webp";
|
|
|
|
let name = album.name;
|
|
|
|
let artist = album.artist;
|
|
|
|
let template = `<figure>
|
|
|
|
<img src="${link}">
|
|
|
|
<figcaption>
|
|
|
|
<b>${name}</b><br/><em>${artist}</em>
|
|
|
|
</figcaption>
|
|
|
|
</figure>`;
|
|
|
|
html = html.concat(template);
|
|
|
|
}
|
|
|
|
let section = document.createElement("section");
|
|
|
|
section.innerHTML = html;
|
|
|
|
thisScript.replaceWith(section); // lol
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
2024-09-05 19:36:09 -05:00
|
|
|
## artists
|
|
|
|
## songs
|