Skip to content

Commit 04a72db

Browse files
committed
added showcase as a global collection
1 parent 1f7436a commit 04a72db

23 files changed

+78
-17
lines changed

content/showcase/boardspace.png

518 KB
Loading

content/showcase/boardspace.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
title: Boardspace
2+
description: A board game playing application using AWT. Over 100 games are available to play against human and robot opponents using WebSockets.
3+
url: https://boardspace.net/login.html
4+
heroImage: ./boardspace.png
5+
tags:
6+
- CheerpJ

content/showcase/browsercraft.png

201 KB
Loading

content/showcase/browsercraft.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
title: Browsercraft
2+
description: Minecraft running unmodified in the browser!
3+
url: https://browsercraft.cheerpj.com/
4+
heroImage: ./browsercraft.png
5+
tags:
6+
- CheerpJ

content/showcase/cjdom.png

223 KB
Loading

content/showcase/cjdom.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
title: CJDom
2+
description: A library providing bindings to common Web/DOM APIs for CheerpJ.
3+
url: https://github.com/reportmill/CJDom
4+
heroImage: ./cjdom.png
5+
tags:
6+
- CheerpJ
353 KB
Loading
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
title: "Dragon Court: Revived"
2+
description: An old-school fantasy RPG, revived with in-game trading, multiplayer clans, and competitive leaderboards.
3+
url: https://dragoncourt.penguinchilling.com/
4+
heroImage: ./dragoncourtrevived.png
5+
tags:
6+
- CheerpJ

content/showcase/imagej.webp

97.8 KB
Binary file not shown.

content/showcase/imagej.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
title: ImageJ.js
2+
description: A web port of ImageJ, an open-source image processing tool popular in the scientific community.
3+
url: https://aicell.io/post/improving-imagej.js/
4+
# https://github.com/aicell-lab/imagej.js
5+
heroImage: ./imagej.webp
6+
tags:
7+
- CheerpJ

content/showcase/nasa-applets.png

125 KB
Loading

content/showcase/nasa-applets.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
title: NASA Aeronautics Simulators
2+
description: Interactive simulator applets for aeoronautics students, powered by CheerpJ.
3+
url: https://www1.grc.nasa.gov/beginners-guide-to-aeronautics/drop-simulator/
4+
heroImage: ./nasa-applets.png
5+
tags:
6+
- CheerpJ

content/showcase/phet.png

160 KB
Loading

content/showcase/phet.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
title: PHET Interactive Simulations
2+
description: Interactive physics simulations from the University of Colorado Boulder, powered by CheerpJ.
3+
url: https://phet.colorado.edu/en/simulations/filter?type=cheerpj
4+
heroImage: ./phet.png
5+
tags:
6+
- CheerpJ

packages/astro-theme/components/ShowcaseList.astro

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
---
22
import { getCollection } from "astro:content";
33
import { Image } from "astro:assets";
4+
import type { CollectionEntry } from "astro:content";
45
5-
interface Props {
6+
type Props = CollectionEntry<"showcase">["data"] & { //redundant collection
67
limit?: number;
7-
}
8+
};
89
910
const props = Astro.props;
1011
12+
1113
let projects = await getCollection("showcase");
1214
1315
if (typeof props.limit == "number") {
@@ -24,14 +26,18 @@ if (typeof props.limit == "number") {
2426
href={project.data.url}
2527
class="block h-full p-2 border border-stone-700 text-stone-500 rounded-lg shadow-lg hover:translate-y-[-2px] hover:border-stone-600 hover:text-stone-400 transition-all"
2628
>
27-
<Image
28-
alt={project.data.title}
29-
src={project.data.image}
30-
class="rounded bg-primary-500 overflow-hidden"
31-
width={334 * 2}
32-
height={223 * 2}
33-
loading="lazy"
34-
/>
29+
{
30+
project.data.heroImage && (
31+
<Image
32+
src={project.data.heroImage}
33+
alt={project.data.title}
34+
class="rounded bg-primary-500 overflow-hidden"
35+
width={334 * 2}
36+
height={223 * 2}
37+
loading="lazy"
38+
/>
39+
)
40+
}
3541
<h5 class="font-semibold p-3 pb-1 text-stone-100">
3642
{project.data.title}
3743
</h5>

packages/astro-theme/content.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,17 @@ export function defineCommonCollections() {
5151
tags: productTags.optional(),
5252
}),
5353
}),
54+
showcase: defineCollection({
55+
type: "data",
56+
schema: ({ image }) =>
57+
z.object({
58+
title: z.string(),
59+
description: z.string().optional(),
60+
url: z.string(),
61+
heroImage: image().refine((img) => img.width / img.height == 1.5, {
62+
message: "Image must have 3:2 aspect ratio",
63+
}),
64+
}),
65+
}),
5466
};
5567
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
title: Boardspace
22
description: A board game playing application using AWT. Over 100 games are available to play against human and robot opponents using WebSockets.
33
url: https://boardspace.net/login.html
4-
image: ./boardspace.png
4+
heroImage: ./boardspace.png
55
tags:
66
- CheerpJ
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
title: Browsercraft
22
description: Minecraft running unmodified in the browser!
33
url: https://browsercraft.cheerpj.com/
4-
image: ./browsercraft.png
4+
heroImage: ./browsercraft.png
55
tags:
66
- CheerpJ
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
title: CJDom
22
description: A library providing bindings to common Web/DOM APIs for CheerpJ.
33
url: https://github.com/reportmill/CJDom
4-
image: ./cjdom.png
4+
heroImage: ./cjdom.png
55
tags:
66
- CheerpJ
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
title: "Dragon Court: Revived"
22
description: An old-school fantasy RPG, revived with in-game trading, multiplayer clans, and competitive leaderboards.
33
url: https://dragoncourt.penguinchilling.com/
4-
image: ./dragoncourtrevived.png
4+
heroImage: ./dragoncourtrevived.png
55
tags:
66
- CheerpJ

sites/cheerpj/src/content/showcase/imagej.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ title: ImageJ.js
22
description: A web port of ImageJ, an open-source image processing tool popular in the scientific community.
33
url: https://aicell.io/post/improving-imagej.js/
44
# https://github.com/aicell-lab/imagej.js
5-
image: ./imagej.webp
5+
heroImage: ./imagej.webp
66
tags:
77
- CheerpJ
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
title: NASA Aeronautics Simulators
22
description: Interactive simulator applets for aeoronautics students, powered by CheerpJ.
33
url: https://www1.grc.nasa.gov/beginners-guide-to-aeronautics/drop-simulator/
4-
image: ./nasa-applets.png
4+
heroImage: ./nasa-applets.png
55
tags:
66
- CheerpJ
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
title: PHET Interactive Simulations
22
description: Interactive physics simulations from the University of Colorado Boulder, powered by CheerpJ.
33
url: https://phet.colorado.edu/en/simulations/filter?type=cheerpj
4-
image: ./phet.png
4+
heroImage: ./phet.png
55
tags:
66
- CheerpJ

0 commit comments

Comments
 (0)