add panellum to bundle

create card event component
fix heading levels card event
This commit is contained in:
Enrico Bühler 2024-07-02 21:01:34 +02:00
parent 70d5f10c6d
commit 089c1b7667
4 changed files with 41 additions and 27 deletions

View File

@ -0,0 +1,32 @@
---
import type { Event } from "@/lib/events-api";
import Card from "../Card.astro";
type Props = {
event: Event;
};
const { event } = Astro.props;
---
<Card class="" padding={false}>
<div class="bg-primary rounded-t-card p-card">
<h3 class="text-neutral">
<span class="block font-medium">
{event.start.toLocaleDateString("de-DE", { year: "numeric" })}
</span>
<span class="block font-bold text-4xl">
{
event.start.toLocaleDateString("de-DE", {
month: "long",
day: "numeric",
})
}
</span>
</h3>
</div>
<div class="p-card">
<h3>{event.title}</h3>
<Fragment class="text-secondary" set:html={event.description} />
</div>
</Card>

View File

@ -16,7 +16,12 @@ import { Menu } from "lucide-astro";
<h2 class="text-3xl font-extrabold">vspace.one</h2> <h2 class="text-3xl font-extrabold">vspace.one</h2>
</a> </a>
</div> </div>
<Button variant="default" class="lg:hidden" id="nav-button"> <Button
aria-label="Blendet die Navigation ein oder aus"
variant="default"
class="lg:hidden"
id="nav-button"
>
<Menu /> <Menu />
</Button> </Button>
<div <div

View File

@ -1,5 +1,5 @@
--- ---
import Card from "@/components/Card.astro"; import CardEvent from "@/components/Cards/CardEvent.astro";
import Heading from "@/components/Heading.astro"; import Heading from "@/components/Heading.astro";
import { getEvents } from "@/lib/events-api"; import { getEvents } from "@/lib/events-api";
@ -8,25 +8,5 @@ const events = await getEvents();
<Heading>Events</Heading> <Heading>Events</Heading>
<div class="grid md:grid-cols-1 lg:grid-cols-2 gap-main"> <div class="grid md:grid-cols-1 lg:grid-cols-2 gap-main">
{ {events.map((e) => <CardEvent event={e} />)}
events.map((e) => (
<Card class="" padding={false}>
<div class="bg-primary rounded-t-card p-card">
<h5 class="text-neutral">
{e.start.toLocaleDateString("de-DE", { year: "numeric" })}
</h5>
<h2 class="text-4xl text-neutral">
{e.start.toLocaleDateString("de-DE", {
month: "long",
day: "numeric",
})}
</h2>
</div>
<div class="p-card">
<h3>{e.title}</h3>
<Fragment class="text-secondary" set:html={e.description} />
</div>
</Card>
))
}
</div> </div>

View File

@ -38,13 +38,10 @@ import { Image } from "astro:assets";
src="/pic/panorama/maschinenraum_half.jpg" src="/pic/panorama/maschinenraum_half.jpg"
mode="pano"></!little-planet--> mode="pano"></!little-planet-->
</div> </div>
<script
is:inline
type="text/javascript"
src="https://cdn.pannellum.org/2.3/pannellum.js"></script>
<script> <script>
import { animate } from "motion"; import { animate } from "motion";
import { ease } from "@unom/style"; import { ease } from "@unom/style";
import "pannellum";
const init = () => { const init = () => {
const panoBg = document.getElementById("pano-bg")!; const panoBg = document.getElementById("pano-bg")!;