Prettier and a new readme

This commit is contained in:
skidoodle 2022-08-26 21:27:32 +02:00
parent 146b35d1d3
commit f21d8f8086
16 changed files with 352 additions and 2594 deletions

View file

@ -1,2 +1,29 @@
# albert.lol
Built with Next.js ♥
# Portfolio v3
An awesome portfolio built with [Next.js](https://nextjs.org/) and [Tailwind CSS](https://tailwindcss.com/)
## Installation
Clone the repository
```
git clone https://github.com/skidoodle/albert.lol
```
Install the dependencies with [yarn](https://yarnpkg.com/)
```
yarn
```
## Usage
```
yarn dev
```
Go to `localhost:3000` :)
## License
[MIT](https://choosealicense.com/licenses/mit/)

View file

@ -1,32 +1,43 @@
import Link from 'next/link'
import toast from 'react-hot-toast'
import copy from 'copy-to-clipboard'
import Link from "next/link";
import toast from "react-hot-toast";
import copy from "copy-to-clipboard";
type Icon = {
children: any,
reference: string,
copyValue?: boolean,
}
children: any;
reference: string;
copyValue?: boolean;
};
const notify = () => {
toast.remove(),
toast.success('Copied to clipboard', {
toast.success("Copied to clipboard", {
style: {
background: '#0f1012',
color: '#fff',
fontSize: '1em'
}
}
)}
background: "#0f1012",
color: "#fff",
fontSize: "1em",
},
});
};
export const Icon = ({ children, reference, copyValue }: Icon) => {
if (copyValue) {
return <a className={`cursor-pointer`} onClick={ () => { notify(), copy(reference) }} >{ children }</a>
return (
<a
className={`cursor-pointer`}
onClick={() => {
notify(), copy(reference);
}}
>
{children}
</a>
);
}
return (
<Link href={reference}>
<a target='_blank' className={`cursor-pointer`}>{ children }</a>
<a target="_blank" className={`cursor-pointer`}>
{children}
</a>
</Link>
)
}
);
};

View file

@ -1,39 +1,45 @@
import { IconType } from 'react-icons/lib'
import { FaDiscord, FaEnvelope, FaGithub, FaInstagram, FaSteam } from 'react-icons/fa'
import { IconType } from "react-icons/lib";
import {
FaDiscord,
FaEnvelope,
FaGithub,
FaInstagram,
FaSteam,
} from "react-icons/fa";
type Socials = {
id: number,
ref: string
icon: IconType,
copyValue?: boolean,
}
id: number;
ref: string;
icon: IconType;
copyValue?: boolean;
};
export const socials: Array<Socials> = [
{
id: 1,
ref: 'https://github.com/skidoodle',
ref: "https://github.com/skidoodle",
icon: FaGithub,
},
{
id: 2,
ref: 'https://steamcommunity.com/id/_albert',
ref: "https://steamcommunity.com/id/_albert",
icon: FaSteam,
},
{
id: 3,
ref: 'contact@albert.lol',
ref: "contact@albert.lol",
icon: FaEnvelope,
copyValue: true,
},
{
id: 4,
ref: 'https://www.instagram.com/albertadam_/',
ref: "https://www.instagram.com/albertadam_/",
icon: FaInstagram,
},
{
id: 5,
ref: 'albert#8838',
ref: "albert#8838",
icon: FaDiscord,
copyValue: true,
}
]
},
];

View file

@ -1,7 +1,7 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
swcMinify: true
}
swcMinify: true,
};
module.exports = nextConfig
module.exports = nextConfig;

