Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1 create landing page #7

Closed
wants to merge 29 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
928e134
Merge remote-tracking branch 'origin/main' into 1-create-landing-page
plzfday Jul 8, 2024
ec35ab7
Remove bun from the project
plzfday Jul 15, 2024
35623dc
Add a temporary logo image
plzfday Jul 18, 2024
ec079e1
🖼 Setup Material UI
plzfday Jul 18, 2024
b90d688
🔧 Set default background color
plzfday Jul 18, 2024
f92b991
🧩 Add CustomLink component
plzfday Jul 18, 2024
da8caef
🧩 Add Footer, Header, Navigation components
plzfday Jul 18, 2024
a1d39d1
🧩 Add Logo component
plzfday Jul 18, 2024
4f2eabb
⏫ Update layout.tsx to include CssBaseline and font imports
plzfday Jul 18, 2024
06c392c
👕 chore: Update Footer and Navigation styles
plzfday Jul 18, 2024
b5d98e3
🧩 feat: Add Index component and Changelog component
plzfday Jul 18, 2024
91ac152
🔧 chore: Fix yarn dev failing
plzfday Jul 19, 2024
5462ead
🔧 feat: Refactor CustomLink component to use Next.js and MUI Link com…
plzfday Jul 19, 2024
b150f4c
⏫ feat: Update Navigation title in Home page
plzfday Jul 19, 2024
c69b1f8
🧩 feat: Update Navigation component to use CustomLink for Index
plzfday Jul 19, 2024
97e20df
🔧 fix: Place <main> tag in the right place
plzfday Jul 19, 2024
64ea755
➕ Add primary border color
plzfday Jul 22, 2024
867c001
⏫ Update styling to be responsive
plzfday Jul 22, 2024
31f4657
🪡 chore: Add CI workflow for continuous integration
plzfday Jul 18, 2024
6a94ecd
⚙️ chore: Update Node.js setup action to version 4 in CI workflow
plzfday Jul 18, 2024
9a87be9
⏫ chore: Update Node.js version in CI workflow to 22
plzfday Jul 18, 2024
264068c
⚗️ chore: Update CI workflow to use npm ci and npm run test
plzfday Jul 18, 2024
876e01c
🚀 chore: Install jest globally for running unit tests in CI workflow
plzfday Jul 18, 2024
4c67a42
🔧 chore: Change NODE_ENV to install all dependencies
plzfday Jul 18, 2024
5d15013
⏫ chore: Upgrade npm and clear npm cache in CI workflow
plzfday Jul 18, 2024
ad72b26
🪡 chore: Add command to list node_modules in CI workflow
plzfday Jul 19, 2024
a0d7b83
⏫ chore: Update Node.js version in CI workflow to 20
plzfday Jul 19, 2024
b1a0664
Update issue templates
plzfday Jul 18, 2024
6285e94
Merge commit '2f3dff33e91832b3180e81281e41df7e0fcf781d' into 1-create…
plzfday Jul 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@
"test:watch": "jest --watch"
},
"dependencies": {
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.5",
"@fontsource/roboto": "^5.0.13",
"@mui/material": "^5.16.4",
"next": "14.2.4",
"normalize.css": "^8.0.1",
"react": "^18",
"react-dom": "^18",
"ts-node": "^10.9.2"
Expand Down
Binary file added public/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 2 additions & 27 deletions src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,6 @@
@tailwind utilities;

:root {
--foreground-rgb: 0, 0, 0;
--background-start-rgb: 214, 219, 220;
--background-end-rgb: 255, 255, 255;
}

@media (prefers-color-scheme: dark) {
:root {
--foreground-rgb: 255, 255, 255;
--background-start-rgb: 0, 0, 0;
--background-end-rgb: 0, 0, 0;
}
}

body {
color: rgb(var(--foreground-rgb));
background: linear-gradient(
to bottom,
transparent,
rgb(var(--background-end-rgb))
)
rgb(var(--background-start-rgb));
}

@layer utilities {
.text-balance {
text-wrap: balance;
}
--global-bg-color: #e5ecf9;
--global-border-color: #c3d9ff;
}
28 changes: 20 additions & 8 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
import type { Metadata } from "next";
import { Inter } from "next/font/google";
import "./globals.css";
import type { Metadata, Viewport } from 'next';
import { Inter } from 'next/font/google';
import './globals.css';
import CssBaseline from '@mui/material/CssBaseline';
import '@fontsource/roboto/300.css';
import '@fontsource/roboto/400.css';
import '@fontsource/roboto/500.css';
import '@fontsource/roboto/700.css';

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

export const viewport: Viewport = {
width: 'device-width',
initialScale: 1,
};

export const metadata: Metadata = {
title: "Create Next App",
description: "Generated by create next app",
title: 'Create Next App',
description: 'Generated by create next app',
};

export default function RootLayout({
Expand All @@ -15,8 +25,10 @@ export default function RootLayout({
children: React.ReactNode;
}>) {
return (
<html lang="en">
<body className={inter.className}>{children}</body>
<html lang='en'>
<CssBaseline>
<body className={inter.className}>{children}</body>
</CssBaseline>
</html>
);
}
121 changes: 13 additions & 108 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,113 +1,18 @@
import Image from "next/image";
import Footer from '@/components/Footer';
import Header from '@/components/Header';
import Navigation from '@/components/Navigation';
import Index from '@/components/Index';
import { Container } from '@mui/material';

export default function Home() {
return (
<main className="flex min-h-screen flex-col items-center justify-between p-24">
<div className="z-10 w-full max-w-5xl items-center justify-between font-mono text-sm lg:flex">
<p className="fixed left-0 top-0 flex w-full justify-center border-b border-gray-300 bg-gradient-to-b from-zinc-200 pb-6 pt-8 backdrop-blur-2xl dark:border-neutral-800 dark:bg-zinc-800/30 dark:from-inherit lg:static lg:w-auto lg:rounded-xl lg:border lg:bg-gray-200 lg:p-4 lg:dark:bg-zinc-800/30">
Get started by editing&nbsp;
<code className="font-mono font-bold">src/app/page.tsx</code>
</p>
<div className="fixed bottom-0 left-0 flex h-48 w-full items-end justify-center bg-gradient-to-t from-white via-white dark:from-black dark:via-black lg:static lg:size-auto lg:bg-none">
<a
className="pointer-events-none flex place-items-center gap-2 p-8 lg:pointer-events-auto lg:p-0"
href="https://vercel.com?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
By{" "}
<Image
src="/vercel.svg"
alt="Vercel Logo"
className="dark:invert"
width={100}
height={24}
priority
/>
</a>
</div>
</div>

<div className="relative z-[-1] flex place-items-center before:absolute before:h-[300px] before:w-full before:-translate-x-1/2 before:rounded-full before:bg-gradient-radial before:from-white before:to-transparent before:blur-2xl before:content-[''] after:absolute after:-z-20 after:h-[180px] after:w-full after:translate-x-1/3 after:bg-gradient-conic after:from-sky-200 after:via-blue-200 after:blur-2xl after:content-[''] before:dark:bg-gradient-to-br before:dark:from-transparent before:dark:to-blue-700 before:dark:opacity-10 after:dark:from-sky-900 after:dark:via-[#0141ff] after:dark:opacity-40 sm:before:w-[480px] sm:after:w-[240px] before:lg:h-[360px]">
<Image
className="relative dark:drop-shadow-[0_0_0.3rem_#ffffff70] dark:invert"
src="/next.svg"
alt="Next.js Logo"
width={180}
height={37}
priority
/>
</div>

<div className="mb-32 grid text-center lg:mb-0 lg:w-full lg:max-w-5xl lg:grid-cols-4 lg:text-left">
<a
href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
target="_blank"
rel="noopener noreferrer"
>
<h2 className="mb-3 text-2xl font-semibold">
Docs{" "}
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
-&gt;
</span>
</h2>
<p className="m-0 max-w-[30ch] text-sm opacity-50">
Find in-depth information about Next.js features and API.
</p>
</a>

<a
href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
target="_blank"
rel="noopener noreferrer"
>
<h2 className="mb-3 text-2xl font-semibold">
Learn{" "}
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
-&gt;
</span>
</h2>
<p className="m-0 max-w-[30ch] text-sm opacity-50">
Learn about Next.js in an interactive course with&nbsp;quizzes!
</p>
</a>

<a
href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
target="_blank"
rel="noopener noreferrer"
>
<h2 className="mb-3 text-2xl font-semibold">
Templates{" "}
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
-&gt;
</span>
</h2>
<p className="m-0 max-w-[30ch] text-sm opacity-50">
Explore starter templates for Next.js.
</p>
</a>

<a
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
target="_blank"
rel="noopener noreferrer"
>
<h2 className="mb-3 text-2xl font-semibold">
Deploy{" "}
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
-&gt;
</span>
</h2>
<p className="m-0 max-w-[30ch] text-balance text-sm opacity-50">
Instantly deploy your Next.js site to a shareable URL with Vercel.
</p>
</a>
</div>
</main>
<Container maxWidth='xl' className='my-2'>
<Header />
<Navigation title='Index Page' />
<main>
<Index />
</main>
<Footer />
</Container>
);
}
12 changes: 12 additions & 0 deletions src/components/Changelog.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
type ChangelogProps = {
date: string;
content: string;
};

export default function Changelog({ date, content }: ChangelogProps) {
return (
<div>
<b>{date}</b> - {content}
</div>
);
}
10 changes: 10 additions & 0 deletions src/components/CustomLink.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import NextLink, { LinkProps as NextLinkProps } from 'next/link';
import { Link as MUILink, LinkProps as MUILinkProps } from '@mui/material';

type CustomLinkProps = NextLinkProps & MUILinkProps;

export default function CustomLink(props: CustomLinkProps) {
const { href, ...others } = props;

return <MUILink component={NextLink} href={href} {...others} />;
}
7 changes: 7 additions & 0 deletions src/components/Footer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default function Footer() {
return (
<footer className='mt-8 border-t-2'>
<p>&copy; 2024 Bibimbap</p>
</footer>
);
}
18 changes: 18 additions & 0 deletions src/components/Header.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import Logo from '@/components/Logo';
import { Box } from '@mui/material';
import CustomLink from './CustomLink';

export default function Header() {
return (
<Box className='flex justify-between'>
<Box>
<Logo />
<i>Professional way to prepare programming contest problems</i>
</Box>
<Box className='flex gap-2'>
<CustomLink href='/login'>Login</CustomLink>
<CustomLink href='/register'>Register</CustomLink>
</Box>
</Box>
);
}
34 changes: 34 additions & 0 deletions src/components/Index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import Changelog from './Changelog';

export default function Index() {
return (
<div className='flex flex-wrap'>
<div className='py-8 pr-8'>
<div>
The mission of Polygon is to provide platform for creation of
programming contest problems. Polygon supports the whole development
cycle:
<ul className='list-disc list-inside'>
<li>problem statement writing</li>
<li>test data preparing (generators supported)</li>
<li>model solutions (including correct and wittingly incorrect)</li>
<li>judging</li>
<li>automatic validation</li>
</ul>
</div>
</div>
<div className='flex flex-col gap-4'>
<div className='border border-primary rounded-md py-2 px-4 bg-primary flex flex-col gap-2'>
<p>Registered users: 12345</p>
<p>Problems total: 12345</p>
<p>Invokers waiting: 34</p>
</div>
<div className='border border-primary rounded-md py-2 px-4 bg-primary flex flex-col gap-2'>
<Changelog date='15 Jun 2024' content='Added a new feature' />
<Changelog date='12 Jul 2014' content='Fixed a bug' />
<Changelog date='27 Jun 2013' content='Initial release of the app' />
</div>
</div>
</div>
);
}
10 changes: 10 additions & 0 deletions src/components/Logo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import Image from 'next/image';
import { Link } from '@mui/material';

export default function Logo() {
return (
<Link href='/'>
<Image src='/logo.png' width={64} height={64} alt='Logo of Bibimbap' />
</Link>
);
}
19 changes: 19 additions & 0 deletions src/components/Navigation.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Box } from '@mui/material';
import CustomLink from './CustomLink';

type NavigationProps = {
title: string;
};

export default function Navigation({ title }: NavigationProps) {
return (
<Box className='flex justify-between border border-primary rounded-md py-2 px-4 mb-8 bg-primary'>
<Box>{title}</Box>
<Box className='flex gap-2'>
<CustomLink href='/'>Index</CustomLink>
<CustomLink href='/login'>Login</CustomLink>
<CustomLink href='/register'>Register</CustomLink>
</Box>
</Box>
);
}
6 changes: 6 additions & 0 deletions tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ const config: Config = {
"gradient-conic":
"conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))",
},
backgroundColor: {
"primary": "var(--global-bg-color)"
},
borderColor: {
"primary": "var(--global-border-color)"
},
},
},
plugins: [],
Expand Down
Loading
Loading