From 22eb4eb7c7257089ba1122860cbd579e8cc0064a Mon Sep 17 00:00:00 2001 From: Kenzo Date: Wed, 16 Jul 2025 22:00:34 +0200 Subject: [PATCH] Add HoverCard component and integrate it into the homepage This commit introduces a reusable HoverCard component, designed to display an image, title, and hover-revealed text. The component is styled to match the website theme. Additionally, it has been integrated into the index.astro page with placeholder content for demonstration purposes. Updated the project configuration to include the Font Awesome library. --- .idea/Gallus_Pub.iml | 1 + Gallus_Pub_v1/src/components/HoverCard.astro | 91 ++++++++++++++++++++ Gallus_Pub_v1/src/pages/index.astro | 7 ++ 3 files changed, 99 insertions(+) create mode 100644 Gallus_Pub_v1/src/components/HoverCard.astro diff --git a/.idea/Gallus_Pub.iml b/.idea/Gallus_Pub.iml index 24643cc..9f7ba11 100644 --- a/.idea/Gallus_Pub.iml +++ b/.idea/Gallus_Pub.iml @@ -8,5 +8,6 @@ + \ No newline at end of file diff --git a/Gallus_Pub_v1/src/components/HoverCard.astro b/Gallus_Pub_v1/src/components/HoverCard.astro new file mode 100644 index 0000000..17ff057 --- /dev/null +++ b/Gallus_Pub_v1/src/components/HoverCard.astro @@ -0,0 +1,91 @@ +--- +// HoverCard.astro +// Diese Komponente nimmt ein Bild, einen Titel und einen Text entgegen und zeigt sie als Hover-Karte an + +// Definieren der Props, die die Komponente akzeptiert +interface Props { + imageSrc: string; // Pfad zum Bild + title: string; // Titel der Karte + text: string; // Text, der beim Hover angezeigt wird + altText?: string; // Alternative Textbeschreibung für das Bild (optional) +} + +// Extrahieren der Props +const {imageSrc, title, text, altText = ""} = Astro.props; +--- + +
+

{title}

+
+ {altText +
+
+

{text}

+
+
+ + \ No newline at end of file diff --git a/Gallus_Pub_v1/src/pages/index.astro b/Gallus_Pub_v1/src/pages/index.astro index a89ec34..858053d 100644 --- a/Gallus_Pub_v1/src/pages/index.astro +++ b/Gallus_Pub_v1/src/pages/index.astro @@ -1,6 +1,7 @@ --- import Header from '../components/Header.astro'; import Footer from '../components/Footer.astro'; +import HoverCard from '../components/HoverCard.astro'; import '../../styles/index.css' --- @@ -27,6 +28,12 @@ import '../../styles/index.css'

Abschnitt 2

Mehr Inhalt zum Scrollen...

+ +