Refactoring
This commit is contained in:
@@ -23,8 +23,8 @@ const { schem }: { schem: CollectionEntry<"publics">} = Astro.props;
|
||||
|
||||
<PageLayout title={schem.data.name}>
|
||||
<h1 class="text-5xl font-bold w-fit" transition:name={schem.data.id + "-title"}>{schem.data.name}</h1>
|
||||
<PublicPreview client:idle file={schem.id} imageHeight={schem.data.image.height}>
|
||||
<Image transition:name={schem.data.id + "-img"} src={schem.data.image} alt={schem.data.name}></Image>
|
||||
<PublicPreview client:idle pub={schem} imageHeight={schem.data.image.height}>
|
||||
<Image class="object-contain" transition:name={schem.data.id + "-img"} src={schem.data.image} alt={schem.data.name}></Image>
|
||||
</PublicPreview>
|
||||
<p transition:name={schem.data.id + "-desc"}>{schem.data.description}</p>
|
||||
<p>
|
||||
|
||||
@@ -5,25 +5,30 @@ import {l} from "../../util/util";
|
||||
import { Image } from "astro:assets";
|
||||
import Card from "@components/Card.svelte";
|
||||
import XRayPreview from "@components/publics/XRayPreview.svelte";
|
||||
import {t} from "astro-i18n";
|
||||
|
||||
const gamemodes = await getCollection("modes");
|
||||
const publics = await getCollection("publics");
|
||||
---
|
||||
|
||||
<PageLayout title="Publics">
|
||||
<div>
|
||||
{publics.map((pub) => (
|
||||
<a href={l("/publics/" + pub.id)}>
|
||||
<Card extraClasses="w-full mx-0">
|
||||
<div class="flex justify-center">
|
||||
<XRayPreview client:load>
|
||||
<Image style="width: 500px" slot="normal" src={pub.data.image} alt={pub.data.name} transition:name={pub.data.id + "-img"} />
|
||||
{pub.data.xray && <Image slot="xray" class="bg-zinc-50 dark:bg-zinc-900" src={pub.data.xray} alt={pub.data.name} />}
|
||||
</XRayPreview>
|
||||
</div>
|
||||
<h2 class="font-bold text-5xl" transition:name={pub.data.id + "-title"}>{pub.data.name}</h2>
|
||||
<h3 transition:name={pub.data.id + "-desc"}>{pub.data.description}</h3>
|
||||
</Card>
|
||||
</a>
|
||||
))}
|
||||
</div>
|
||||
{gamemodes.filter(value => publics.map(value1 => value1.data.gamemode.id).includes(value.id)).map((gamemode) => (
|
||||
<h1 class="text-4xl font-bold">{t(`${gamemode.data.translationKey}.title`)}</h1>
|
||||
<div class="grid grid-cols-2 gap-2">
|
||||
{publics.filter(value => value.data.gamemode.id == gamemode.id).map((pub) => (
|
||||
<a href={l("/publics/" + pub.id)}>
|
||||
<Card extraClasses="w-full m-0" hoverEffect={false}>
|
||||
<div class="flex justify-center">
|
||||
<XRayPreview client:load>
|
||||
<Image style="width: 500px" slot="normal" src={pub.data.image} alt={pub.data.name} transition:name={pub.data.id + "-img"} />
|
||||
{pub.data.xray && <Image slot="xray" class="bg-zinc-50 dark:bg-zinc-900" src={pub.data.xray} alt={pub.data.name} />}
|
||||
</XRayPreview>
|
||||
</div>
|
||||
<h2 class="font-bold text-3xl" transition:name={pub.data.id + "-title"}>{pub.data.name}</h2>
|
||||
<h3 transition:name={pub.data.id + "-desc"}>{pub.data.description}</h3>
|
||||
</Card>
|
||||
</a>
|
||||
))}
|
||||
</div>
|
||||
))}
|
||||
</PageLayout>
|
||||
|
||||
Reference in New Issue
Block a user