From ee11b4f71bbdad1d35b67492f7a5f1a5445c9801 Mon Sep 17 00:00:00 2001 From: dvorakmortonxd Date: Wed, 23 Sep 2026 11:50:25 +0200 Subject: [PATCH] animation tweaks and mobile desktop fixes --- src/app/api/activities/route.ts | 17 ++++++- src/app/components/ServiceButton.tsx | 3 +- src/app/components/WindowsDesktop.tsx | 37 +++++++++++++-- src/app/skeuo.css | 66 ++++++++++++++++++++++++--- 4 files changed, 107 insertions(+), 16 deletions(-) diff --git a/src/app/api/activities/route.ts b/src/app/api/activities/route.ts index ac09b43..efe4259 100644 --- a/src/app/api/activities/route.ts +++ b/src/app/api/activities/route.ts @@ -1,8 +1,21 @@ +const USERNAME = "dvorakmortonxd"; + export async function GET() { try { - const res = await fetch("https://git.dvorakmortonxd.dev/api/v1/users/dvorakmortonxd/activities/feeds?limit=20"); + // The public user feed also contains activity from repositories the user + // watches (e.g. commits pushed by other people to an org repo), so pull a + // larger page and keep only actions the user actually performed. + const res = await fetch( + `https://git.dvorakmortonxd.dev/api/v1/users/${USERNAME}/activities/feeds?limit=50` + ); const data = await res.json(); - return Response.json(data); + if (!Array.isArray(data)) { + return Response.json(data); + } + const mine = data.filter( + (act) => act?.act_user?.login === USERNAME + ); + return Response.json(mine); } catch { return Response.json({ error: "failed to load" }, { status: 500 }); } diff --git a/src/app/components/ServiceButton.tsx b/src/app/components/ServiceButton.tsx index 40baa0e..64767d7 100644 --- a/src/app/components/ServiceButton.tsx +++ b/src/app/components/ServiceButton.tsx @@ -27,12 +27,11 @@ export default function ServiceButton({ url, checkUrl, className, icon, name, de const statusColor = effectiveStatus === 'up' ? '#4ade80' : effectiveStatus === 'down' ? '#ef4444' : '#9ca3af'; const statusGlow = effectiveStatus === 'up' ? 'rgba(74, 222, 128, 0.9)' : effectiveStatus === 'down' ? 'rgba(239, 68, 68, 0.9)' : 'transparent'; const statusLabel = effectiveStatus === 'up' ? 'Active' : effectiveStatus === 'down' ? 'Dead' : 'Checking...'; - const isFriend = className === 'friend'; const content = ( <> - {isFriend && } + {icon} diff --git a/src/app/components/WindowsDesktop.tsx b/src/app/components/WindowsDesktop.tsx index a627b63..471dedb 100644 --- a/src/app/components/WindowsDesktop.tsx +++ b/src/app/components/WindowsDesktop.tsx @@ -53,6 +53,7 @@ export default function WindowsDesktop() { ]); const [activeId, setActiveId] = useState(1); const [startOpen, setStartOpen] = useState(false); + const [startClosing, setStartClosing] = useState(false); const [selectedIcon, setSelectedIcon] = useState(null); const [closingIds, setClosingIds] = useState([]); @@ -78,7 +79,7 @@ export default function WindowsDesktop() { }; const openApp = (appId: string) => { - setStartOpen(false); + if (startOpen) setStartClosing(true); const existing = wins.find((w) => w.appId === appId); if (existing) { setWins((prev) => @@ -117,6 +118,21 @@ export default function WindowsDesktop() { setActiveId(id); }; + const closeStart = () => { + if (startOpen && !startClosing) setStartClosing(true); + }; + + const toggleStart = () => { + if (!startOpen) { + setStartClosing(false); + setStartOpen(true); + } else if (startClosing) { + setStartClosing(false); + } else { + setStartClosing(true); + } + }; + // Animate the window out first, then drop it from state. const closeWin = (id: number) => setClosingIds((prev) => (prev.includes(id) ? prev : [...prev, id])); @@ -168,7 +184,7 @@ export default function WindowsDesktop() { style={{ backgroundImage: wallpaper }} onPointerDown={(e) => { if (e.target === e.currentTarget) { - setStartOpen(false); + closeStart(); setSelectedIcon(null); } }} @@ -264,7 +280,17 @@ export default function WindowsDesktop() { {/* Application launcher */} {startOpen && ( -
e.stopPropagation()}> +
e.stopPropagation()} + onAnimationEnd={(e) => { + if (e.target !== e.currentTarget) return; + if (startClosing) { + setStartOpen(false); + setStartClosing(false); + } + }} + >
Applications
@@ -333,7 +359,7 @@ export default function WindowsDesktop() {