From 3c18df552da3be07e3620f5d01014bbfd818f5b9 Mon Sep 17 00:00:00 2001 From: skidoodle Date: Sun, 24 Apr 2022 17:41:31 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 5 +- components/Footer.tsx | 11 -- components/Spotify.tsx | 4 +- components/Time.tsx | 32 +++-- components/dayjs.tsx | 9 ++ next.config.js | 6 +- package.json | 1 + pages/_app.tsx | 8 +- pages/index.tsx | 32 ++--- public/song_art.png | Bin 0 -> 6000 bytes styles/Home.module.scss | 4 +- styles/_variables.scss | 2 +- yarn.lock | 311 ++++++++++++++++++++++------------------ 13 files changed, 227 insertions(+), 198 deletions(-) delete mode 100644 components/Footer.tsx create mode 100644 components/dayjs.tsx create mode 100644 public/song_art.png diff --git a/README.md b/README.md index e38cee9..fb7bbb2 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,2 @@ # portfolio-v2 -Built with Next.js ♥ - - -#### koszi [boss](https://github.com/suvikgotrekt) +Built with Next.js ♥ \ No newline at end of file diff --git a/components/Footer.tsx b/components/Footer.tsx deleted file mode 100644 index 5a548d0..0000000 --- a/components/Footer.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import styles from 'styles/Home.module.scss' - -const Footer = () => { - return( -
- ? -
- ) -} - -export default Footer \ No newline at end of file diff --git a/components/Spotify.tsx b/components/Spotify.tsx index c809518..5092d36 100644 --- a/components/Spotify.tsx +++ b/components/Spotify.tsx @@ -17,7 +17,7 @@ const Spotify = () => { : <> - +

Not listening to anything

} @@ -28,4 +28,4 @@ const Spotify = () => { ) } -export default Spotify +export default Spotify \ No newline at end of file diff --git a/components/Time.tsx b/components/Time.tsx index ec9229e..9f9b731 100644 --- a/components/Time.tsx +++ b/components/Time.tsx @@ -1,22 +1,24 @@ import { FaClock } from 'react-icons/fa'; +import { dayjs } from 'components/dayjs' import { useEffect, useState } from 'react' import styles from 'styles/Home.module.scss' -const Timer = () => { - const [date, setDate] = useState(new Date()) - - useEffect(() => { - const interval = setInterval(() => { - setDate(new Date()) - }, 1000) - return () => clearInterval(interval) - }) +const now = () => dayjs().tz() - return( -
-

{date.toLocaleDateString('en-GB', { dateStyle: 'short' }) + ' • ' + date.toLocaleTimeString('en-GB', { timeStyle: 'medium', hour12: true, timeZone: 'Europe/Budapest'}).toUpperCase()}

-
- ) +const Time = () => { + const [date, setDate] = useState(now()) + + useEffect(() => { + const timer = setInterval(() => setDate(now()), 1000) + return () => clearInterval(timer) + }, []) + + return ( +

+ + {' '}{date.format('DD/MM/YYYY • h:mm:ss A')} +

+ ) } -export default Timer \ No newline at end of file +export default Time \ No newline at end of file diff --git a/components/dayjs.tsx b/components/dayjs.tsx new file mode 100644 index 0000000..4e7f1ce --- /dev/null +++ b/components/dayjs.tsx @@ -0,0 +1,9 @@ +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 } \ No newline at end of file diff --git a/next.config.js b/next.config.js index a473d32..54e6a7d 100644 --- a/next.config.js +++ b/next.config.js @@ -5,9 +5,5 @@ module.exports = { swcMinify: false, sassOptions: { includePaths: [path.join(__dirname, 'styles')] - }, - images: { - domains: ['i.albrt.hu', 'lastfm.freetls.fastly.net'], - formats: ['image/avif', 'image/webp'] } -} +} \ No newline at end of file diff --git a/package.json b/package.json index 78b994c..bab42af 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "@swc/core": "^1.2.160", "copy-to-clipboard": "^3.3.1", "csstype": "^3.0.10", + "dayjs": "^1.11.1", "goober": "2.1.8", "next": "12.1.1", "react": "17.0.2", diff --git a/pages/_app.tsx b/pages/_app.tsx index cbf1382..8fbc0e2 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -1,8 +1,12 @@ -import type { AppProps } from 'next/app' +import { AppProps } from 'next/app' +import Head from 'next/head' import 'styles/globals.scss' const MyApp = ({ Component, pageProps }: AppProps) => { + + albert + return } -export default MyApp +export default MyApp \ No newline at end of file diff --git a/pages/index.tsx b/pages/index.tsx index 3dd0651..d50ac86 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -1,8 +1,6 @@ import { GetServerSideProps } from 'next' -import Head from 'next/head' import FadeIn from 'react-fade-in' import Body from 'components/Body' -import Footer from 'components/Footer' import Icon from 'components/Icon' import IconLayout from 'components/IconLayout' import MainLayout from 'components/MainLayout' @@ -14,29 +12,23 @@ import { RiInstagramFill } from 'react-icons/ri' import { SiDiscord } from 'react-icons/si' const Home = ({data}: any) => { - return( + return ( <> - - albert - -
-
- - } reference={'https://github.com/skidoodle'} copy={false} /> - } reference={'https://steamcommunity.com/id/_albert'} copy={false} /> - } reference={'hello@albrt.hu'} copy={true} /> - } reference={'https://instagram.com/albertadam_'} copy={false} /> - } reference={'albert#8838'} copy={true} /> - -
-
-
-
+ + + } reference={'https://github.com/skidoodle'} copy={false} /> + } reference={'https://steamcommunity.com/id/_albert'} copy={false} /> + } reference={'hello@albrt.hu'} copy={true} /> + } reference={'https://instagram.com/albertadam_'} copy={false} /> + } reference={'albert#8838'} copy={true} /> + +
-