Skip to content

Commit

Permalink
added the top section of the landing page and also added countdown
Browse files Browse the repository at this point in the history
  • Loading branch information
GokulramGHV committed Sep 9, 2023
1 parent 3015ef7 commit 04f3b96
Show file tree
Hide file tree
Showing 11 changed files with 141 additions and 120 deletions.
Binary file modified app/favicon.ico
Binary file not shown.
14 changes: 7 additions & 7 deletions app/layout.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import './globals.css'
import { Inter } from 'next/font/google'
import './globals.css';
import { Inter } from 'next/font/google';

const inter = Inter({ subsets: ['latin'] })
const inter = Inter({ subsets: ['latin'] });

export const metadata = {
title: 'Create Next App',
description: 'Generated by create next app',
}
title: 'Invente 2023',
description: 'TechSpectrum: Traveling through time and Tech',
};

export default function RootLayout({ children }) {
return (
<html lang="en">
<body className={inter.className}>{children}</body>
</html>
)
);
}
113 changes: 0 additions & 113 deletions app/page.js

This file was deleted.

36 changes: 36 additions & 0 deletions app/page.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import Image from 'next/image';

import Countdown from '@/components/countdown';

export default function Home() {
return (
<main className="flex min-h-screen flex-col items-center justify-center p-10">
<video
src="/Asc.m4v"
autoPlay
loop
muted
className="absolute top-0 left-0 z-0 w-full h-full object-cover"
></video>
<div className="absolute top-0 left-0 flex justify-between items-center w-full p-16 z-10">
<Image src="/snuLogo.svg" alt="SNU Logo" width="200" height="200" />
<Image src="/ssnLogo.svg" alt="SSN Logo" width="130" height="130" />
</div>
<Image
src="/inventeLogo.svg"
alt="Invente"
width="600"
height="200"
className="z-20"
/>
<Countdown />
<Image
src="/downArrow.png"
alt="Down Arrow"
width="50"
height="50"
className="z-50 relative top-20 transition duration-700 ease-in-out animate-bounce"
/>
</main>
);
}
38 changes: 38 additions & 0 deletions components/countdown.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
'use client';

import { useCountdown } from '@/hooks/useCountDown';
import { Space_Grotesk } from 'next/font/google';

const space_grotesk = Space_Grotesk({
preload: true,
subsets: ['latin'],
});

export default function Countdown() {
const [days, hours, minutes, seconds] = useCountdown('Oct 6, 2023 00:00:00');
return (
<div
id="countdown"
className={`${space_grotesk.className} flex gap-8 z-50 relative top-10`}
>
<div className="text-center">
<h1 className="text-7xl font-bold text-white">{days}</h1>
<p className="text-xl font-light text-[#F7971D] relative left-1">
days
</p>
</div>
<div className="text-center">
<h1 className="text-7xl font-bold text-white">{hours}</h1>
<p className="text-xl font-light text-[#F7971D] relative left-1">
hrs
</p>
</div>
<div className="text-center">
<h1 className="text-7xl font-bold text-white">{minutes}</h1>
<p className="text-xl font-light text-[#F7971D] relative left-1">
mins
</p>
</div>
</div>
);
}
33 changes: 33 additions & 0 deletions hooks/useCountDown.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { useEffect, useState } from 'react';

const useCountdown = (targetDate) => {
const countDownDate = new Date(targetDate).getTime();

const [countDown, setCountDown] = useState(
countDownDate - new Date().getTime()
);

useEffect(() => {
const interval = setInterval(() => {
setCountDown(countDownDate - new Date().getTime());
}, 1000);

return () => clearInterval(interval);
}, [countDownDate]);

return getReturnValues(countDown);
};

const getReturnValues = (countDown) => {
// calculate time left
const days = Math.floor(countDown / (1000 * 60 * 60 * 24));
const hours = Math.floor(
(countDown % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)
);
const minutes = Math.floor((countDown % (1000 * 60 * 60)) / (1000 * 60));
const seconds = Math.floor((countDown % (1000 * 60)) / 1000);

return [days, hours, minutes, seconds];
};

export { useCountdown };
Binary file added public/Asc.m4v
Binary file not shown.
Binary file added public/downArrow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions public/inventeLogo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions public/snuLogo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions public/ssnLogo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 04f3b96

Please sign in to comment.