2308
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
{
"name": "portfolio",
"version": "2.0",
"version": "3.0",
"private": true,
"scripts": {
"dev": "next dev",

View file

@ -1,7 +1,7 @@
import 'styles/globals.scss'
import Head from 'next/head'
import "styles/globals.scss";
import Head from "next/head";
import { AppProps } from 'next/app'
import { AppProps } from "next/app";
export default function ({ Component, pageProps }: AppProps) {
return (
@ -11,5 +11,5 @@ export default function({ Component, pageProps }: AppProps) {
</Head>
<Component {...pageProps} />
</>
)
);
}

View file

@ -1,25 +1,25 @@
import Document, { Html, Head, Main, NextScript } from 'next/document'
import Document, { Html, Head, Main, NextScript } from "next/document";
class AppDocument extends Document {
render() {
return (
<Html lang='en'>
<Html lang="en">
<Head>
<link rel='preconnect' href='https://vitals.vercel-insights.com' />
<meta name='title' content='albert' />
<meta name='og:title' content='albert' />
<meta name='description' content='system administrator' />
<meta name='og:description' content='system administrator' />
<meta name='theme-color' content='#000000' />
<meta property='og:image' content='/favicon.ico' />
<link rel="preconnect" href="https://vitals.vercel-insights.com" />
<meta name="title" content="albert" />
<meta name="og:title" content="albert" />
<meta name="description" content="system administrator" />
<meta name="og:description" content="system administrator" />
<meta name="theme-color" content="#000000" />
<meta property="og:image" content="/favicon.ico" />
</Head>
<body>
<Main />
<NextScript />
</body>
</Html>
)
);
}
}
export default AppDocument
export default AppDocument;

View file

@ -1,41 +1,43 @@
import { GetServerSideProps } from 'next'
import FadeIn from 'react-fade-in'
import { GetServerSideProps } from "next";
import FadeIn from "react-fade-in";
type ErrorPage = {
statusCode: number,
message: string
}
statusCode: number;
message: string;
};
export default function ({ statusCode, message }: ErrorPage) {
return (
<FadeIn>
<div className='flex flex-col justify-center items-center h-[90vh]'>
<div className="flex flex-col justify-center items-center h-[90vh]">
<div>
<h1 className='font-semibold text-2xl inline-block mr-[1.7rem] pr-[1.5rem] border-r-[1px] border-white'>{ statusCode }</h1>
<div className='inline-block text-left'>
<h2 className='text-lg font-extralight'>{ message }</h2>
<h1 className="font-semibold text-2xl inline-block mr-[1.7rem] pr-[1.5rem] border-r-[1px] border-white">
{statusCode}
</h1>
<div className="inline-block text-left">
<h2 className="text-lg font-extralight">{message}</h2>
</div>
</div>
</div>
</FadeIn>
)
);
}
export const getServerSideProps: GetServerSideProps = async (props) => {
const { res, err }: any = props
const { res, err }: any = props;
const statusCode = res ? res.statusCode : err ? err.statusCode : 404
const statusCode = res ? res.statusCode : err ? err.statusCode : 404;
let entries: any = {
404: 'Az oldal nem található',
400: 'Érvénytelen kérelem',
500: 'Szerveroldali hiba'
}
const message = entries[statusCode]
404: "Az oldal nem található",
400: "Érvénytelen kérelem",
500: "Szerveroldali hiba",
};
const message = entries[statusCode];
return {
props: {
statusCode,
message
}
}
}
message,
},
};
};

View file

@ -1,44 +1,47 @@
import { NextApiRequest, NextApiResponse } from 'next'
import { NextApiRequest, NextApiResponse } from "next";
import aws from 'aws-sdk'
import aws from "aws-sdk";
const { BUCKET, ACCESS_KEY, SECRET_KEY, ENDPOINT, REGION } = process.env
const { BUCKET, ACCESS_KEY, SECRET_KEY, ENDPOINT, REGION } = process.env;
export default async function (req: NextApiRequest, res: NextApiResponse) {
aws.config.s3 = ({
aws.config.s3 = {
accessKeyId: ACCESS_KEY,
secretAccessKey: SECRET_KEY,
region: REGION,
endpoint: ENDPOINT,
signatureVersion: 'v4'
})
signatureVersion: "v4",
};
let isTruncated: boolean | undefined = true
let startAfter
let isTruncated: boolean | undefined = true;
let startAfter;
let objects = 0
let size = 0
let objects = 0;
let size = 0;
const s3 = new aws.S3()
const s3 = new aws.S3();
while (isTruncated) {
let params: any = { Bucket: BUCKET }
let params: any = { Bucket: BUCKET };
if (startAfter) {
params.StartAfter = startAfter
params.StartAfter = startAfter;
}
const data = await s3.listObjectsV2(params).promise()
const data = await s3.listObjectsV2(params).promise();
data.Contents?.forEach((object: any) => {
objects++
size += object.Size! / 1024 / 1024 / 1024
})
objects++;
size += object.Size! / 1024 / 1024 / 1024;
});
isTruncated = data.IsTruncated
isTruncated = data.IsTruncated;
if (isTruncated) {
startAfter = data.Contents!.slice(-1)[0].Key;
}
}
res.setHeader('Cache-Control', 'public, s-maxage=10, stale-while-revalidate=59');
res.json({ object: objects, size: Number(size.toFixed(2)) })
res.setHeader(
"Cache-Control",
"public, s-maxage=10, stale-while-revalidate=59"
);
res.json({ object: objects, size: Number(size.toFixed(2)) });
}

