diff --git a/astro/src/components/Hero.astro b/astro/src/components/Hero.astro index 2b98c55f..57d80d54 100644 --- a/astro/src/components/Hero.astro +++ b/astro/src/components/Hero.astro @@ -1,12 +1,14 @@ --- import { getImage } from "astro:assets"; import type { ImageMetadata } from "astro"; +import RandomContent from "./RandomContent.astro"; interface Props { image: ImageMetadata | string; theme?: string; columns?: string; actionBreakpoint?: string; + actionBarItems?: number; } const { @@ -14,6 +16,7 @@ const { theme = "primary", columns = "col-lg-6", actionBreakpoint = "lg", + actionBarItems = 3, } = Astro.props; let heroBgUrl; @@ -39,11 +42,12 @@ if (image) { { Astro.slots.has("action-bar") && (
-
-
+
) } diff --git a/astro/src/components/RandomContent.astro b/astro/src/components/RandomContent.astro new file mode 100644 index 00000000..07c4ae6b --- /dev/null +++ b/astro/src/components/RandomContent.astro @@ -0,0 +1,73 @@ +--- +// When rendered on the server this, displays the first x children and hides the rest. +// On page load, the client script picks the number given to show and hides the rest. + +import type { HTMLAttributes } from 'astro/types'; +interface Props extends HTMLAttributes<"div"> { + numChildren?: 1 | 2 | 3 | 4 | 5 | 6 | `${1 | 2 | 3 | 4 | 5 | 6}`; +} +const { numChildren = 1, ...attrs } = Astro.props; +--- + +
+ +
+ + + +