import React, { useEffect } from 'react'
// Default values for components
const DEFAULTS = {
  timer: 2 * Math.PI,
}
export function Timer({ initial }: {
  initial?: number,
}) {
  initial ??= DEFAULTS.timer
  const [seconds, setSeconds] = React.useState(initial)
  const tick = () => setSeconds(seconds + 1)
  useEffect(() => {
    setTimeout(tick, 1000)
  }, [seconds])
  return <div>
    <h1 className='text-xl font-medium'>{seconds}</h1>
  </div>
}

Autumn Light

by kdrag0n2

updated 2 years ago

0

Settings

Light mode

Colorful UI and background

Less colors

Uses contrast to separate code