ho-code hocode
Some checks failed
/ build (push) Failing after 56s

This commit is contained in:
Soph :3 2025-11-17 22:06:42 +02:00
parent 036a16017e
commit 4754b9a791
4 changed files with 83 additions and 60 deletions

View file

@ -133,11 +133,26 @@ h6 {
grid-area: lastfm; grid-area: lastfm;
display: flex; display: flex;
align-items: center; 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; flex-direction: row;
gap: 20px; gap: 20px;
} }
.lastfm > div, .lastfm > .inner > .inner-inner > div {
.lastfm > div {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
@ -151,11 +166,11 @@ h6 {
.order { .order {
display: grid; display: grid;
grid-template-areas: grid-template-areas:
"details skills" "details lastfm"
"details donations" "details lastfm"
"projects commit" "projects commit"
"projects lastfm" "projects webrings"
"webrings webrings" "donations donations"
"status binkies" "status binkies"
"blog blog"; "blog blog";
grid-gap: 5px; grid-gap: 5px;
@ -253,9 +268,6 @@ h6 {
transition: color 0.2s; transition: color 0.2s;
} }
.skills {
grid-area: skills;
}
.status { .status {
grid-area: status; grid-area: status;
@ -275,7 +287,6 @@ webring-container {
grid-template-areas: grid-template-areas:
"details " "details "
"status" "status"
"skills "
"projects " "projects "
"donations " "donations "
"lastfm" "lastfm"

View file

@ -67,6 +67,16 @@ __TEMPLATE_HEAD__
</a> </a>
</pre> </pre>
</div> </div>
<h1>Skills</h1>
<ul>
<li>Around 9 years of near constant JS/TS development. Full-Stack, including discord bots.</li>
<li>4 years of TSX</li>
<li>SQL and PostgreSQL(pSQL) since I started development.</li>
<li>Lots of webdev build tools and more. <a href="https://git.sad.ovh/sophie/website">This site uses my
own build tools.</a></li>
<li>10 years of Java development. Mostly Bukkit plugins and fabric mods, and MC related projects.</li>
</ul>
</div> </div>
<div class="paper projects"> <div class="paper projects">
<ul class="projects-list"> <ul class="projects-list">
@ -213,17 +223,6 @@ __TEMPLATE_HEAD__
</li> </li>
</ul> </ul>
</div> </div>
<div class="paper skills">
<h1>Skills</h1>
<ul>
<li>Around 9 years of near constant JS/TS development. Full-Stack, including discord bots.</li>
<li>4 years of TSX</li>
<li>SQL and PostgreSQL(pSQL) since I started development.</li>
<li>Lots of webdev build tools and more. <a href="https://git.sad.ovh/sophie/website">This site uses my
own build tools.</a></li>
<li>10 years of Java development. Mostly Bukkit plugins and fabric mods, and MC related projects.</li>
</ul>
</div>
<div class="paper blog" id="root"></div> <div class="paper blog" id="root"></div>
<div class="paper status" id="status"> <div class="paper status" id="status">
</div> </div>

View file

@ -1,32 +1,33 @@
import { timeAgo } from "./util"; 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 { interface GetRecentTracksType {
recenttracks: { recenttracks: {
track: Array<{ track: Array<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;
};
}>;
"@attr": { "@attr": {
user: string; user: string;
totalPages: string; totalPages: string;
@ -61,18 +62,13 @@ const lastFM = {
}, },
getRecentTracks: async (user: string): Promise<GetRecentTracksType> => { getRecentTracks: async (user: string): Promise<GetRecentTracksType> => {
const request = await fetch( const request = await fetch(
lastFM.constructUrl("User.getrecenttracks", { user, limit: 1 }) lastFM.constructUrl("User.getrecenttracks", { user, limit: 4 })
); );
return await request.json(); return await request.json();
}, },
}; };
(async () => { function renderTrack(element: HTMLDivElement, track: Track) {
const recentTracks = await lastFM.getRecentTracks("fucksophie");
const track = recentTracks.recenttracks.track[0];
if (!track) return;
const lastFMElement = document.getElementById("lastfm")!;
lastFMElement.innerHTML = "";
const img = document.createElement("img"); const img = document.createElement("img");
img.width = 174; img.width = 174;
img.height = 174; img.height = 174;
@ -81,7 +77,7 @@ const lastFM = {
if (!imageUrl) imageUrl = track.image.at(-1)?.["#text"]!; if (!imageUrl) imageUrl = track.image.at(-1)?.["#text"]!;
img.src = imageUrl; img.src = imageUrl;
lastFMElement?.appendChild(img); element?.appendChild(img);
const div = document.createElement("div"); const div = document.createElement("div");
const h1 = document.createElement("h1"); const h1 = document.createElement("h1");
@ -102,5 +98,27 @@ const lastFM = {
div.appendChild(h1); div.appendChild(h1);
div.appendChild(spanArtist); div.appendChild(spanArtist);
div.appendChild(spanTitle); 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);
}
})(); })();

View file

@ -2,11 +2,6 @@ document.addEventListener("DOMContentLoaded", () => {
const webringsElement = document.querySelector(".webrings"); const webringsElement = document.querySelector(".webrings");
if (!webringsElement) return; 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"); const bucketIframe = document.createElement("iframe");
bucketIframe.title = "the bucket webring"; bucketIframe.title = "the bucket webring";
bucketIframe.id = "bucket-webring"; bucketIframe.id = "bucket-webring";