Skip to content

Commit 75b1bb2

Browse files
authored
Merge pull request #8 from Bibimbap-Team/1-create-landing-page
Create landing page
2 parents 2f3dff3 + 6cb9cf6 commit 75b1bb2

File tree

9 files changed

+504
-158
lines changed

9 files changed

+504
-158
lines changed
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ import Home from '@/app/page';
44

55
it('renders main page with the text "Get started by editing"', () => {
66
render(<Home />);
7-
const text = screen.getByText(/Get started by editing/i);
8-
expect(text).toBeInTheDocument();
7+
const login = screen.getAllByText(/\bLogin\b/i).length;
8+
expect(login).toBe(2);
9+
10+
const register = screen.getAllByText(/\bRegister\b/i).length;
11+
expect(register).toBe(2);
912
});

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@
1212
"test:watch": "jest --watch"
1313
},
1414
"dependencies": {
15+
"@emotion/cache": "^11.13.1",
16+
"@emotion/react": "^11.13.0",
17+
"@emotion/styled": "^11.13.0",
18+
"@mui/icons-material": "^5.16.5",
19+
"@mui/material": "^5.16.5",
20+
"@mui/material-nextjs": "^5.16.4",
1521
"next": "14.2.4",
1622
"react": "^18",
1723
"react-dom": "^18",

public/logo.png

65.7 KB
Loading

src/app/globals.css

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,3 @@
11
@tailwind base;
22
@tailwind components;
33
@tailwind utilities;
4-
5-
:root {
6-
--foreground-rgb: 0, 0, 0;
7-
--background-start-rgb: 214, 219, 220;
8-
--background-end-rgb: 255, 255, 255;
9-
}
10-
11-
@media (prefers-color-scheme: dark) {
12-
:root {
13-
--foreground-rgb: 255, 255, 255;
14-
--background-start-rgb: 0, 0, 0;
15-
--background-end-rgb: 0, 0, 0;
16-
}
17-
}
18-
19-
body {
20-
color: rgb(var(--foreground-rgb));
21-
background: linear-gradient(
22-
to bottom,
23-
transparent,
24-
rgb(var(--background-end-rgb))
25-
)
26-
rgb(var(--background-start-rgb));
27-
}
28-
29-
@layer utilities {
30-
.text-balance {
31-
text-wrap: balance;
32-
}
33-
}

src/app/layout.tsx

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import type { Metadata } from "next";
2-
import { Inter } from "next/font/google";
3-
import "./globals.css";
4-
5-
const inter = Inter({ subsets: ["latin"] });
1+
import type { Metadata } from 'next';
2+
import { AppRouterCacheProvider } from '@mui/material-nextjs/v13-appRouter';
3+
import { ThemeProvider } from '@mui/material';
4+
import theme from '../theme';
5+
import './globals.css';
66

77
export const metadata: Metadata = {
8-
title: "Create Next App",
9-
description: "Generated by create next app",
8+
title: 'Bibimbap',
9+
description: 'A delicious Korean dish',
1010
};
1111

1212
export default function RootLayout({
@@ -15,8 +15,12 @@ export default function RootLayout({
1515
children: React.ReactNode;
1616
}>) {
1717
return (
18-
<html lang="en">
19-
<body className={inter.className}>{children}</body>
18+
<html lang='en'>
19+
<body>
20+
<AppRouterCacheProvider>
21+
<ThemeProvider theme={theme}>{children}</ThemeProvider>
22+
</AppRouterCacheProvider>
23+
</body>
2024
</html>
2125
);
2226
}

src/app/page.tsx

Lines changed: 56 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -1,113 +1,61 @@
1-
import Image from "next/image";
1+
import Navigation from '@/components/Navigation';
2+
import { Container, Paper, Stack, Typography } from '@mui/material';
23

34
export default function Home() {
4-
return (
5-
<main className="flex min-h-screen flex-col items-center justify-between p-24">
6-
<div className="z-10 w-full max-w-5xl items-center justify-between font-mono text-sm lg:flex">
7-
<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">
8-
Get started by editing&nbsp;
9-
<code className="font-mono font-bold">src/app/page.tsx</code>
10-
</p>
11-
<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">
12-
<a
13-
className="pointer-events-none flex place-items-center gap-2 p-8 lg:pointer-events-auto lg:p-0"
14-
href="https://vercel.com?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
15-
target="_blank"
16-
rel="noopener noreferrer"
17-
>
18-
By{" "}
19-
<Image
20-
src="/vercel.svg"
21-
alt="Vercel Logo"
22-
className="dark:invert"
23-
width={100}
24-
height={24}
25-
priority
26-
/>
27-
</a>
28-
</div>
29-
</div>
30-
31-
<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]">
32-
<Image
33-
className="relative dark:drop-shadow-[0_0_0.3rem_#ffffff70] dark:invert"
34-
src="/next.svg"
35-
alt="Next.js Logo"
36-
width={180}
37-
height={37}
38-
priority
39-
/>
40-
</div>
41-
42-
<div className="mb-32 grid text-center lg:mb-0 lg:w-full lg:max-w-5xl lg:grid-cols-4 lg:text-left">
43-
<a
44-
href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
45-
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"
46-
target="_blank"
47-
rel="noopener noreferrer"
48-
>
49-
<h2 className="mb-3 text-2xl font-semibold">
50-
Docs{" "}
51-
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
52-
-&gt;
53-
</span>
54-
</h2>
55-
<p className="m-0 max-w-[30ch] text-sm opacity-50">
56-
Find in-depth information about Next.js features and API.
57-
</p>
58-
</a>
5+
const serviceSummary = {
6+
numUsers: 55202,
7+
numProblems: 372278,
8+
numInvokers: 0,
9+
};
10+
const changeLogs = [
11+
'27 Jun 2016 - Polygon API has been released. You can view documentation here.',
12+
'7 Dec 2011 - Now you may download testlib and polygon documentation from Polygon installation.',
13+
'17 Jul 2010 - Supported contests and PDF-statements.',
14+
'3 Nov 2009 - Released new version. Tags and problem filters supported. Also many other smaller fixes done.',
15+
'8 Mar 2009 - Use public issue tracker to post bug or feature request.',
16+
'8 Mar 2009 - Beta version has been deployed.',
17+
];
5918

60-
<a
61-
href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
62-
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"
63-
target="_blank"
64-
rel="noopener noreferrer"
65-
>
66-
<h2 className="mb-3 text-2xl font-semibold">
67-
Learn{" "}
68-
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
69-
-&gt;
70-
</span>
71-
</h2>
72-
<p className="m-0 max-w-[30ch] text-sm opacity-50">
73-
Learn about Next.js in an interactive course with&nbsp;quizzes!
74-
</p>
75-
</a>
76-
77-
<a
78-
href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
79-
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"
80-
target="_blank"
81-
rel="noopener noreferrer"
82-
>
83-
<h2 className="mb-3 text-2xl font-semibold">
84-
Templates{" "}
85-
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
86-
-&gt;
87-
</span>
88-
</h2>
89-
<p className="m-0 max-w-[30ch] text-sm opacity-50">
90-
Explore starter templates for Next.js.
91-
</p>
92-
</a>
93-
94-
<a
95-
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
96-
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"
97-
target="_blank"
98-
rel="noopener noreferrer"
99-
>
100-
<h2 className="mb-3 text-2xl font-semibold">
101-
Deploy{" "}
102-
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
103-
-&gt;
104-
</span>
105-
</h2>
106-
<p className="m-0 max-w-[30ch] text-balance text-sm opacity-50">
107-
Instantly deploy your Next.js site to a shareable URL with Vercel.
108-
</p>
109-
</a>
110-
</div>
111-
</main>
19+
return (
20+
<Container component='main'>
21+
<Navigation />
22+
<Stack direction={{ sm: 'column', md: 'row' }} gap={2} mt={2}>
23+
<Paper sx={{ p: 2 }} elevation={3}>
24+
<Typography variant='body1'>
25+
The mission of Polygon is to provide platform for creation of
26+
programming contest problems. Polygon supports the whole development
27+
cycle:
28+
</Typography>
29+
{/* The following has to have a list using Tailwind CSS */}
30+
<ul className='list-disc list-inside'>
31+
<li>problem statement writing</li>
32+
<li>test data preparing (generators supported)</li>
33+
<li>model solutions (including correct and wittingly incorrect)</li>
34+
<li>judging</li>
35+
<li>automatic validation</li>
36+
</ul>
37+
</Paper>
38+
<Stack direction='column' gap={2}>
39+
<Paper sx={{ p: 2 }} elevation={3}>
40+
<Typography variant='body2'>
41+
Registered users: {serviceSummary.numUsers}
42+
</Typography>
43+
<Typography variant='body2'>
44+
Problems total: {serviceSummary.numProblems}
45+
</Typography>
46+
<Typography variant='body2'>
47+
Invokers waiting: {serviceSummary.numInvokers}
48+
</Typography>
49+
</Paper>
50+
<Paper sx={{ p: 2 }} elevation={3}>
51+
{changeLogs.map((log, index) => (
52+
<Typography key={index} variant='body2'>
53+
{log}
54+
</Typography>
55+
))}
56+
</Paper>
57+
</Stack>
58+
</Stack>
59+
</Container>
11260
);
11361
}

src/components/Navigation.tsx

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
'use client';
2+
import { Menu } from '@mui/icons-material';
3+
import {
4+
AppBar,
5+
Box,
6+
Button,
7+
Divider,
8+
Drawer,
9+
IconButton,
10+
List,
11+
ListItem,
12+
ListItemButton,
13+
ListItemText,
14+
Toolbar,
15+
Typography,
16+
} from '@mui/material';
17+
import Image from 'next/image';
18+
import { useState } from 'react';
19+
20+
interface Props {
21+
/**
22+
* Injected by the documentation to work in an iframe.
23+
* You won't need it on your project.
24+
*/
25+
window?: () => Window;
26+
}
27+
28+
const drawerWidth = 240;
29+
const navItems = ['Login', 'Register', 'Help'];
30+
31+
export default function Navigation(props: Props) {
32+
const { window } = props;
33+
const [mobileOpen, setMobileOpen] = useState(false);
34+
35+
const handleDrawerToggle = () => {
36+
setMobileOpen((prevState) => !prevState);
37+
};
38+
39+
const drawer = (
40+
<Box onClick={handleDrawerToggle} sx={{ textAlign: 'center' }}>
41+
<Typography variant='h6' sx={{ my: 2 }}>
42+
Bibimbap
43+
</Typography>
44+
<Divider />
45+
<List>
46+
{navItems.map((item) => (
47+
<ListItem key={item} disablePadding>
48+
<ListItemButton sx={{ textAlign: 'center' }}>
49+
<ListItemText primary={item} />
50+
</ListItemButton>
51+
</ListItem>
52+
))}
53+
</List>
54+
</Box>
55+
);
56+
57+
const container =
58+
window !== undefined ? () => window().document.body : undefined;
59+
60+
return (
61+
<>
62+
<AppBar component='nav' position='sticky'>
63+
<Toolbar>
64+
<IconButton
65+
color='inherit'
66+
aria-label='open drawer'
67+
edge='start'
68+
onClick={handleDrawerToggle}
69+
sx={{ mr: 2, display: { sm: 'none' } }}
70+
>
71+
<Menu />
72+
</IconButton>
73+
<Image src='/logo.png' alt='logo' width={64} height={64} />
74+
<Typography
75+
variant='h6'
76+
component='div'
77+
sx={{ flexGrow: 1, display: { xs: 'none', sm: 'block' }, ml: 2 }}
78+
>
79+
Bibimbap
80+
</Typography>
81+
<Box sx={{ display: { xs: 'none', sm: 'block' } }}>
82+
{navItems.map((item) => (
83+
<Button key={item} sx={{ color: '#fff' }}>
84+
{item}
85+
</Button>
86+
))}
87+
</Box>
88+
</Toolbar>
89+
</AppBar>
90+
<nav>
91+
<Drawer
92+
container={container}
93+
variant='temporary'
94+
open={mobileOpen}
95+
onClose={handleDrawerToggle}
96+
ModalProps={{
97+
keepMounted: true, // Better open performance on mobile.
98+
}}
99+
sx={{
100+
display: { xs: 'block', sm: 'none' },
101+
'& .MuiDrawer-paper': {
102+
boxSizing: 'border-box',
103+
width: drawerWidth,
104+
},
105+
}}
106+
>
107+
{drawer}
108+
</Drawer>
109+
</nav>
110+
</>
111+
);
112+
}

src/theme.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
'use client';
2+
import { Roboto } from 'next/font/google';
3+
import { createTheme } from '@mui/material/styles';
4+
5+
const roboto = Roboto({
6+
weight: ['300', '400', '500', '700'],
7+
subsets: ['latin'],
8+
display: 'swap',
9+
});
10+
11+
const theme = createTheme({
12+
typography: {
13+
fontFamily: roboto.style.fontFamily,
14+
},
15+
});
16+
17+
export default theme;

0 commit comments

Comments
 (0)