Skip to content

Commit 6ed2f93

Browse files
committed
Home Screen
Implemented basic cards for skybox previews, and uploaded existing database of images.
1 parent 5c4650a commit 6ed2f93

File tree

126 files changed

+86
-24
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+86
-24
lines changed

app/page.tsx

Lines changed: 34 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import fs from 'fs';
22
import path from 'path';
3-
import Image from 'next/image';
3+
import SkyboxCard from './ui/skyboxcard';
44

55
function getSkyboxSlugs(): string[] {
66
const skyboxesDir = path.join(process.cwd(), 'public', 'skyboxes');
@@ -11,29 +11,39 @@ function getSkyboxSlugs(): string[] {
1111
.filter((name) =>
1212
fs.statSync(path.join(skyboxesDir, name)).isDirectory()
1313
);
14-
}
14+
}
1515

16-
export default function Home() {
17-
const slugs = getSkyboxSlugs();
16+
export default function Home() {
17+
const slugs = getSkyboxSlugs();
1818

19-
return (
20-
<main>
21-
<div className='Header'>
22-
<h1>
23-
Jacob Robbins' Skyboxes
19+
return (
20+
<main>
21+
<header
22+
className="
23+
flex items-center justify-center
24+
bg-neutral-900
25+
shadow-md shadow-black/40
26+
h-20
27+
mb-4
28+
"
29+
>
30+
<h1 className="text-2xl sm:text-4xl font-bold text-neutral-100 tracking-wide">
31+
Jacob Robbins&rsquo; Skybox Textures
2432
</h1>
25-
</div>
26-
<div className="grid">
27-
{slugs.map((slug) => (
28-
<Image
29-
key={slug}
30-
src={`/Source_Skyboxes_NextJS/skyboxes/${slug}/images/thumb.webp`}
31-
alt={`${slug} thumbnail`}
32-
width={400}
33-
height={225}
34-
/>
35-
))}
36-
</div>
37-
</main>
38-
);
39-
}
33+
</header>
34+
35+
<section
36+
className="
37+
grid gap-4
38+
grid-cols-[repeat(auto-fill,minmax(24rem,1fr))]
39+
px-4 sm:px-6 lg:px-8 /* side padding that expands with breakpoints */
40+
"
41+
>
42+
{slugs.map((slug) => (
43+
<SkyboxCard key={slug} slug={slug} />
44+
))}
45+
</section>
46+
47+
</main>
48+
);
49+
}

app/ui/skyboxcard.tsx

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import Image from 'next/image';
2+
import Link from 'next/link';
3+
4+
type Props = {
5+
slug: string;
6+
};
7+
8+
export default function SkyboxCard({ slug }: Props) {
9+
const imgBase = `/Source_Skyboxes_NextJS/skyboxes/${slug}/images`;
10+
const details = `/${slug}`;
11+
12+
//placeholder
13+
const description = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.';
14+
15+
return (
16+
<Link href={details}>
17+
<article
18+
className="
19+
flex flex-col items-center
20+
bg-neutral-800
21+
ring-1 ring-neutral-700/60
22+
shadow-lg shadow-black/40
23+
p-2
24+
m-0.5
25+
tranform hover:scale-105
26+
transition duration-150
27+
28+
">
29+
<div className='w-full text-center font-bold'>
30+
<h2 className="text-lg font-semibold text-left">{slug}</h2>
31+
</div>
32+
33+
<div className="relative w-full aspect-[16/9] overflow-hidden m-2">
34+
<Image
35+
src={`${imgBase}/thumbnail.webp`}
36+
alt={`${slug} preview`}
37+
fill
38+
sizes="(min-width:1280px) 16rem,
39+
(min-width:1024px) 22vw,
40+
(min-width:640px) 45vw,
41+
100vw"
42+
className="object-cover"
43+
unoptimized
44+
/>
45+
</div>
46+
<div className='w-full h-auto'>
47+
<h3 className="text-sm">{description}</h3>
48+
</div>
49+
</article>
50+
</Link>
51+
);
52+
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)