diff --git a/src/pages/index.js b/src/pages/index.js index 45d2bfb..5bd24ed 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -1,113 +1,54 @@ -import Image from "next/image"; -import { Geist, Geist_Mono } from "next/font/google"; +import { useEffect, useState } from "react"; -const geistSans = Geist({ - variable: "--font-geist-sans", - subsets: ["latin"], -}); - -const geistMono = Geist_Mono({ - variable: "--font-geist-mono", - subsets: ["latin"], -}); export default function Home() { + const dateShowOptions = { + weekday: "long", + year: "numeric", + month: "long", + day: "numeric", + }; + const [time, setTime] = useState(new Date()) + useEffect(() => { + const interval = setInterval(()=> { + setTime(new Date()); + + } ,1000) + + return () => clearInterval(interval) + },[]); + return ( -
-
- Next.js logo -
    -
  1. - Get started by editing{" "} - - src/pages/index.js - - . -
  2. -
  3. - Save and see your changes instantly. -
  4. -
-
- - Vercel logomark - Deploy now - - - Read our docs - +
+
+

{time.toLocaleTimeString()}

+

{time.toLocaleDateString("de-DE", dateShowOptions)}

+
-
-
); } +//

Today - {getStringDay(time.getDay())}

+function getStringDay(day ) { + if (day == 0) { + return "Monday" + } + if (day == 1) { + return "Tuesday" + } + if (day == 2) { + return "Wednesday" + } + if (day == 3) { + return "Thursday" + } + if (day == 4) { + return "Friday" + } + if (day == 5) { + return "Saturday" + } + if (day == 6) { + return "Sunday" + } +} diff --git a/src/styles/globals.css b/src/styles/globals.css index a2dc41e..ca3207c 100644 --- a/src/styles/globals.css +++ b/src/styles/globals.css @@ -5,22 +5,27 @@ --foreground: #171717; } -@theme inline { - --color-background: var(--background); - --color-foreground: var(--foreground); - --font-sans: var(--font-geist-sans); - --font-mono: var(--font-geist-mono); -} - -@media (prefers-color-scheme: dark) { - :root { - --background: #0a0a0a; - --foreground: #ededed; - } -} body { - background: var(--background); - color: var(--foreground); + background: var(--foreground); + color: var(--background); font-family: Arial, Helvetica, sans-serif; } + + +.main-wrap { + display: flex; + justify-content: center; + align-items: center; + width: 480px; + height: 320px; +} + +.time-label-big { + font-size: 100px; + line-height: 1; +} +.time-label-small { + text-align: center; + font-size: 23px; +}