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...

+ +