Skip to content

Commit 33f8148

Browse files
committed
refactor: ♻️ move world generation resources into dedicated category
1 parent c4a10ec commit 33f8148

File tree

19 files changed

+68
-10
lines changed

19 files changed

+68
-10
lines changed

src/components/container.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import type {PropsWithChildren} from "react";
2+
3+
export function Container (props: PropsWithChildren ): JSX.Element {
4+
return (
5+
<div className="nx-container nx-mx-auto nx-my-8">
6+
{props.children}
7+
</div>
8+
);
9+
}

src/components/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export { Container } from './container'
2+
export { Youtube } from './youtube'

src/components/youtube.tsx

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { Container } from "./container";
2+
import cn from "clsx";
3+
4+
export interface YoutubeProps {
5+
code: string;
6+
title: string;
7+
}
8+
9+
export function Youtube(props: YoutubeProps): JSX.Element {
10+
return (
11+
<Container>
12+
<figure className="relative nx-my-6 nx-group">
13+
<iframe
14+
src={`https://www.youtube.com/embed/${props.code}`}
15+
title={props.title}
16+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
17+
allowFullScreen
18+
frameBorder={0}
19+
className={cn(
20+
"nx-w-full nx-aspect-video nx-max-h-96 nx-mx-auto group-hover:nx-shadow-lg nx-rounded-xl",
21+
"nx-border nx-bg-gray-100 dark:nx-border-neutral-700"
22+
)}
23+
></iframe>
24+
25+
<figcaption className="nx-mx-auto">
26+
<hr className="nx-mx-auto nx-w-[40%] nx-border-t nx-border-primary nx-mt-5 nx-mb-3" />
27+
<h2
28+
className={cn(
29+
"nx-text-center nx-italic nx-mb-4 nx-leading-tight nx-tracking-tight",
30+
"dark:nx-text-neutral-300 group-hover:nx-text-primary-700",
31+
"dark:group-hover:nx-text-primary-500"
32+
)}
33+
>
34+
{props.title}
35+
</h2>
36+
</figcaption>
37+
</figure>
38+
</Container>
39+
);
40+
}

src/pages/_meta.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
22
"index": "Introduction",
3-
"specifications": "Cahier des charges"
3+
"specs": "Cahier des charges",
4+
"resources": "Resources"
45
}

src/pages/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,6 @@ Nous vous recommandons d'utiliser un des éditeurs suivants avec les plugins ass
4444

4545
### Conventions de nommage
4646

47-
<Callout emoji="" type="warning">
47+
<Callout type="warning">
4848
TODO: Rediriger vers la documentation des conventions de nommage/les guidelines
4949
</Callout>

src/pages/resources/_meta.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"worlds-gen": "Génération des mondes"
3+
}

src/pages/resources/worlds-gen.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { Youtube } from "components";
2+
3+
# Génération des mondes
4+
5+
<Youtube code="YyVAaJqYAfE" title="THIS is how Minecraft Works 💎⛏️" />
6+
7+
<Youtube code="ob3VwY4JyzE" title="Reinventing Minecraft world generation by Henrik Kniberg" />

src/pages/specifications/worlds-gen.mdx

Lines changed: 0 additions & 6 deletions
This file was deleted.
File renamed without changes.
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"knowledge-base": "Base De Connaissances",
55
"technical-points": "Technical Points",
66
"nomenclature": "Nomenclature",
7-
"worlds-gen": "Génération des mondes",
87
"chunks": "Chunks",
98
"blocks": "Blocs"
109
}

0 commit comments

Comments
 (0)