|
1 |
| -import Head from 'next/head' |
2 |
| -import Image from 'next/image' |
3 |
| -import { Inter } from 'next/font/google' |
4 |
| -import styles from '@/styles/Home.module.css' |
| 1 | +import Head from "next/head"; |
| 2 | +import { useRouter } from "next/router"; |
| 3 | + |
| 4 | +/** |
| 5 | + Calculates the time difference between the server time and client time. |
| 6 | + @param {Date} serverTime - The server time. |
| 7 | + @param {Date} clientTime - The client time. |
| 8 | + @returns {string} The time difference in the format "{days} days, {hours} hours, {minutes} minutes, {seconds} seconds". |
| 9 | +*/ |
| 10 | +const calculateTimeDifference = (server: Date, client: Date) => {}; |
5 | 11 |
|
6 |
| -const inter = Inter({ subsets: ['latin'] }) |
7 | 12 |
|
8 | 13 | export default function Home() {
|
| 14 | + const router = useRouter(); |
| 15 | + const moveToTaskManager = () => { |
| 16 | + router.push("/tasks"); |
| 17 | + } |
9 | 18 | return (
|
10 | 19 | <>
|
11 | 20 | <Head>
|
12 |
| - <title>Create Next App</title> |
13 |
| - <meta name="description" content="Generated by create next app" /> |
| 21 | + <title>Web 2 - Exam TD</title> |
| 22 | + <meta name="description" content="Just an exam" /> |
14 | 23 | <meta name="viewport" content="width=device-width, initial-scale=1" />
|
15 | 24 | <link rel="icon" href="/favicon.ico" />
|
16 | 25 | </Head>
|
17 |
| - <main className={`${styles.main} ${inter.className}`}> |
18 |
| - <div className={styles.description}> |
| 26 | + <main> |
| 27 | + <h1>The easiest exam you will ever find</h1> |
| 28 | + <div> |
| 29 | + {/* Display here the server time (DD-MM-AAAA HH:mm)*/} |
19 | 30 | <p>
|
20 |
| - Get started by editing |
21 |
| - <code className={styles.code}>src/pages/index.tsx</code> |
| 31 | + Server time:{" "} |
| 32 | + <span className="serverTime">{/* Replace with the value */}</span> |
22 | 33 | </p>
|
23 |
| - <div> |
24 |
| - <a |
25 |
| - href="https://vercel.com?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app" |
26 |
| - target="_blank" |
27 |
| - rel="noopener noreferrer" |
28 |
| - > |
29 |
| - By{' '} |
30 |
| - <Image |
31 |
| - src="/vercel.svg" |
32 |
| - alt="Vercel Logo" |
33 |
| - className={styles.vercelLogo} |
34 |
| - width={100} |
35 |
| - height={24} |
36 |
| - priority |
37 |
| - /> |
38 |
| - </a> |
39 |
| - </div> |
40 |
| - </div> |
41 | 34 |
|
42 |
| - <div className={styles.center}> |
43 |
| - <Image |
44 |
| - className={styles.logo} |
45 |
| - src="/next.svg" |
46 |
| - alt="Next.js Logo" |
47 |
| - width={180} |
48 |
| - height={37} |
49 |
| - priority |
50 |
| - /> |
| 35 | + {/* Display here the time difference between the server side and the client side */} |
| 36 | + <p> |
| 37 | + Time diff:{" "} |
| 38 | + <span className="serverTime">{/* Replace with the value */}</span> |
| 39 | + </p> |
51 | 40 | </div>
|
52 | 41 |
|
53 |
| - <div className={styles.grid}> |
54 |
| - <a |
55 |
| - href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app" |
56 |
| - className={styles.card} |
57 |
| - target="_blank" |
58 |
| - rel="noopener noreferrer" |
59 |
| - > |
60 |
| - <h2> |
61 |
| - Docs <span>-></span> |
62 |
| - </h2> |
63 |
| - <p> |
64 |
| - Find in-depth information about Next.js features and API. |
65 |
| - </p> |
66 |
| - </a> |
67 |
| - |
68 |
| - <a |
69 |
| - href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app" |
70 |
| - className={styles.card} |
71 |
| - target="_blank" |
72 |
| - rel="noopener noreferrer" |
73 |
| - > |
74 |
| - <h2> |
75 |
| - Learn <span>-></span> |
76 |
| - </h2> |
77 |
| - <p> |
78 |
| - Learn about Next.js in an interactive course with quizzes! |
79 |
| - </p> |
80 |
| - </a> |
81 |
| - |
82 |
| - <a |
83 |
| - href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app" |
84 |
| - className={styles.card} |
85 |
| - target="_blank" |
86 |
| - rel="noopener noreferrer" |
87 |
| - > |
88 |
| - <h2> |
89 |
| - Templates <span>-></span> |
90 |
| - </h2> |
91 |
| - <p> |
92 |
| - Discover and deploy boilerplate example Next.js projects. |
93 |
| - </p> |
94 |
| - </a> |
95 |
| - |
96 |
| - <a |
97 |
| - href="https://vercel.com/new?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app" |
98 |
| - className={styles.card} |
99 |
| - target="_blank" |
100 |
| - rel="noopener noreferrer" |
101 |
| - > |
102 |
| - <h2> |
103 |
| - Deploy <span>-></span> |
104 |
| - </h2> |
105 |
| - <p> |
106 |
| - Instantly deploy your Next.js site to a shareable URL |
107 |
| - with Vercel. |
108 |
| - </p> |
109 |
| - </a> |
| 42 | + <div> |
| 43 | + <button onClick={moveToTaskManager}>Go to task manager</button> |
110 | 44 | </div>
|
111 | 45 | </main>
|
112 | 46 | </>
|
113 |
| - ) |
| 47 | + ); |
114 | 48 | }
|
0 commit comments