Skip to content
This repository was archived by the owner on Dec 18, 2023. It is now read-only.

Commit 0cfe8b3

Browse files
committed
Hello World!
1 parent c54ac07 commit 0cfe8b3

25 files changed

+577
-212
lines changed

.prettierignore

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# next.js
12+
/.next/
13+
/out/
14+
15+
# production
16+
/build
17+
18+
# misc
19+
.DS_Store
20+
*.pem
21+
22+
# debug
23+
npm-debug.log*
24+
yarn-debug.log*
25+
yarn-error.log*
26+
27+
# local env files
28+
.env*.local
29+
30+
# vercel
31+
.vercel
32+
33+
# typescript
34+
*.tsbuildinfo
35+
next-env.d.ts

.prettierrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"plugins": ["prettier-plugin-tailwindcss"]
3+
}

README.md

+1-36
Original file line numberDiff line numberDiff line change
@@ -1,36 +1 @@
1-
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
2-
3-
## Getting Started
4-
5-
First, run the development server:
6-
7-
```bash
8-
npm run dev
9-
# or
10-
yarn dev
11-
# or
12-
pnpm dev
13-
# or
14-
bun dev
15-
```
16-
17-
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
18-
19-
You can start editing the page by modifying `app/page.js`. The page auto-updates as you edit the file.
20-
21-
This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
22-
23-
## Learn More
24-
25-
To learn more about Next.js, take a look at the following resources:
26-
27-
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
28-
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
29-
30-
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
31-
32-
## Deploy on Vercel
33-
34-
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
35-
36-
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
1+
# TODO

app/_components/ProjectGrid.jsx

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
"use client";
2+
3+
import Image from "next/image";
4+
import { useState } from "react";
5+
import { useRouter } from "next/navigation";
6+
import clsx from "clsx";
7+
8+
const ProjectGrid = ({ projects }) => {
9+
const [selectedProject, setSelectedProject] = useState(1);
10+
const router = useRouter();
11+
12+
return (
13+
<main className="grid-rows-9 relative grid min-h-[calc(100svh-3rem)] bg-fuchsia-400 bg-opacity-20 lg:grid-cols-3 lg:grid-rows-3">
14+
<Image
15+
key={"img" + projects[0].id}
16+
src={projects[selectedProject - 1].image}
17+
alt="image"
18+
fill
19+
className={clsx(
20+
"object-cover object-center transition-opacity duration-1000",
21+
)}
22+
priority
23+
sizes="100vw"
24+
/>
25+
{projects.map((project) => (
26+
<label
27+
key={"label_" + project.id}
28+
className={clsx(
29+
"group z-0 p-4",
30+
"border-b border-gray-300 border-opacity-20 last:border-b-0 lg:border",
31+
"text-gray-300 text-opacity-40",
32+
selectedProject === project.id &&
33+
"border-white bg-fuchsia-600 bg-opacity-20 shadow backdrop-blur-sm",
34+
)}
35+
onMouseEnter={() => setSelectedProject(project.id)}
36+
>
37+
<input
38+
type="radio"
39+
checked={project.id === selectedProject}
40+
name="projectRadio"
41+
value={project.id}
42+
onChange={() => setSelectedProject(project.id)}
43+
onKeyDown={(e) =>
44+
e.key === "Enter" && router.push("/projects/" + project.id)
45+
}
46+
className="appearance-none"
47+
/>
48+
<a
49+
className={clsx(
50+
"text-lg underline underline-offset-4 hover:font-medium",
51+
selectedProject === project.id && "text-white",
52+
)}
53+
href={`/projects/${project.id}`}
54+
>
55+
{project.title}
56+
</a>
57+
</label>
58+
))}
59+
</main>
60+
);
61+
};
62+
63+
export default ProjectGrid;

app/globals.css

+6-13
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,18 @@
33
@tailwind utilities;
44

55
:root {
6-
--foreground-rgb: 0, 0, 0;
7-
--background-start-rgb: 214, 219, 220;
8-
--background-end-rgb: 255, 255, 255;
6+
--primary-rgb: 0, 0, 0;
7+
--secondary-rgb: 255, 255, 255;
98
}
109

1110
@media (prefers-color-scheme: dark) {
1211
:root {
13-
--foreground-rgb: 255, 255, 255;
14-
--background-start-rgb: 0, 0, 0;
15-
--background-end-rgb: 0, 0, 0;
12+
--primary-rgb: 255, 255, 255;
13+
--secondary-rgb: 0, 0, 0;
1614
}
1715
}
1816

1917
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));
18+
color: rgb(var(--primary-rgb));
19+
background: rgb(var(--secondary-rgb));
2720
}

app/layout.js

-17
This file was deleted.

app/layout.jsx

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import clsx from "clsx";
2+
3+
import { Inter } from "next/font/google";
4+
import "./globals.css";
5+
6+
const inter = Inter({ subsets: ["latin"] });
7+
8+
export const metadata = {
9+
title: "Project Grid Test",
10+
};
11+
12+
export default function RootLayout({ children }) {
13+
return (
14+
<html lang="en">
15+
<body className={inter.className}>
16+
<header>
17+
<nav
18+
className={clsx(
19+
"flex h-12 items-center justify-center",
20+
" bg-[rgb(var(--primary-rgb))] text-[rgb(var(--secondary-rgb))]",
21+
)}
22+
>
23+
<a href="/" className="block">
24+
Home
25+
</a>
26+
</nav>
27+
</header>
28+
{children}
29+
<footer
30+
className={clsx(
31+
"flex h-12 w-full items-center justify-center",
32+
"bg-[rgb(var(--primary-rgb))] text-[rgb(var(--secondary-rgb))]",
33+
)}
34+
>
35+
<span className="block">Footer</span>
36+
</footer>
37+
</body>
38+
</html>
39+
);
40+
}

app/page.js

-113
This file was deleted.

0 commit comments

Comments
 (0)