diff --git a/pages/index.tsx b/pages/index.tsx index 1bac773..e37bdcd 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -1,50 +1,57 @@ import Link from 'next/link' +import { useEffect, useState } from 'react' import Navbar from '../components/Navbar' -function GetTimeString() { - const hours = new Date().getHours() +const IndexPage = () => { + const [timeString, setTimeString] = useState('Morning') - if (hours < 12) { - return 'Morning' - } else if (hours >= 12 && hours <= 17) { - return 'Afternoon' - } else if (hours >= 17 && hours <= 24) { - return 'Evening' - } + useEffect(() => { + const hours = new Date().getHours() + + console.log(new Date()) + + if (hours < 12) { + setTimeString('Morning') + } else if (hours >= 12 && hours <= 17) { + setTimeString('Afternoon') + } else if (hours >= 17 && hours <= 24) { + setTimeString('Evening') + } + }) + + return ( +
+
+ + +
+
+

Good {timeString}! I'm Jack Merrill.

+
+
+

A Graphic and UI/UX Designer and Fullstack Developer from Chicago.

+
+
+ + + See my Work + + + or + + + Contact Me + + +
+
+
+
+ ) } -const IndexPage = () => ( -
-
- - -
-
-

Good {GetTimeString()}! I'm Jack Merrill.

-
-
-

A Graphic and UI/UX Designer and Fullstack Developer from Chicago.

-
-
- - - See my Work - - - or - - - Contact Me - - -
-
-
-
-) - export default IndexPage diff --git a/postcss.config.js b/postcss.config.js index 6fcf2ad..33ad091 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -1,18 +1,6 @@ module.exports = { - plugins: [ - 'tailwindcss', - process.env.NODE_ENV === 'production' - ? [ - '@fullhuman/postcss-purgecss', - { - content: [ - './pages/**/*.{js,jsx,ts,tsx}', - './components/**/*.{js,jsx,ts,tsx}', - ], - defaultExtractor: (content) => content.match(/[\w-/:]+(?