diff --git a/apps/website/src/components/blog/BlogImageSlider.astro b/apps/website/src/components/blog/BlogImageSlider.astro new file mode 100644 index 000000000..081164440 --- /dev/null +++ b/apps/website/src/components/blog/BlogImageSlider.astro @@ -0,0 +1,134 @@ +--- +interface SliderImage { + src: string; + alt: string; + caption?: string; +} + +interface Props { + images: SliderImage[]; + thumbPosition?: 'bottom' | 'right'; + showArrows?: boolean; +} + +const { images = [], thumbPosition = 'bottom', showArrows = true } = Astro.props; +const sliderId = `slider-${Math.random().toString(36).slice(2, 10)}`; +--- + +{images.length > 0 && ( +
+
+ {images[0].alt} + + {showArrows && images.length > 1 && ( + <> + + + + )} +
+ +

{images[0].caption ?? ''}

+ + {images.length > 1 && ( +
+ {images.map((image, index) => ( + + ))} +
+ )} +
+)} + + diff --git a/apps/website/src/content/blog/blog-components-demo.mdx b/apps/website/src/content/blog/blog-components-demo.mdx index 638ce22a8..148c6a1e5 100644 --- a/apps/website/src/content/blog/blog-components-demo.mdx +++ b/apps/website/src/content/blog/blog-components-demo.mdx @@ -21,6 +21,7 @@ import StatusPill from '../../components/blog/StatusPill.astro'; import ChangeTable from '../../components/blog/ChangeTable.astro'; import CopyCommand from '../../components/blog/CopyCommand.astro'; import ImageGallery from '../../components/blog/ImageGallery.astro'; +import BlogImageSlider from '../../components/blog/BlogImageSlider.astro'; import Spoiler from '../../components/blog/Spoiler.astro'; import FaqAccordion from '../../components/blog/FaqAccordion.astro'; @@ -176,6 +177,28 @@ $ xattr -c /Applications/IPTVnator.app ]} /> +## Image slider + + + ## Spoiler block