Refactoring
This commit is contained in:
@@ -44,7 +44,7 @@ function mapMap<T, K, J>(i: Map<T, K>, fn: (key: T, value: K) => J): J[] {
|
||||
class="w-full object-cover rounded-b-2xl shadow-2xl dark:brightness-75"
|
||||
style="height: calc(100vh + 1rem)" draggable="false" loading="eager"/>
|
||||
<drop-in class="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 flex flex-col items-center">
|
||||
<h1 class="text-4xl sm:text-6xl md:text-8xl font-extrabold text-white -translate-y-16 opacity-0 barlow"
|
||||
<h1 class="text-4xl sm:text-6xl md:text-8xl font-extrabold text-white -translate-y-16 opacity-0 barlow tracking-wider"
|
||||
style="transition: transform .7s ease-out, opacity .7s linear; text-shadow: 2px 2px 5px black;">
|
||||
<span class="text-yellow-400">{t("home.title.first")}</span><span
|
||||
class="text-neutral-600">{t("home.title.second")}</span>
|
||||
|
||||
@@ -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