diff --git a/website/assets/style.css b/website/assets/style.css index 37fb78a..2530de3 100644 --- a/website/assets/style.css +++ b/website/assets/style.css @@ -133,11 +133,26 @@ h6 { grid-area: lastfm; display: flex; align-items: center; + flex-direction: column; + gap: 20px; + justify-content: center; + +} +.lastfm > .inner { + display: flex; + flex-direction: column; + justify-content: center; + width:100%; + gap: 20px; +} +.lastfm > .inner > .inner-inner { + display: flex; + align-items: center; + justify-content: center; flex-direction: row; gap: 20px; } - -.lastfm > div { +.lastfm > div, .lastfm > .inner > .inner-inner > div { display: flex; flex-direction: column; justify-content: center; @@ -151,11 +166,11 @@ h6 { .order { display: grid; grid-template-areas: - "details skills" - "details donations" + "details lastfm" + "details lastfm" "projects commit" - "projects lastfm" - "webrings webrings" + "projects webrings" + "donations donations" "status binkies" "blog blog"; grid-gap: 5px; @@ -253,9 +268,6 @@ h6 { transition: color 0.2s; } -.skills { - grid-area: skills; -} .status { grid-area: status; @@ -275,7 +287,6 @@ webring-container { grid-template-areas: "details " "status" - "skills " "projects " "donations " "lastfm" diff --git a/website/index.html b/website/index.html index 2960c4b..2d95674 100644 --- a/website/index.html +++ b/website/index.html @@ -67,6 +67,16 @@ __TEMPLATE_HEAD__ </a> + +

Skills

+
-
-

Skills

- -
diff --git a/website/scripts/lastfm.ts b/website/scripts/lastfm.ts index 6bbe1aa..1f41b3d 100644 --- a/website/scripts/lastfm.ts +++ b/website/scripts/lastfm.ts @@ -1,32 +1,33 @@ import { timeAgo } from "./util"; +interface Track { + artist: { + mbid: string; + "#text": string; + }; + streamable: string; + image: Array<{ + size: string; + "#text": string; + }>; + mbid: string; + album: { + mbid: string; + "#text": string; + }; + name: string; + "@attr"?: { + nowplaying: string; + }; + url: string; + date?: { + uts: string; + "#text": string; + }; +} interface GetRecentTracksType { recenttracks: { - track: Array<{ - artist: { - mbid: string; - "#text": string; - }; - streamable: string; - image: Array<{ - size: string; - "#text": string; - }>; - mbid: string; - album: { - mbid: string; - "#text": string; - }; - name: string; - "@attr"?: { - nowplaying: string; - }; - url: string; - date?: { - uts: string; - "#text": string; - }; - }>; + track: Array; "@attr": { user: string; totalPages: string; @@ -61,18 +62,13 @@ const lastFM = { }, getRecentTracks: async (user: string): Promise => { const request = await fetch( - lastFM.constructUrl("User.getrecenttracks", { user, limit: 1 }) + lastFM.constructUrl("User.getrecenttracks", { user, limit: 4 }) ); return await request.json(); }, }; -(async () => { - const recentTracks = await lastFM.getRecentTracks("fucksophie"); - const track = recentTracks.recenttracks.track[0]; - if (!track) return; - const lastFMElement = document.getElementById("lastfm")!; - lastFMElement.innerHTML = ""; +function renderTrack(element: HTMLDivElement, track: Track) { const img = document.createElement("img"); img.width = 174; img.height = 174; @@ -81,7 +77,7 @@ const lastFM = { if (!imageUrl) imageUrl = track.image.at(-1)?.["#text"]!; img.src = imageUrl; - lastFMElement?.appendChild(img); + element?.appendChild(img); const div = document.createElement("div"); const h1 = document.createElement("h1"); @@ -102,5 +98,27 @@ const lastFM = { div.appendChild(h1); div.appendChild(spanArtist); div.appendChild(spanTitle); - lastFMElement?.appendChild(div); + element?.appendChild(div); + +} +(async () => { + const recentTracks = await lastFM.getRecentTracks("fucksophie"); + const track = recentTracks.recenttracks.track.shift(); + const lastFMElement = document.getElementById("lastfm") as HTMLDivElement; + lastFMElement.innerHTML = ""; + if (track) { + renderTrack(lastFMElement, track) + + const div = document.createElement('div'); + + div.className = "inner"; + for (let i = 0; i < 2; i++) { + const div2 = document.createElement('div'); + div2.className = "inner-inner"; + renderTrack(div2, recentTracks.recenttracks.track[i]) + div.appendChild(div2) + } + + lastFMElement.appendChild(div); + } })(); diff --git a/website/scripts/webrings.ts b/website/scripts/webrings.ts index 25fa0ab..19581a9 100644 --- a/website/scripts/webrings.ts +++ b/website/scripts/webrings.ts @@ -2,11 +2,6 @@ document.addEventListener("DOMContentLoaded", () => { const webringsElement = document.querySelector(".webrings"); if (!webringsElement) return; - const pmoringScript = document.createElement("script"); - pmoringScript.src = "https://palette.nekoweb.org/pmoring.js"; - pmoringScript.setAttribute("data-type", "noir"); - webringsElement.appendChild(pmoringScript); - const bucketIframe = document.createElement("iframe"); bucketIframe.title = "the bucket webring"; bucketIframe.id = "bucket-webring";