12
app/api/lastfm/route.ts
Normal file
@ -0,0 +1,12 @@
|
||||
export async function GET() {
|
||||
const res = await fetch(
|
||||
`http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=yae_miku&api_key=${process.env.API_KEY}&format=json&limit=1`,
|
||||
{
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
}
|
||||
);
|
||||
const data = await res.json();
|
||||
return Response.json(data.recenttracks.track[0]);
|
||||
}
|
BIN
app/favicon.ico
Before Width: | Height: | Size: 25 KiB |
@ -2,6 +2,6 @@
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
||||
ul {
|
||||
/* ul {
|
||||
@apply flex flex-row gap-x-4 flex-wrap list-inside items-center justify-center
|
||||
}
|
||||
} */
|
||||
|
3
app/icon.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
|
||||
<text y="1em" font-size="80">🌺</text>
|
||||
</svg>
|
After Width: | Height: | Size: 112 B |
@ -1,5 +1,6 @@
|
||||
import type { Metadata } from 'next';
|
||||
import './globals.css';
|
||||
import bg from '@/public/orchids.webp';
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: 'Nikola Kubiczek',
|
||||
@ -12,8 +13,13 @@ export default function RootLayout({
|
||||
children: React.ReactNode;
|
||||
}>) {
|
||||
return (
|
||||
<html lang="en">
|
||||
<body className="antialiased">{children}</body>
|
||||
<html lang="en" className="dark">
|
||||
<body
|
||||
className="antialiased bg-stone-900 bg-cover"
|
||||
style={{ backgroundImage: `url(${bg.src})` }}
|
||||
>
|
||||
{children}
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
|
76
app/page.tsx
@ -3,32 +3,30 @@
|
||||
import Image from 'next/image';
|
||||
import useSWR, { Fetcher } from 'swr';
|
||||
|
||||
type ListenBrainz = {
|
||||
payload: {
|
||||
listens: {
|
||||
track_metadata: {
|
||||
track_name: string;
|
||||
artist_name: string;
|
||||
release_name: string;
|
||||
};
|
||||
}[];
|
||||
type LastFM = {
|
||||
artist: { '#text': string };
|
||||
image: [{ size: string; '#text': string }];
|
||||
mbid: string;
|
||||
album: {
|
||||
mbid: string;
|
||||
'#text': string;
|
||||
};
|
||||
name: string;
|
||||
'@attr': { nowplaying: string };
|
||||
url: string;
|
||||
};
|
||||
|
||||
const fetcher: Fetcher<ListenBrainz, string> = (...args) =>
|
||||
const fetcher: Fetcher<LastFM, string> = (...args) =>
|
||||
fetch(...args).then((res) => res.json());
|
||||
|
||||
export default function Home() {
|
||||
const { data, isLoading } = useSWR(
|
||||
'https://api.listenbrainz.org/1/user/yaemiku/listens?count=1',
|
||||
fetcher
|
||||
);
|
||||
const { data, isLoading } = useSWR('/api/lastfm', fetcher);
|
||||
|
||||
return (
|
||||
<div className="prose prose-stone mx-auto mt-6 p-4">
|
||||
<header className="text-center">
|
||||
<div className="prose prose-invert mx-auto pt-6 pb-4 px-6 shadow-sm">
|
||||
<header className="text-center backdrop-blur-sm p-2 border-2 border-gray-700 rounded-md">
|
||||
<Image
|
||||
src={'/pfp_fb_cropped.jpg'}
|
||||
src={'/pfp_pic.webp'}
|
||||
width={200}
|
||||
height={200}
|
||||
alt="My Picture"
|
||||
@ -39,10 +37,22 @@ export default function Home() {
|
||||
{isLoading ? (
|
||||
<></>
|
||||
) : (
|
||||
<samp className="lead">
|
||||
<em>Last song I have listened to:</em> <br />
|
||||
<b>{data?.payload.listens[0].track_metadata.track_name}</b>
|
||||
<br />- {data?.payload.listens[0].track_metadata.artist_name} <br />
|
||||
<samp className="lead flex flex-col text-center">
|
||||
<em className="break flex mx-auto items-center gap-2">
|
||||
<span>🎶</span>
|
||||
<span>{data?.['@attr']
|
||||
? "Currently listening to"
|
||||
: 'Last song'}</span>
|
||||
<span>🎶</span>
|
||||
</em>
|
||||
<b className="">
|
||||
<a href={data?.url} target="_blank">
|
||||
{data?.name}
|
||||
</a>
|
||||
</b>
|
||||
<i className=" text-sm">
|
||||
{data?.album['#text']}, {data?.artist['#text']}
|
||||
</i>
|
||||
</samp>
|
||||
)}
|
||||
</header>
|
||||
@ -53,7 +63,7 @@ export default function Home() {
|
||||
Currently studying pure mathematics at the University of Warsaw and
|
||||
doing commissions on the side. I had been considering studying
|
||||
computer science but decided not to - mathematics is the love of my
|
||||
life and an absolute passion.
|
||||
life, an absolute passion.
|
||||
</p>
|
||||
<p>
|
||||
In my free time I love listening to music - be it on headphones,
|
||||
@ -89,10 +99,10 @@ export default function Home() {
|
||||
<ul>
|
||||
<li>
|
||||
<a
|
||||
href="https://listenbrainz.org/user/yaemiku/"
|
||||
href="https://www.last.fm/user/yae_miku"
|
||||
target="_blank"
|
||||
>
|
||||
listenbrainz
|
||||
last.fm
|
||||
</a>
|
||||
</li>
|
||||
|
||||
@ -104,19 +114,19 @@ export default function Home() {
|
||||
instagram
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
{/* <li>
|
||||
<a
|
||||
href="https://stats.foldingathome.org/donor/id/711660268"
|
||||
target={'_blank'}
|
||||
>
|
||||
folding@home
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
</li> */}
|
||||
{/* <li>
|
||||
<a href="/cv/" target={'_blank'}>
|
||||
cv
|
||||
</a>
|
||||
</li>
|
||||
</li> */}
|
||||
<li>
|
||||
<a href="https://git.yaemiku.dev/yaemiku" target={'_blank'}>
|
||||
git
|
||||
@ -124,9 +134,13 @@ export default function Home() {
|
||||
</li>
|
||||
</ul>
|
||||
And if you'd want to send me any crypto
|
||||
<ul className='block list-outside'>
|
||||
<li>cosmos1gy6tg8jaf4qwmpug8jp8kqnyy9en3lmjxq0twf</li>
|
||||
<li className='break-all'>46MiubQK8psbDWys429WvTQ71DyDiLkKmSLznoDYYFQbA6MfTvuVRJzSAbCCA17n8RGjCojx5GcpKH3q1DbpKJaQPCVcabi</li>
|
||||
<ul className="block list-outside">
|
||||
<li className="break-all">
|
||||
cosmos1gy6tg8jaf4qwmpug8jp8kqnyy9en3lmjxq0twf
|
||||
</li>
|
||||
<li className="break-all">
|
||||
46MiubQK8psbDWys429WvTQ71DyDiLkKmSLznoDYYFQbA6MfTvuVRJzSAbCCA17n8RGjCojx5GcpKH3q1DbpKJaQPCVcabi
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
BIN
public/orchids.png
Normal file
After Width: | Height: | Size: 225 KiB |
BIN
public/orchids.webp
Normal file
After Width: | Height: | Size: 297 KiB |
Before Width: | Height: | Size: 90 KiB |
Before Width: | Height: | Size: 262 KiB |
BIN
public/pfp_pic.jpg
Normal file
After Width: | Height: | Size: 492 KiB |
BIN
public/pfp_pic.webp
Normal file
After Width: | Height: | Size: 451 KiB |