mirror of
https://github.com/skidoodle/albert.lol.git
synced 2025-02-15 06:09:15 +01:00
🔥
This commit is contained in:
parent
4ef7a49d93
commit
3c18df552d
13 changed files with 227 additions and 198 deletions
|
@ -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
|
|
@ -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
|
|
@ -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
9
components/dayjs.tsx
Normal 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 }
|
Loading…
Add table
Add a link
Reference in a new issue