diff --git a/app/api/lastfm/route.ts b/app/api/lastfm/route.ts new file mode 100644 index 0000000..de4908d --- /dev/null +++ b/app/api/lastfm/route.ts @@ -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]); +} diff --git a/app/favicon.ico b/app/favicon.ico deleted file mode 100644 index 718d6fe..0000000 Binary files a/app/favicon.ico and /dev/null differ diff --git a/app/globals.css b/app/globals.css index 0d11ab5..3118aeb 100644 --- a/app/globals.css +++ b/app/globals.css @@ -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 -} +} */ diff --git a/app/icon.svg b/app/icon.svg new file mode 100644 index 0000000..aa97571 --- /dev/null +++ b/app/icon.svg @@ -0,0 +1,3 @@ + + 🌺 + \ No newline at end of file diff --git a/app/layout.tsx b/app/layout.tsx index d5f1571..890c71d 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -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 ( - - {children} + + + {children} + ); } diff --git a/app/page.tsx b/app/page.tsx index c659d15..f55af18 100644 --- a/app/page.tsx +++ b/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 = (...args) => +const fetcher: Fetcher = (...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 ( -
-
+
+
My Picture ) : ( - - Last song I have listened to:
- {data?.payload.listens[0].track_metadata.track_name} -
- {data?.payload.listens[0].track_metadata.artist_name}
+ + + 🎶 + {data?.['@attr'] + ? "Currently listening to" + : 'Last song'} + 🎶 + + + + {data?.name} + + + + {data?.album['#text']}, {data?.artist['#text']} + )}
@@ -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.

In my free time I love listening to music - be it on headphones, @@ -89,10 +99,10 @@ export default function Home() {

And if you'd want to send me any crypto -
    -
  • cosmos1gy6tg8jaf4qwmpug8jp8kqnyy9en3lmjxq0twf
  • -
  • 46MiubQK8psbDWys429WvTQ71DyDiLkKmSLznoDYYFQbA6MfTvuVRJzSAbCCA17n8RGjCojx5GcpKH3q1DbpKJaQPCVcabi
  • +
      +
    • + cosmos1gy6tg8jaf4qwmpug8jp8kqnyy9en3lmjxq0twf +
    • +
    • + 46MiubQK8psbDWys429WvTQ71DyDiLkKmSLznoDYYFQbA6MfTvuVRJzSAbCCA17n8RGjCojx5GcpKH3q1DbpKJaQPCVcabi +
diff --git a/public/orchids.png b/public/orchids.png new file mode 100644 index 0000000..c069426 Binary files /dev/null and b/public/orchids.png differ diff --git a/public/orchids.webp b/public/orchids.webp new file mode 100644 index 0000000..ce33640 Binary files /dev/null and b/public/orchids.webp differ diff --git a/public/pfp_fb_cropped.jpg b/public/pfp_fb_cropped.jpg deleted file mode 100644 index 4da92d5..0000000 Binary files a/public/pfp_fb_cropped.jpg and /dev/null differ diff --git a/public/pfp_formal_comp.jpg b/public/pfp_formal_comp.jpg deleted file mode 100644 index a7914a0..0000000 Binary files a/public/pfp_formal_comp.jpg and /dev/null differ diff --git a/public/pfp_pic.jpg b/public/pfp_pic.jpg new file mode 100644 index 0000000..54125be Binary files /dev/null and b/public/pfp_pic.jpg differ diff --git a/public/pfp_pic.webp b/public/pfp_pic.webp new file mode 100644 index 0000000..5373c6c Binary files /dev/null and b/public/pfp_pic.webp differ