View file

@ -1,26 +1,28 @@
import { NextApiRequest, NextApiResponse } from 'next'
import { NextApiRequest, NextApiResponse } from "next";
export default async function (req: NextApiRequest, res: NextApiResponse) {
const { LASTFM_USERNAME, LASTFM_API } = process.env
const { LASTFM_USERNAME, LASTFM_API } = process.env;
const { recenttracks: response } = await fetch(`https://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=${LASTFM_USERNAME}&api_key=${LASTFM_API}&format=json&limit=1`).then((res) => res.json())
const { recenttracks: response } = await fetch(
`https://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=${LASTFM_USERNAME}&api_key=${LASTFM_API}&format=json&limit=1`
).then((res) => res.json());
const { track } = response
const { artist, name, url, image } = track[0]
const { track } = response;
const { artist, name, url, image } = track[0];
let nowplaying = Boolean(track[0]['@attr']?.nowplaying)
let nowplaying = Boolean(track[0]["@attr"]?.nowplaying);
if (nowplaying) {
return res.status(200).json({
nowplaying,
song: {
artist: artist['#text'],
artist: artist["#text"],
title: name,
url: url,
image: image[2]['#text'],
}
})
image: image[2]["#text"],
},
});
}
return res.status(200).json({ nowplaying })
return res.status(200).json({ nowplaying });
}

View file

