This commit is contained in:
skidoodle 2022-04-24 17:41:31 +02:00
parent 4ef7a49d93
commit 3c18df552d
13 changed files with 227 additions and 198 deletions

View file

@ -1,11 +0,0 @@
import styles from 'styles/Home.module.scss'
const Footer = () => {
return(
<div className={styles.footerLayout}>
<a href='https://cigany.ninja' target='_blank' rel='noopener noreferrer'>?</a>
</div>
)
}
export default Footer

View file

@ -17,7 +17,7 @@ const Spotify = () => {
</>
:
<>
<img src='https://i.albrt.hu/66e8e4c6.webp' width={50} height={50} alt=""/>
<img src='song_art.png' width={50} height={50} alt=""/>
<p>Not listening to anything</p>
</>
}
@ -28,4 +28,4 @@ const Spotify = () => {
)
}
export default Spotify
export default Spotify

View file

@ -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(
<div className={styles.time}>
<p><FaClock /> {date.toLocaleDateString('en-GB', { dateStyle: 'short' }) + ' • ' + date.toLocaleTimeString('en-GB', { timeStyle: 'medium', hour12: true, timeZone: 'Europe/Budapest'}).toUpperCase()}</p>
</div>
)
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 Timer
export default Time

9
components/dayjs.tsx Normal file
View file

@ -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 }