3D Public Preview Initial Test

This commit is contained in:
2024-03-06 15:46:28 +01:00
parent d46b3ec511
commit 3de8832689
11 changed files with 238 additions and 2 deletions

View File

@@ -0,0 +1,33 @@
---
import {createGetStaticPaths} from "astro-i18n";
import { getCollection, CollectionEntry } from "astro:content";
import PageLayout from "../../layouts/PageLayout.astro";
import PublicPreview from "@components/3d/PublicPreview.svelte";
import { Image } from "astro:assets";
export const getStaticPaths = createGetStaticPaths(async () => {
const pages = await getCollection("publics");
return pages.map((entry) => ({
props: {
schem: entry,
},
params: {
schem: entry.id,
},
}));
});
const { schem }: { schem: CollectionEntry<"publics">} = Astro.props;
---
<PageLayout title={schem.data.name}>
<h1 class="text-5xl font-bold" transition:name={schem.data.name + "-title"}>{schem.data.name}</h1>
<PublicPreview client:idle file={schem.id}>
<Image transition:name={schem.data.name + "-img"} src={schem.data.image} alt={schem.data.name}></Image>
</PublicPreview>
<p transition:name={schem.data.name + "-desc"}>{schem.data.description}</p>
<p>
Erbauer: {schem.data.creator.join(", ")}
</p>
</PageLayout>