@ -1,54 +1,69 @@
import Image from 'next/image'
import Link from 'next/link'
import React from 'react'
import useSWR from 'swr'
import FadeIn from 'react-fade-in'
import Image from "next/image";
import Link from "next/link";
import React from "react";
import useSWR from "swr";
import FadeIn from "react-fade-in";
import { socials } from 'components/data/socials'
import { Icon } from 'components/Icon'
import { Toaster } from 'react-hot-toast'
import { FaSpotify } from 'react-icons/fa'
import { socials } from "components/data/socials";
import { Icon } from "components/Icon";
import { Toaster } from "react-hot-toast";
import { FaSpotify } from "react-icons/fa";
import profilePic from '../public/profile.webp'
import profilePic from "../public/profile.webp";
const fetcher = (url: RequestInfo) => fetch(url).then(r => r.json())
const fetcher = (url: RequestInfo) => fetch(url).then((r) => r.json());
export default function () {
const { data: spotify } = useSWR('/api/spotify', fetcher, { refreshInterval: 1000 })
if(!spotify) return
const { data: spotify } = useSWR("/api/spotify", fetcher, {
refreshInterval: 1000,
});
if (!spotify) return;
return (
<FadeIn>
<div className='px-8 w-11/12 m-auto rounded-lg max-w-4xl'>
<div className='flex flex-col justify-center items-center mt-40 md:mt-48 lg:mt-64'>
<Image src={profilePic} alt='Profile Picture' className="rounded-full text-center" height={150} width={150}/>
<div className="px-8 w-11/12 m-auto rounded-lg max-w-4xl">
<div className="flex flex-col justify-center items-center mt-40 md:mt-48 lg:mt-64">
<Image
src={profilePic}
alt="Profile Picture"
className="rounded-full text-center"
height={150}
width={150}
/>
<h1 className='text-4xl font-bold mt-1'>albert</h1>
<h1 className="text-4xl font-bold mt-1">albert</h1>
<p className='text-[#9ca3af] text-xl flex flex-wrap items-center justify-center whitespace-pre-wrap'>
{ Math.floor((new Date().getTime() - new Date('2004-07-22').getTime()) / (1000 * 60 * 60 * 24 * 365.25)) }
yrs old <b className='font-semibold'>system administrator</b> and student from Hungary
<p className="text-[#9ca3af] text-xl flex flex-wrap items-center justify-center whitespace-pre-wrap">
{Math.floor(
(new Date().getTime() - new Date("2004-07-22").getTime()) /
(1000 * 60 * 60 * 24 * 365.25)
)}
yrs old <b className="font-semibold">system administrator</b> and
student from Hungary
</p>
</div>
<hr className='border-t-[#727277] w-4/5 md:w-2/5 m-auto mt-5 md:mt-8'/>
<hr className="border-t-[#727277] w-4/5 md:w-2/5 m-auto mt-5 md:mt-8" />
<div className='mt-3 flex justify-center items-center'>
<FaSpotify className='text-[#32a866]' />&nbsp;
<p className='font-semibold'>Listening to
{
spotify.song
? <Link href={`${spotify.song.url}`}>
<a target='_blank' className='text-[#32a866]'> { spotify.song.title || 'nothing' }</a>
<div className="mt-3 flex justify-center items-center">
<FaSpotify className="text-[#32a866]" />
&nbsp;
<p className="font-semibold">
Listening to
{spotify.song ? (
<Link href={`${spotify.song.url}`}>
<a target="_blank" className="text-[#32a866]">
{" "}
{spotify.song.title || "nothing"}
</a>
</Link>
: <a className='text-[#32a866]'> nothing</a>
}
) : (
<a className="text-[#32a866]"> nothing</a>
)}
</p>
</div>
<div className='flex justify-between items-center text-3xl mt-11 md:mt-16 max-w-sm m-auto'>
{ socials.map(social => (
<div className="flex justify-between items-center text-3xl mt-11 md:mt-16 max-w-sm m-auto">
{socials.map((social) => (
<Icon
key={social.id}
reference={social.ref}
@ -62,5 +77,5 @@ export default function() {
<Toaster />
</FadeIn>
)
);
}

View file

@ -1,11 +1,11 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./pages/**/*.{js,ts,jsx,tsx}',
'./components/**/*.{js,ts,jsx,tsx}'
"./pages/**/*.{js,ts,jsx,tsx}",
"./components/**/*.{js,ts,jsx,tsx}",
],
theme: {
extend: {},
},
plugins: [],
}
};

View file

@ -181,9 +181,9 @@ available-typed-arrays@^1.0.5:
integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==
aws-sdk@^2.1194.0:
version "2.1194.0"
resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.1194.0.tgz#6a820684fa3f58ea40caf90d302414a23df7c308"
integrity sha512-wbgib7r7sHPkZIhqSMduueKYqe+DrFyxsKnUKHj6hdNcRKqEeqzvKp4olWmFs/3z3qU8+g78kBXr9rujvko1ug==
version "2.1204.0"
resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.1204.0.tgz#6e0c5d0b4b50ff122b66772bb0ab5453009e6106"
integrity sha512-H3dRQBdgzAfZ/e/dfiW44fhQrgAuCfIzWhI5y5J9122caI4uZY6TEUd003UXP4nXq2eMfuPWg0bA/mPwbj8RkA==
dependencies:
buffer "4.9.2"
events "1.1.1"
@ -246,9 +246,9 @@ camelcase-css@^2.0.1:
integrity sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==
caniuse-lite@^1.0.30001332, caniuse-lite@^1.0.30001370, caniuse-lite@^1.0.30001373:
version "1.0.30001376"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001376.tgz#af2450833e5a06873fbb030a9556ca9461a2736d"
integrity sha512-I27WhtOQ3X3v3it9gNs/oTpoE5KpwmqKR5oKPA8M0G7uMXh9Ty81Q904HpKUrM30ei7zfcL5jE7AXefgbOfMig==
version "1.0.30001383"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001383.tgz#aecf317ccd940690725ae3ae4f28293c5fb8050e"
integrity sha512-swMpEoTp5vDoGBZsYZX7L7nXHe6dsHxi9o6/LKf/f0LukVtnrxly5GVb/fWdCDTqi/yw6Km6tiJ0pmBacm0gbg==
"chokidar@>=3.0.0 <4.0.0", chokidar@^3.5.3:
version "3.5.3"
@ -320,9 +320,9 @@ dlv@^1.1.3:
integrity sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==
electron-to-chromium@^1.4.202:
version "1.4.219"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.219.tgz#a7a672304b6aa4f376918d3f63a47f2c3906009a"
integrity sha512-zoQJsXOUw0ZA0YxbjkmzBumAJRtr6je5JySuL/bAoFs0DuLiLJ+5FzRF7/ZayihxR2QcewlRZVm5QZdUhwjOgA==
version "1.4.232"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.232.tgz#67a0a874b0057662244230d18d3a9847c135a9d9"
integrity sha512-nd+FW8xHjM+PxNWG44nKnwHaBDdVpJUZuI2sS2JJPt/QpdombnmoCRWEEQNnzaktdIQhsNWdD+dlqxwO8Bn99g==
es-abstract@^1.19.0, es-abstract@^1.19.5, es-abstract@^1.20.0:
version "1.20.1"
@ -466,9 +466,9 @@ glob-parent@^6.0.2:
is-glob "^4.0.3"
goober@^2.1.10:
version "2.1.10"
resolved "https://registry.yarnpkg.com/goober/-/goober-2.1.10.tgz#058def43ba1e3b06f973dbb372a4978aa42f1049"
integrity sha512-7PpuQMH10jaTWm33sQgBQvz45pHR8N4l3Cu3WMGEWmHShAcTuuP7I+5/DwKo39fwti5A80WAjvqgz6SSlgWmGA==
version "2.1.11"
resolved "https://registry.yarnpkg.com/goober/-/goober-2.1.11.tgz#bbd71f90d2df725397340f808dbe7acc3118e610"
integrity sha512-5SS2lmxbhqH0u9ABEWq7WPU69a4i2pYcHeCxqaNq6Cw3mnrF0ghWNM4tEGid4dKy8XNIAUbuThuozDHHKJVh3A==
has-bigints@^1.0.1, has-bigints@^1.0.2:
version "1.0.2"
@ -769,9 +769,9 @@ object-keys@^1.1.1:
integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==
object.assign@^4.1.2:
version "4.1.3"
resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.3.tgz#d36b7700ddf0019abb6b1df1bb13f6445f79051f"
integrity sha512-ZFJnX3zltyjcYJL0RoCJuzb+11zWGyaDbjgxZbdV7rFEcHQuYxrZqhow67aA7xpes6LhojyFDaBKAFfogQrikA==
version "4.1.4"
resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.4.tgz#9673c7c7c351ab8c4d0b516f4343ebf4dfb7799f"
integrity sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==
dependencies:
call-bind "^1.0.2"
define-properties "^1.1.4"
@ -962,9 +962,9 @@ safe-buffer@^5.1.2:
integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==
sass@^1.54.4:
version "1.54.4"
resolved "https://registry.yarnpkg.com/sass/-/sass-1.54.4.tgz#803ff2fef5525f1dd01670c3915b4b68b6cba72d"
integrity sha512-3tmF16yvnBwtlPrNBHw/H907j8MlOX8aTBnlNX1yrKx24RKcJGPyLhFUwkoKBKesR3unP93/2z14Ll8NicwQUA==
version "1.54.5"
resolved "https://registry.yarnpkg.com/sass/-/sass-1.54.5.tgz#93708f5560784f6ff2eab8542ade021a4a947b3a"
integrity sha512-p7DTOzxkUPa/63FU0R3KApkRHwcVZYC0PLnLm5iyZACyp15qSi32x7zVUhRdABAATmkALqgGrjCJAcWvobmhHw==
dependencies:
chokidar ">=3.0.0 <4.0.0"
immutable "^4.0.0"