This commit is contained in:
skidoodle 2022-08-14 19:59:03 +02:00
parent 3a92d65900
commit 7dedfba1f9
31 changed files with 2971 additions and 1859 deletions

View file

@ -1,11 +0,0 @@
import styles from 'styles/Home.module.scss'
const Body = ({children}: {children: any}) => {
return(
<div className={styles.bodySection}>
{children}
</div>
)
}
export default Body

View file

@ -1,35 +1,32 @@
import toast, { Toaster } from 'react-hot-toast';
import Link from 'next/link'
import toast from 'react-hot-toast'
import copy from 'copy-to-clipboard'
const Icon = ({icon, reference, copy = false} : {icon: any, reference: any, copy?: boolean}) => {
return(
<>
{
copy ? (
<a href='javascript:void(0)' onClick={() => doThings(reference)}>
{icon}
</a>
) : (
<a href={reference} target='_blank' rel='noopener noreferrer' aria-label="Icon">
{icon}
</a>
)
}
<Toaster position='bottom-center' reverseOrder={false} />
</>
)
type Icon = {
children: any,
reference: string,
copyValue?: boolean,
}
const doThings = (value: any) => {
copy(value)
toast.remove()
const notify = () => {
toast.remove(),
toast.success('Copied to clipboard', {
style: {
background: '#111',
background: '#0f1012',
color: '#fff',
fontSize: '1em'
}
})
}
}
)}
export default Icon
export const Icon = ({ children, reference, copyValue }: Icon) => {
if(copyValue) {
return <a className={`cursor-pointer`} onClick={ () => { notify(), copy(reference) }} >{ children }</a>
}
return (
<Link href={ reference }>
<a target='_blank' className={`cursor-pointer`}>{ children }</a>
</Link>
)
}

View file

@ -1,13 +0,0 @@
import styles from 'styles/Home.module.scss'
const IconLayout = ({children}: {children: any}) => {
return(
<>
<div className={styles.iconLayout}>
{children}
</div>
</>
)
}
export default IconLayout

View file

@ -1,14 +0,0 @@
import styles from 'styles/Home.module.scss'
const MainLayout = () => {
return(
<>
<div className={styles.mainLayout}>
<h1>albert</h1>
<p>18-year-old <b>system administrator</b> and student from Hungary</p>
</div>
</>
)
}
export default MainLayout

View file

@ -1,31 +0,0 @@
import { useLastFM } from 'use-last-fm'
import { FaSpotify } from 'react-icons/fa'
import styles from 'styles/Home.module.scss'
const Spotify = () => {
const lastFM = useLastFM('albrtadam', 'f6d19bc25ca340225c70c3d386cd4eab');
return(
<div className={styles.spotify}>
{lastFM.status === 'playing'
?
<>
<a href={lastFM.song.url} target='_blank' rel='noopener noreferrer'>
<img src={lastFM.song.art} width={50} height={50} alt=""/>
<p>Listening to <b>{lastFM.song.name}</b></p>
</a>
</>
:
<>
<img src='song_art.png' width={50} height={50} alt=""/>
<p>Not listening to anything</p>
</>
}
<div className={styles.tinyText}>
<FaSpotify /> Spotify
</div>
</div>
)
}
export default Spotify

View file

@ -1,26 +0,0 @@
import { FaClock } from 'react-icons/fa';
import { dayjs } from 'components/dayjs'
import { useEffect, useState } from 'react'
import styles from 'styles/Home.module.scss'
const now = () => dayjs().tz()
const format = 'hhA'
const Time = () => {
const [date, setDate] = useState(now())
useEffect(() => {
const timer = setInterval(() => setDate(now()), 1000)
return () => clearInterval(timer)
}, [])
return (
<p className={styles.time}>
<FaClock />
{' '}{date.format('DD/MM/YYYY • h:mm:ss A')}
</p>
)
}
export default Time

View file

@ -1,28 +0,0 @@
import styles from 'styles/Home.module.scss'
import { FaSun, FaMoon, FaCloudSun, FaCloudMoon, FaCloud, FaCloudShowersHeavy } from 'react-icons/fa'
import { BsCloudDrizzleFill, BsCloudsFill, BsCloudLightningFill, BsCloudSnowFill, BsCloudFogFill } from 'react-icons/bs'
const Weather = ({data}: {data: any}) => {
const { temp: temperature } = data.main
const { icon: weatherIcon, description: weatherDescription} = data.weather[0]
const icons: any = {
_01d: <FaSun />, _01n: <FaMoon />,
_02d: <FaCloudSun />, _02n: <FaCloudMoon />,
_03d: <FaCloud />, _03n: <FaCloud />,
_04d: <BsCloudsFill />, _04n: <BsCloudsFill />,
_09d: <BsCloudDrizzleFill />, _09n: <BsCloudDrizzleFill />,
_10d: <FaCloudShowersHeavy />, _10n: <FaCloudShowersHeavy />,
_11d: <BsCloudLightningFill />, _11n: <BsCloudLightningFill />,
_13d: <BsCloudSnowFill />, _13n: <BsCloudSnowFill />,
_50d: <BsCloudFogFill />, _50n: <BsCloudFogFill />
}
return (
<div className={styles.weather}>
{icons[`_${weatherIcon}`]} <p>It&apos;s currently <b>{parseInt(temperature)} °C</b> <span>({weatherDescription})</span> in <a href='https://weather.com/en-GB/weather/today/l/b979f874d2f515646f37e2bb434a85cc04869c5a35c6bdf1c6fba26f659313f0' target="_blank" rel='noopener noreferrer'><b>Budapest</b></a></p>
</div>
)
}
export default Weather

View file

@ -0,0 +1,39 @@
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,
}
export const socials: Array<Socials> = [
{
id: 1,
ref: 'https://github.com/skidoodle',
icon: FaGithub,
},
{
id: 2,
ref: 'https://steamcommunity.com/id/_albert',
icon: FaSteam,
},
{
id: 3,
ref: 'contact@albert.lol',
icon: FaEnvelope,
copyValue: true,
},
{
id: 4,
ref: 'https://www.instagram.com/albertadam_/',
icon: FaInstagram,
},
{
id: 5,
ref: 'albert#8838',
icon: FaDiscord,
copyValue: true,
}
]

View file

@ -1,9 +0,0 @@
import dayjs from 'dayjs'
import utc from 'dayjs/plugin/utc'
import timezone from 'dayjs/plugin/timezone'
dayjs.extend(utc)
dayjs.extend(timezone)
dayjs.tz.setDefault('Europe/Budapest')
export { dayjs }